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

CID with unexpected EOF can't be removed from MFS #7999

Closed
lidel opened this issue Mar 22, 2021 · 1 comment
Closed

CID with unexpected EOF can't be removed from MFS #7999

lidel opened this issue Mar 22, 2021 · 1 comment
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization topic/MFS Topic MFS

Comments

@lidel
Copy link
Member

lidel commented Mar 22, 2021

Version information:

go-ipfs version: 0.8.0
Repo version: 11
System version: amd64/linux
Golang version: go1.15.8

Description:

Given QmYw8okuEpxCPhfX3CKbF8mtpmyHPHP9VC3VNhUepytcSh which is producing EOF error:

$ ipfs files stat /ipfs/QmYw8okuEpxCPhfX3CKbF8mtpmyHPHP9VC3VNhUepytcS
Error: unexpected EOF

..one can import it to MFS, but then removal is not possible:

$ ipfs files cp /ipfs/QmYw8okuEpxCPhfX3CKbF8mtpmyHPHP9VC3VNhUepytcSh /foo
Error: cp: cannot flush the created file /foo: unexpected EOF

$ ipfs files ls /
foo

$ ipfs files rm /foo
Error: unexpected EOF

🙈

I imagine we should

  • guard files cp against EOF somehow, so getting into this mess is not possible
  • (and/or) make it possible to files rm even when a file causes unexpected error
@lidel lidel added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization topic/MFS Topic MFS labels Mar 22, 2021
@aschmahmann
Copy link
Contributor

guard files cp against EOF somehow, so getting into this mess is not possible

We can do some amount of guarding but unless we want ipfs files cp to become an expensive verification operation or add some potentially complicated indices and data labels around verification this is an inevitability. In particular, if the user imports a huge DAG using ipfs files cp /ipfs/{rootCID} /mydag then either we have to know that rootCID represents a valid UnixFS DAG or for the sake of performance/simplicity put this responsibility on the user.

(and/or) make it possible to files rm even when a file causes unexpected error

We do ipfs files rm /mydag --force will do the job


Seems like this is closeable, but if I've missed something feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization topic/MFS Topic MFS
Projects
None yet
Development

No branches or pull requests

2 participants