Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more mount information to errors #837

Merged
merged 2 commits into from
Mar 1, 2021
Merged

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Feb 26, 2021

Currently it is difficult to diagnose mount failures in overlay storage.
This issue is we are not sure of all of the mount options used when
attempting to mount the file system.

This PR adds missing data.

Signed-off-by: Daniel J Walsh dwalsh@redhat.com

@rhatdan
Copy link
Member Author

rhatdan commented Feb 26, 2021

The goal is to help with containers/podman#9507
@containers/podman-maintainers PTAL

@rhatdan
Copy link
Member Author

rhatdan commented Feb 26, 2021

@edsantiago PTAL

Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/me likes anything that makes error messages more user-friendly, thank you!

@@ -1169,7 +1169,7 @@ func (d *Driver) get(id string, disableShifting bool, options graphdriver.MountO
flags, data := mount.ParseOptions(mountData)
logrus.Debugf("overlay: mount_data=%s", mountData)
if err := mountFunc("overlay", mountTarget, "overlay", uintptr(flags), data); err != nil {
return "", fmt.Errorf("error creating overlay mount to %s: %v", mountTarget, err)
return "", fmt.Errorf("error creating overlay mount to %s, mount_data=%s: %v", mountTarget, mountData, err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will mountData ever include colons or spaces? If so would %q make those instances easier to read? Sorry for not testing on my end; I don't have much time today.

@@ -1159,7 +1159,7 @@ func (d *Driver) get(id string, disableShifting bool, options graphdriver.MountO
}
mountData = label.FormatMountLabel(opts, options.MountLabel)
if len(mountData) > pageSize {
return "", fmt.Errorf("cannot mount layer, mount label too large %d", len(mountData))
return "", fmt.Errorf("cannot mount layer, mount label %s too large %d", options.MountLabel, len(mountData))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I were seeing this error as a user my first question would be, "what is the limit?" Is this a likely error condition? If so, it might be polite to include something like "length (%d) must be <= %d", ..., len(mountData), pageSize)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very unlikely message.

@TomSweeneyRedHat
Copy link
Member

@rhatdan needs a rebase and I concur with @edsantiago 's questions.

Currently it is difficult to diagnose mount failures in overlay storage.
This issue is we are not sure of all of the mount options used when
attempting to mount the file system.

This PR adds missing data.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
@TomSweeneyRedHat
Copy link
Member

LGTM

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I clicked on rebase. Let's merge when it turns green again.

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

the issue with containers/podman#9507 seems to be at unmount time though, should we improve logging there as well?

EDIT: nevermind my suggestion, there is not much to improve there and the podman issue is caused by mount

@rhatdan rhatdan merged commit 3641877 into containers:master Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants