Artifact getter breaks when Nomad is run as non-root #16789
Labels
hcc/cst
Admin - internal
stage/accepted
Confirmed, and intend to work on. No timeline committment though.
theme/artifact
type/bug
Milestone
Nomad version
Nomad v1.5.1+ent
Issue
The artifact getter now runs as a subprocess since v1.5.0. We run nomad as a non-root user and the getter fails with:
The error originates from this syscall:
Which comes from setting the GID and UID in SysProcAttr:
https://github.com/hashicorp/nomad/blob/v1.5.1/client/allocrunner/taskrunner/getter/util.go#L140
https://github.com/hashicorp/nomad/blob/v1.5.1/client/allocrunner/taskrunner/getter/util_linux.go#L29
The code was intended to be used to drop privileges and run the getter as nobody when the nomad binary runs as root but that has been reverted in 95359b8.
Unfortunately when nomad is run as a non user, setting the GID for the child doesn't work as the user lacks
cap_setgid
.A workaround is:
or removing setting the attributes altogether as they are technically non required and they'll be inherited from the parent:
Same issue was addressed here for non-Linux systems: 78d8ae0
The text was updated successfully, but these errors were encountered: