Skip to content

Conversation

@yankay
Copy link
Contributor

@yankay yankay commented Aug 6, 2024

Show different error message when the container exists to fix nerdctl cp failure uses confusing error message.

fix: #3197

@yankay yankay changed the title Show different error message when container is exist. Add error message when container is exist when nerdctl cp Aug 6, 2024
@AkihiroSuda AkihiroSuda added this to the v2.0.0 milestone Aug 7, 2024
@apostasie
Copy link
Contributor

apostasie commented Aug 8, 2024

Hey @yankay :-)

So, this makes things better, but will not address the issue:

This below (inside a read-only location)

nerdctl cp foo:/etc/issue .
/usr/bin/tar: issue: Cannot open: Read-only file system
/usr/bin/tar: Exiting with failure status due to previous errors
FATA[0000] could not find /etc/issue in container foo

^ says "could not find /etc/issue in container foo", but this is not true - it was found, but we failed copying it.

@AkihiroSuda AkihiroSuda removed this from the v2.0.0 milestone Aug 17, 2024
if foundMatchCount == 0 {
err = fmt.Errorf("could not find container: %s, with error: %w", options.ContainerReq, err)
} else {
err = fmt.Errorf("could not find %s in container %s", options.SrcPath, options.ContainerReq)
Copy link
Member

Choose a reason for hiding this comment

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

containerwalker.ContainerWalker is just searching for containers.

// Walk walks containers and calls w.OnFound .
// Req is name, short ID, or long ID.
// Returns the number of the found entries.

@apostasie apostasie mentioned this pull request Aug 21, 2024
@apostasie
Copy link
Contributor

@yankay #3197 got fixed by #3323.

I think we could close this one here?

@yankay
Copy link
Contributor Author

yankay commented Jan 23, 2025

Thanks @apostasie

@yankay yankay closed this Jan 23, 2025
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.

cp failure uses confusing error message

4 participants