Skip to content

Commit b0091ed

Browse files
procinfo: Do not treat username issue as an error (minio#34)
If the system cannot fetch username of the minio process owner, it gets reported as an error in the health report. However, this can happen for legitimate reasons (e.g. in minio-operator based environments) and is not something that needs to be flagged as an error. Fixed by ignoring error when trying to get the username, Set username to "<non-root>" in case of error
1 parent 8c928b2 commit b0091ed

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

health.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,10 +667,11 @@ func GetProcInfo(ctx context.Context, addr string) ProcInfo {
667667
return procInfo
668668
}
669669

670+
// In certain environments, it is not possible to get username e.g. minio-operator
671+
// Plus it's not a serious error. So ignore error if any.
670672
procInfo.Username, err = proc.UsernameWithContext(ctx)
671673
if err != nil {
672-
procInfo.Error = err.Error()
673-
return procInfo
674+
procInfo.Username = "<non-root>"
674675
}
675676

676677
return procInfo

0 commit comments

Comments
 (0)