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

cp fails to detect readonly mount and fallback into tar error #3313

Open
apostasie opened this issue Aug 14, 2024 · 1 comment · May be fixed by #3323
Open

cp fails to detect readonly mount and fallback into tar error #3313

apostasie opened this issue Aug 14, 2024 · 1 comment · May be fixed by #3323
Labels
kind/unconfirmed-bug-claim Unconfirmed bug claim

Comments

@apostasie
Copy link
Contributor

apostasie commented Aug 14, 2024

Description

This

https://github.com/containerd/nerdctl/blob/main/pkg/containerutil/cp_linux.go#L305

should surface error: "mount point %s is marked read-only"

This is two fold:

  • error message
  • more importantly, the logic in getContainerMountInfo seems to be broken

Steps to reproduce the issue

touch something
nerdctl volume create foo
nerdctl run -d --name testro -v foo:/bar:ro debian sleep Inf
nerdctl cp something testro:/bar

Describe the results you received and expected

Received:

/usr/bin/tar: something: Cannot open: Read-only file system
/usr/bin/tar: Exiting with failure status due to previous errors
FATA[0000] could not find container: testro, with error: failed to wait [nsenter -t 1958627 -U --preserve-credentials -- /usr/bin/tar -x -f -]: exit status 2

Expected:

mount point %s is marked read-only

What version of nerdctl are you using?

main

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

None

Host information

Am I missing something or doing something wrong?

@apostasie apostasie added the kind/unconfirmed-bug-claim Unconfirmed bug claim label Aug 14, 2024
@apostasie apostasie changed the title cp fails to detect readonly mount and fallbacks into tar error cp fails to detect readonly mount and fallback into tar error Aug 14, 2024
@apostasie
Copy link
Contributor Author

Actually, the method is never called (on a running container), because we have a root already (/proc/1958627/root).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/unconfirmed-bug-claim Unconfirmed bug claim
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant