Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6318520

Browse files
fix(cli/ssh): avoid swallowing unexpected http status codes (#20487)
If you were to somehow get a 401, or some other unexpected HTTP status code when following a workspace's build logs, `coder ssh` would swallow the error, and give you a different error that didn't make sense. In this case I was getting a 401 on `/templateversions/{templateversion}/dry-run/{jobID}/logs` , but the CLI error would say the workspace had no agents.I ran into the 401 when running a scaletest, and then whilst attempting to reproduce the issue locally, I ran `coder ssh` from one build of Coder that used `coder_session_token` as the session token cookie name, whilst the other build used `dev_coder_session_token` (as set by `develop.sh`). For reference, the CLI uses cookies when following the build logs.
1 parentf3f8354 commit6318520

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎cli/ssh.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,8 @@ func GetWorkspaceAndAgent(ctx context.Context, inv *serpent.Invocation, client *
951951
return codersdk.Workspace{}, codersdk.WorkspaceAgent{},nil,xerrors.Errorf("start workspace with active template version: %w",err)
952952
}
953953
_,_=fmt.Fprintln(inv.Stdout,"Unable to start the workspace with template version from last build. Your workspace has been updated to the current active template version.")
954+
default:
955+
return codersdk.Workspace{}, codersdk.WorkspaceAgent{},nil,xerrors.Errorf("start workspace with current template version: %w",err)
954956
}
955957
}elseiferr!=nil {
956958
return codersdk.Workspace{}, codersdk.WorkspaceAgent{},nil,xerrors.Errorf("start workspace with current template version: %w",err)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp