Skip to content

Commit d0f46be

Browse files
committed
Improve supervisor failed reading bob log error
1 parent fbd4b35 commit d0f46be

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

components/dashboard/src/workspaces/CreateWorkspacePage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -552,9 +552,9 @@ export function CreateWorkspacePage() {
552552
<span className="text-sm">{warningIde}</span>
553553
</Alert>
554554
)}
555-
{workspaceContext.data?.data.metadata?.warnings.map((w) => (
556-
<Alert type="warning" key={w}>
557-
<span className="text-sm">{w}</span>
555+
{workspaceContext.data?.data.metadata?.warnings.map((warning) => (
556+
<Alert type="warning" key={warning}>
557+
<span className="text-sm">{warning}</span>
558558
</Alert>
559559
)) ?? []}
560560

components/supervisor/pkg/supervisor/supervisor.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,19 +1599,21 @@ func stopWhenTasksAreDone(wg *sync.WaitGroup, cfg *Config, shutdown chan Shutdow
15991599

16001600
success := <-successChan
16011601
if success.Failed() {
1602-
var msg []byte
1602+
var msg string
16031603
if cfg.isImageBuild() {
16041604
logFromFile, err := os.ReadFile("/workspace/.gitpod/bob.log")
1605+
debugMsg := "Debug this using `gp validate` (visit https://www.gitpod.io/docs/configure/workspaces#validate-your-gitpod-configuration) to learn more"
16051606
if err != nil {
1606-
msg = []byte("err while reading bob.log" + err.Error())
1607+
log.WithError(err).Error("err while reading bob.log")
1608+
msg = fmt.Sprintf("image build failed: %s. %s", string(success), debugMsg)
16071609
} else {
1608-
msg = []byte("image build failed: " + string(logFromFile) + ". Debug this using `gp validate` (visit https://www.gitpod.io/docs/configure/workspaces#validate-your-gitpod-configuration) to learn more")
1610+
msg = fmt.Sprintf("image build failed: %s. %s", string(logFromFile), debugMsg)
16091611
}
16101612
} else {
1611-
msg = []byte("headless task failed: " + string(success))
1613+
msg = fmt.Sprintf("headless task failed: %s", string(success))
16121614
}
16131615
// we signal task failure via kubernetes termination log
1614-
err := os.WriteFile("/dev/termination-log", msg, 0o644)
1616+
err := os.WriteFile("/dev/termination-log", []byte(msg), 0o644)
16151617
if err != nil {
16161618
log.WithError(err).Error("err while writing termination log")
16171619
}

0 commit comments

Comments
 (0)