Skip to content

Can't access logs when workspace fails #3329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ammario opened this issue Jul 31, 2022 · 2 comments
Closed

Can't access logs when workspace fails #3329

ammario opened this issue Jul 31, 2022 · 2 comments

Comments

@ammario
Copy link
Member

ammario commented Jul 31, 2022

As a template admin, I try out my template by creating a workspace. Since there is a failure in my startup_script, the workspace "fails" and its resources are immediately deleted. The problem is I've now lost my /var/log/coder-startup-script.log and can no longer find the error.

A workaround is adding an sleep 999999 or disabling set -e in my startup script, but ideally I can find the error without making a temporary modification to my startup_script.

Some approaches:

@kylecarbs
Copy link
Member

Are you certain this is happening? Our code doesn't do this...

coder/agent/agent.go

Lines 153 to 164 in f82df1b

if a.startupScript.CAS(false, true) {
// The startup script has not ran yet!
go func() {
err := a.runStartupScript(ctx, metadata.StartupScript)
if errors.Is(err, context.Canceled) {
return
}
if err != nil {
a.logger.Warn(ctx, "agent script failed", slog.Error(err))
}
}()
}

@ammario
Copy link
Member Author

ammario commented Jul 31, 2022

Oh. I made this issue a few weeks after experiencing it so I misremembered.

@ammario ammario closed this as not planned Won't fix, can't repro, duplicate, stale Jul 31, 2022
@misskniss misskniss added invalid and removed feature labels Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants