From 907cc872bd73250264218d012e0a0561f1a0fee0 Mon Sep 17 00:00:00 2001 From: Wouter Verlaek Date: Thu, 5 Jan 2023 16:05:08 +0000 Subject: [PATCH] [server] Wait for image build logs in preparing state --- components/dashboard/debug.sh | 7 +++++++ components/server/src/workspace/gitpod-server-impl.ts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 components/dashboard/debug.sh diff --git a/components/dashboard/debug.sh b/components/dashboard/debug.sh new file mode 100755 index 00000000000000..3cb45be38cb541 --- /dev/null +++ b/components/dashboard/debug.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# Copyright (c) 2022 Gitpod GmbH. All rights reserved. +# Licensed under the GNU Affero General Public License (AGPL). +# See License.AGPL.txt in the project root for license information. + +set -Eeuo pipefail +source /workspace/gitpod/scripts/ws-deploy.sh deployment dashboard diff --git a/components/server/src/workspace/gitpod-server-impl.ts b/components/server/src/workspace/gitpod-server-impl.ts index 7d3623e81d6763..f52d43be49536c 100644 --- a/components/server/src/workspace/gitpod-server-impl.ts +++ b/components/server/src/workspace/gitpod-server-impl.ts @@ -1639,7 +1639,7 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { await new Promise((resolve) => setTimeout(resolve, 2000)); const wsi = await this.workspaceDb.trace(ctx).findInstanceById(instance.id); - if (!wsi || wsi.status.phase !== "building") { + if (!wsi || !["preparing", "building"].includes(wsi.status.phase)) { log.debug(logCtx, `imagebuild logs: instance is not/no longer in 'building' state`, { phase: wsi?.status.phase, });