You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A workaround can be to catch this specific error and fall back to os.Getuid() and os.Getgid():
ifu, err:=user.Current(); err!=nil {
// UnknownUserIdError may happen if the user UID does not exist in /etc/passwd. It might be the case on K8S// if the user set securityContext.runAsUser to an arbitrary value._, ok:=err.(user.UnknownUserIdError)
if!ok {
returnerr
}
monitoring.NewString(registry, "uid").Set(strconv.Itoa(os.Getuid()))
monitoring.NewString(registry, "gid").Set(strconv.Itoa(os.Getgid()))
} else {
monitoring.NewString(registry, "username").Set(u.Username)
monitoring.NewString(registry, "uid").Set(u.Uid)
monitoring.NewString(registry, "gid").Set(u.Gid)
}
Happy to raise the relevant PR if you agree with this approach.
For confirmed bugs, please report:
Version: 7.16.0-SNAPSHOT (It works as expected with 7.15.x)
#28265 added a call to
user.Current()
. Unfortunatelyuser.Current()
fails if the user UID does not exist in/etc/passwd
, which is likely to be the case on K8S if user sets an arbitrary UID in thesecurityContext
.A workaround can be to catch this specific error and fall back to
os.Getuid()
andos.Getgid()
:Happy to raise the relevant PR if you agree with this approach.
For confirmed bugs, please report:
7.16.0-SNAPSHOT
(It works as expected with7.15.x
)Deploy an APM Server using ECK and the following manifest, APM Server fails with message
user: unknown userid 12345
:The text was updated successfully, but these errors were encountered: