-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
CARv2 imports broken when using the HTTP API #9361
Comments
Not directly related but has a similar smell to ipld/go-car#336; although this one seems like it might be best to fix outside of go-car? It turns out that feature sniffing in Go isn't as smooth as it could be. My (likely very naive) take is that perhaps github.com/ipfs/go-ipfs-files/ReaderFile shouldn't implement |
I'm having a similar error when using a CARv2 file created with I can use ✔️ ❯ echo "my content" > my-file.txt
❯ cid=$(ipfs add -Q my-file.txt)
❯ echo $cid
QmWgVariV9nUzCWGBXfmXvTyTevUmDksycyPv3DAN9BP3A
❯ ipfs dag export $cid > my-file.car
0s 111 B / ? [--------------------------------------------=--------------------------------------------------------------------------------------------------------------] 519.17 KiB/s 0s
❯ car inspect my-file.car
Version: 1
Roots: QmWgVariV9nUzCWGBXfmXvTyTevUmDksycyPv3DAN9BP3A
Root blocks present in data: Yes
Block count: 1
Min / average / max block length (bytes): 19 / 19 / 19
Min / average / max CID length (bytes): 34 / 34 / 34
Block count per codec:
dag-pb: 1
CID count per multihash:
sha2-256: 1
❯ ipfs dag import my-file.car
Pinned root QmWgVariV9nUzCWGBXfmXvTyTevUmDksycyPv3DAN9BP3A success I CAN'T use ❌ ❯ car create -f my-file.car my-file.txt
❯ car inspect my-file.car
Version: 2
Characteristics: 00000000000000000000000000000000
Data offset: 51
Data (payload) length: 203
Index offset: 254
Index type: car-multihash-index-sorted
Roots: bafybeigepy5cjyxbeccayvysewdlbjfy5u3ti4c5fjt47pyae3uzj7jwbu
Root blocks present in data: Yes
Block count: 2
Min / average / max block length (bytes): 11 / 35 / 59
Min / average / max CID length (bytes): 36 / 36 / 36
Block count per codec:
raw: 1
dag-pb: 1
CID count per multihash:
sha2-256: 2
❯ ipfs dag import my-file.car
Error: operation not supported EDIT: It work's if I use CARv1 when creating the file with ✔️ ❯ car create --version 1 -f my-file.car my-file.txt
❯ car inspect my-file.car
Version: 1
Roots: bafybeigepy5cjyxbeccayvysewdlbjfy5u3ti4c5fjt47pyae3uzj7jwbu
Root blocks present in data: Yes
Block count: 2
Min / average / max block length (bytes): 11 / 35 / 59
Min / average / max CID length (bytes): 36 / 36 / 36
Block count per codec:
raw: 1
dag-pb: 1
CID count per multihash:
sha2-256: 2
❯ ipfs dag import my-file.car
Pinned root bafybeigepy5cjyxbeccayvysewdlbjfy5u3ti4c5fjt47pyae3uzj7jwbu success |
the fact that |
Checklist
Installation method
built from source
Version
Config
Nothing of interest
Description
Run this command while the daemon is running
This is the CAR imported in this test https://github.com/ipfs/kubo/blob/master/test/sharness/t0054-dag-car-import-export.sh#L257.
However, the test doesn't run with the daemon online (which is the most common way in which kubo is run).
IIUC the reason why this is happening is:
There's are a number of ways to handle this since it's basically an API mismatch. I suspect @guseggert, @Jorropo and @rvagg might have some opinions on the right way to do this since it's a similar issue to ipfs/go-datastore#188, golang/go#41198 and involves the go-car v2 internals.
Note for the kubo maintainers: IMO sharness tests should either test when the daemon is running or both when running and not running since having a daemon running is the most commonly use for kubo and we have run into issues like this before where there's success when no HTTP API is used, but failures over the HTTP API.
The text was updated successfully, but these errors were encountered: