Go-ipfs: Weird error when doing files mv from /ipfs

Created on 24 Jan 2018  路  3Comments  路  Source: ipfs/go-ipfs

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

help wanted kinbug

Most helpful comment

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.

All 3 comments

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.

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.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jonchoi picture jonchoi  路  3Comments

0x6431346e picture 0x6431346e  路  3Comments

Jorropo picture Jorropo  路  3Comments

lidel picture lidel  路  3Comments

zignig picture zignig  路  3Comments