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