@@ -1550,11 +1550,11 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
1550
1550
// during roll-out this is our fall-back case.
1551
1551
// Afterwards we might want to do some spinning-lock and re-check for a certain period (30s?) to give db-sync
1552
1552
// a change to move the imageBuildLogInfo across the globe.
1553
-
1554
- log . warn ( logCtx , "imageBuild logs: fallback!" ) ;
1555
- ctx . span ?. setTag ( "workspace.imageBuild.logs.fallback" , true ) ;
1556
- await this . deprecatedDoWatchWorkspaceImageBuildLogs ( ctx , logCtx , user , workspace ) ;
1557
- return ;
1553
+ log . error ( logCtx , "cannot watch imagebuild logs for workspaceId: no image build info available" ) ;
1554
+ throw new ResponseError (
1555
+ ErrorCodes . HEADLESS_LOG_NOT_YET_AVAILABLE ,
1556
+ "cannot watch imagebuild logs for workspaceId" ,
1557
+ ) ;
1558
1558
}
1559
1559
1560
1560
const aborted = new Deferred < boolean > ( ) ;
@@ -1599,47 +1599,6 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
1599
1599
}
1600
1600
}
1601
1601
1602
- protected async deprecatedDoWatchWorkspaceImageBuildLogs (
1603
- ctx : TraceContext ,
1604
- logCtx : LogContext ,
1605
- user : User ,
1606
- workspace : Workspace ,
1607
- ) {
1608
- if ( ! workspace . imageNameResolved ) {
1609
- log . debug ( logCtx , `No imageNameResolved set for workspaceId, cannot watch logs.` ) ;
1610
- return ;
1611
- }
1612
-
1613
- try {
1614
- const imgbuilder = await this . imageBuilderClientProvider . getDefault (
1615
- user ,
1616
- workspace ,
1617
- { } as WorkspaceInstance ,
1618
- ) ;
1619
- const req = new LogsRequest ( ) ;
1620
- req . setCensored ( true ) ;
1621
- req . setBuildRef ( workspace . imageNameResolved ) ;
1622
-
1623
- let lineCount = 0 ;
1624
- await imgbuilder . logs ( ctx , req , ( data ) => {
1625
- if ( ! this . client ) {
1626
- return "stop" ;
1627
- }
1628
- data = data . replace ( "\n" , WorkspaceImageBuild . LogLine . DELIMITER ) ;
1629
- lineCount += data . split ( WorkspaceImageBuild . LogLine . DELIMITER_REGEX ) . length ;
1630
-
1631
- this . client . onWorkspaceImageBuildLogs ( undefined as any , {
1632
- text : data ,
1633
- isDiff : true ,
1634
- upToLine : lineCount ,
1635
- } ) ;
1636
- return "continue" ;
1637
- } ) ;
1638
- } catch ( err ) {
1639
- log . error ( logCtx , `cannot watch logs for workspaceId` , err ) ;
1640
- }
1641
- }
1642
-
1643
1602
async getHeadlessLog ( ctx : TraceContext , instanceId : string ) : Promise < HeadlessLogUrls > {
1644
1603
traceAPIParams ( ctx , { instanceId } ) ;
1645
1604
0 commit comments