From 5e0cbe845e4ff8d01334319e402248141776e88d Mon Sep 17 00:00:00 2001 From: Byounguk Lee Date: Wed, 26 Nov 2025 05:02:26 +0000 Subject: [PATCH] Fixes #27184: Enhance error logs when it failed to relabel due to permission Signed-off-by: Byounguk Lee --- libpod/container_internal_common.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libpod/container_internal_common.go b/libpod/container_internal_common.go index acaa76ef3a..0215f13c44 100644 --- a/libpod/container_internal_common.go +++ b/libpod/container_internal_common.go @@ -3156,6 +3156,10 @@ func (c *Container) relabel(src, mountLabel string, shared bool) error { logrus.Debugf("Labeling not supported on %q", src) return nil } + if errors.Is(err, unix.EPERM) { + currentUID := os.Getuid() + return fmt.Errorf("labeling failed on %q: likely due to a file owned by another user (current user: uid %d) or insufficient permissions: %w", src, currentUID, err) + } return err }