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

Weird error when doing files mv from /ipfs #4602

Open
magik6k opened this issue Jan 24, 2018 · 3 comments
Open

Weird error when doing files mv from /ipfs #4602

magik6k opened this issue Jan 24, 2018 · 3 comments
Labels
help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws)

Comments

@magik6k
Copy link
Member

magik6k commented Jan 24, 2018

Version information: current master

Type: Bug

Severity: Low

Description:

When doing ipfs files mv from /ipfs the error doesn't make it clear why things didn't work:

$ ipfs files mv /ipfs/QmYNmQKp6SuaVrpgWRsPTgCQCnpxUYGq76YEKBXuj2N4H6 /abc
Error: file does not exist

Reported in https://discuss.ipfs.io/t/moving-files-that-i-created-using-ipfs-add/1903

@magik6k magik6k added kind/bug A bug in existing code (including security flaws) help wanted Seeking public contribution on this issue labels Jan 24, 2018
@frrist
Copy link
Member

frrist commented Jan 25, 2018

I believe a ErrLinkNotFound error is being returned by merkledag/node.go which is then converted to an os.ErrNotExist in unixfs/io/dirbuilder.go

We could consider giving ipfs files mv the same behavior as ipfs files cp for some special cases (like the one shown below), but I am unsure if that is the right approach.
a special case

It would also be helpful if ipfs files ls /ipfs returned the local refs stored there, however those results could become a bit lengthy, so again unsure.

@Stebalien
Copy link
Member

I think the real issue here is that we're handling the special /ipfs namespace at the commands level. Ideally, MFS would have a some form of mount adapter allowing one to mount different filesystems within MFS and we'd use this system to "mount" /ipfs.


In this specific case, it should probably return an error saying that /ipfs is read-only.

It would also be helpful if ipfs files ls /ipfs returned the local refs stored there, however those results could become a bit lengthy, so again unsure.

While nice, that would be misleading as /ipfs contains all of /ipfs.

@Stebalien
Copy link
Member

Note: to avoid any confusion, the error here is that ipfs files mv doesn't know anything about /ipfs so the file literally doesn't exist from its perspective.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

3 participants