Skip to content

fix: add audit information for WorkspaceBuild.MaxDeadilne #6504

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

Merged
merged 2 commits into from
Mar 8, 2023

Conversation

johnstcn
Copy link
Member

@johnstcn johnstcn commented Mar 8, 2023

Fixes panic when starting or stopping workspaces:

[API] panic: dev error: field "max_deadline" lacks audit information
[API] 
[API] goroutine 1619 [running]:
[API] github.com/coder/coder/enterprise/audit.diffValues({0x10b637a00?, 0x1401df65d00}, {0x10b637a00?, 0x1401df65e00}, 0x1401ec6d718?)
[API] /Users/cian/coder/enterprise/audit/diff.go:54 +0x82c
[API] github.com/coder/coder/enterprise/audit.NewAuditor.func1({0x10b637a00?, 0x1401df65d00?}, {0x10b637a00?, 0x1401df65e00?})
[API] /Users/cian/coder/enterprise/audit/audit.go:25 +0x34
[API] github.com/coder/coder/coderd/audit.Differ.diff(...)
[API] /Users/cian/coder/coderd/audit/diff.go:52
[API] github.com/coder/coder/coderd/audit.Diff[...](...)
[API] /Users/cian/coder/coderd/audit/diff.go:41
[API] github.com/coder/coder/coderd/audit.BuildAudit[...]({0x10b6ecf60, 0x1401edfa240}, 0x1401ec6f998)
[API] /Users/cian/coder/coderd/audit/request.go:220 +0x14c
[API] github.com/coder/coder/coderd/provisionerdserver.(*Server).CompleteJob(0x14001615c20, {0x10b6ee1f8?, 0x1401ede0900?}, 0x1401ea95630)
[API] /Users/cian/coder/coderd/provisionerdserver/provisionerdserver.go:1052 +0xef0
[API] github.com/coder/coder/provisionerd/proto.DRPCProvisionerDaemonDescription.Method.func5({0x10b4a4260?, 0x14001615c20}, {0x10b6ee1f8, 0x1401ede0900}, {0x10b5948a0?, 0x1401ea95630}, {0x1401d713d38?, 0x1028962e0?})

@johnstcn johnstcn self-assigned this Mar 8, 2023
@johnstcn johnstcn requested review from mtojek and mafredri March 8, 2023 11:46
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@johnstcn johnstcn enabled auto-merge (squash) March 8, 2023 12:41
@johnstcn johnstcn merged commit fe10ba1 into main Mar 8, 2023
@johnstcn johnstcn deleted the cj/workspace-build-ttl-audit branch March 8, 2023 12:41
@github-actions github-actions bot locked and limited conversation to collaborators Mar 8, 2023
@kylecarbs
Copy link
Member

Ahh, so this isn't tested because our audit implementation in Enterprise is different. We probably shouldn't ever panic here, and instead throw an error.

@kylecarbs
Copy link
Member

I'll do this in a future change though, just commenting.

@johnstcn
Copy link
Member Author

johnstcn commented Mar 8, 2023

Good observation! I didn't get around to adding tests, I just wanted to remove that particular 🔥

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants