fix(agent): filter out GOTRACEBACK=none
#16924
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the switch to Go 1.24.1, our dogfood workspaces started setting
GOTRACEBACK=none
in the environment, resulting in missing stacktracesfor users.
This is due to the capability changes we do when
USE_CAP_NET_ADMIN=true
.coder/provisionersdk/scripts/bootstrap_linux.sh
Lines 60 to 76 in 564b387
This most likely triggers a change in securitybits which sets
_AT_SECURE
for the process.https://github.com/golang/go/blob/a1ddbdd3ef8b739aab53f20d6ed0a61c3474cf12/src/runtime/os_linux.go#L297-L327
Which in turn triggers secure mode:
https://github.com/golang/go/blob/a1ddbdd3ef8b739aab53f20d6ed0a61c3474cf12/src/runtime/security_unix.go
A better fix may be to read
/proc/self/environ
to figure out if thiswas set by the runtime or manually, but I'm not sure we should care
about that. A template author can still set the environment on the agent
resource.
See https://pkg.go.dev/runtime#hdr-Security