Open bmwiedemann opened 2 years ago
also reproduced with official https://github.com/ipfs/go-ipfs/releases/download/v0.13.0/go-ipfs_v0.13.0_linux-amd64.tar.gz
@Jorropo wonder if this might be related to invalid codec mapping in go-cid, see BREAKING CHANGE fix in https://github.com/ipfs/go-cid/releases/tag/v0.2.0
Really concerning that we have no tests for FUSE that would catch this regression – whoever will be fixing this, should also add sharness test for UnixFS DAG that has both dag-pb and raw file items.
By debugging with ipfs 0.12 and 0.17, using the followings command
echo a | ipfs add -
added Qmbvkmk9LFsGneteXk3G7YLqtLVME566ho6ibaQZZVHaC9
cat /ipfs/Qmbvkmk9LFsGneteXk3G7YLqtLVME566ho6ibaQZZVHaC9
2023-05-04T13:02:23.318Z ERROR fuse/ipfs readonly/readonly_unix.go:108 could not convert protobuf or raw node
I could find that there is a difference of path taken in https://github.com/ipfs/kubo/blob/a6f446a4bab78b3d8b814474f1532f7bebcdc9c1/fuse/readonly/readonly_unix.go#L92
In ipfs 0.12, nd is of type
github.com/ipld/go-ipld-prime/datamodel.Node(*github.com/ipfs/go-unixfsnode._PathedPBNode) *{_substrate: *github.com/ipld/go-codec-dagpb._PBNode...}
It then goes in here https://github.com/ipfs/kubo/blob/master/fuse/readonly/readonly_unix.go#L95 and get the substrate and run mdag.ProtoNodeConverter
on it and get the fnd.
In ipfs 0.17, nd is of type
github.com/ipld/go-ipld-prime/datamodel.Node(*github.com/ipfs/go-unixfsnode/file.singleNodeFile) *{Node: github.com/ipld/go-ipld-prime/datamodel.Node(*github.com/ipfs/go-unixfsnode/data._Bytes) *{x: []uint8 len: 2, cap: 506, [97,10]}}
Then it goes in https://github.com/ipfs/kubo/blob/master/fuse/readonly/readonly_unix.go#L95 and ProtoNodeConverter returns an error because nd is not a dagpb.PBNode
I'm not familiar with those concepts, so the amount of knowledge to have to debug this issues seems a bit overwhelming to me.
But with some guidance, may be I can help.
Most of my day to day life relies on using ipfs mount and using ipfs content like any other files. It has been very annying to have to resort to ipfs cat, ipfs get or the gateway to just read a file.
Therefore, I am quite motivated to make this work. Of course, during the time I can spare to this task.
I guess my next action in this project would be to try to understand what are those PBNode about, right?
PB probably stands for ProtoBuf which is the encoding-method of metadata. E.g. the DAG-PB (Directed Acyclic Graph) contains a list of entries that each have Size, Name, CID
In (unrelated) https://github.com/bmwiedemann/ipfs-iso-jigsaw/blob/master/ipfsjigsaw.py I also construct a custom PBNode from python.
Thank you
Digging into ipfs, ipld, PBNode, ADL etc looks like a pretty big rabbit hole to me.
I realized that, in term of functionality, the ipfs gateway is very similar to the fuse mount point: it provides access to the data. So I figure there should be also a lookup-like method in the gateway code.
I intuitively think that if I find this code, I can either
Does this idea make sense?
This problem still exists in 0.21.0
BTW, my ongoing investigation on the subject is here -> https://konubinix.eu/braindump/f9f882e4-0d84-453e-b3aa-5e34e411b90d?title=ipfs_mount_0_12_2_does_not_work_for_several_files
It moves into my someday/maybe list, because I have more important matters now, and learning about ipfs, ipld, boxo and stuffs like that needs quite a lot of cognitive load.
But because I have the frustration everyday of having to work around this issue, I will definitely continue working on this, so stay tuned :-). Of course, if someone fix it before I do, I would be verrrrry grateful.
still broken in 0.22.0
I ran a git bisect between 0.12.2 and 0.13.0 and found
34aac1ee43168d18456ec8659f0024841541b0d2 is the first bad commit
commit 34aac1ee43168d18456ec8659f0024841541b0d2
Author: Adin Schmahmann <adin.schmahmann@gmail.com>
Date: Wed May 4 11:32:38 2022 -0400
chore: update deps
go.mod | 15 +++++++--------
go.sum | 35 ++++++++++++++++++++---------------
2 files changed, 27 insertions(+), 23 deletions(-)
Specifically reverting this part, fixes fuse:
- github.com/ipfs/go-graphsync v0.11.0
+ github.com/ipfs/go-graphsync v0.13.1
- github.com/ipfs/go-unixfsnode v1.1.3
+ github.com/ipfs/go-unixfsnode v1.4.0
and I further narrowed it down to 12 commits in https://github.com/ipfs/go-unixfsnode/compare/v1.1.3...v1.2.0
It seems, https://github.com/ipfs/go-unixfsnode/pull/14 by @willscott broke fuse.
Thanks for tracking this down, @bmwiedemann !
It's not obvious to me exactly how the update of unixfsprime from 2 years ago broke fuse.
One thing that is immediately clear is that this is an unhelpful error message, in that the actual error is not printed. https://github.com/ipfs/kubo/pull/10102 It would be great to run with that PR and see what the actual error is
with 10102 ontop of 0.22.0 I get
2023-08-25T15:02:12.975+0200 ERROR fuse/ipfs readonly/readonly_unix.go:107 could not convert protobuf or raw node: expected protobuf dag node
ls: cannot access '/ipfs/bafybeiax2m67v77asgjtbdhyiqa37b7x6zmylz3ry6bziwwt63hrlyqz4a': No such file or directory
My guess at fixing the immediate regression is https://github.com/ipfs/go-unixfsnode/pull/67
new version of go-unixfsnode released with that change and a few other fixes
Reopening as could not convert protobuf or raw node: expected protobuf dag node
is still a problem for some CIDs in FUSE. Seems it was happening since 0.23.
Details and repro steps: https://github.com/ipfs/kubo/pull/10243#issuecomment-1841895501 – take a look if you had good intuition on this before :pray:
See also #10242, which I created just for this new problem.
@Luflosi your issue is for the path prefix problem. Unfortunately, it also turns out that this issue (#9044) came back too. Both are being handled in #10243.
Triage notes:
could not convert protobuf or raw node: expected protobuf dag node
still needs fixing – repro steps in https://github.com/ipfs/kubo/pull/10243#issuecomment-1841895501We won't have bandwidth to fix this any time soon, but if someone has bandwidth to fix the remaining bug, and open PR with tests, I'm happy to review.
Checklist
Installation method
built from source
Version
Config
Description
I noticed that a number of my files stopped working in the fuse mount after upgrade from go-ipfs 0.12.0 to 0.13.0 e.g.
while
ipfs cat
still works fine.It seems to affect all the bafybei (pb) objects, but the bafkrei (raw data) files work fine.