@@ -109,7 +109,7 @@ import {
109109 RemotePageMessage ,
110110 RemoteTrackMessage ,
111111} from "@gitpod/gitpod-protocol/lib/analytics" ;
112- import { ImageBuilderClientProvider , LogsRequest } from "@gitpod/image-builder/lib" ;
112+ import { ImageBuilderClientProvider } from "@gitpod/image-builder/lib" ;
113113import { WorkspaceManagerClientProvider } from "@gitpod/ws-manager/lib/client-provider" ;
114114import {
115115 ControlPortRequest ,
@@ -1559,11 +1559,11 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
15591559 // during roll-out this is our fall-back case.
15601560 // Afterwards we might want to do some spinning-lock and re-check for a certain period (30s?) to give db-sync
15611561 // a change to move the imageBuildLogInfo across the globe.
1562-
1563- log . warn ( logCtx , "imageBuild logs: fallback!" ) ;
1564- ctx . span ?. setTag ( "workspace.imageBuild.logs.fallback" , true ) ;
1565- await this . deprecatedDoWatchWorkspaceImageBuildLogs ( ctx , logCtx , user , workspace ) ;
1566- return ;
1562+ log . error ( logCtx , "cannot watch imagebuild logs for workspaceId: no image build info available" ) ;
1563+ throw new ResponseError (
1564+ ErrorCodes . HEADLESS_LOG_NOT_YET_AVAILABLE ,
1565+ "cannot watch imagebuild logs for workspaceId" ,
1566+ ) ;
15671567 }
15681568
15691569 const aborted = new Deferred < boolean > ( ) ;
@@ -1608,47 +1608,6 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
16081608 }
16091609 }
16101610
1611- protected async deprecatedDoWatchWorkspaceImageBuildLogs (
1612- ctx : TraceContext ,
1613- logCtx : LogContext ,
1614- user : User ,
1615- workspace : Workspace ,
1616- ) {
1617- if ( ! workspace . imageNameResolved ) {
1618- log . debug ( logCtx , `No imageNameResolved set for workspaceId, cannot watch logs.` ) ;
1619- return ;
1620- }
1621-
1622- try {
1623- const imgbuilder = await this . imageBuilderClientProvider . getDefault (
1624- user ,
1625- workspace ,
1626- { } as WorkspaceInstance ,
1627- ) ;
1628- const req = new LogsRequest ( ) ;
1629- req . setCensored ( true ) ;
1630- req . setBuildRef ( workspace . imageNameResolved ) ;
1631-
1632- let lineCount = 0 ;
1633- await imgbuilder . logs ( ctx , req , ( data ) => {
1634- if ( ! this . client ) {
1635- return "stop" ;
1636- }
1637- data = data . replace ( "\n" , WorkspaceImageBuild . LogLine . DELIMITER ) ;
1638- lineCount += data . split ( WorkspaceImageBuild . LogLine . DELIMITER_REGEX ) . length ;
1639-
1640- this . client . onWorkspaceImageBuildLogs ( undefined as any , {
1641- text : data ,
1642- isDiff : true ,
1643- upToLine : lineCount ,
1644- } ) ;
1645- return "continue" ;
1646- } ) ;
1647- } catch ( err ) {
1648- log . error ( logCtx , `cannot watch logs for workspaceId` , err ) ;
1649- }
1650- }
1651-
16521611 async getHeadlessLog ( ctx : TraceContext , instanceId : string ) : Promise < HeadlessLogUrls > {
16531612 traceAPIParams ( ctx , { instanceId } ) ;
16541613
0 commit comments