Closed jimpick closed 3 years ago
I did some debugging, and it appears that the iterable car file stream being output from ipfs-car/pack hasn't finished writing blocks when it is being consumed by TreewalkCarSplitter.fromIterable, and @ipld/car stops reading the stream.
A quick fix is to just add an await
to the close() function in the ipfs-car/pack writer.
Update: My "quick fix" didn't actually fix the problem.
I think the issue is that my data generates an IPLD block with zero bytes in a buffer, which has a valid CID, but if that block is placed in the middle of a car file, the @ipld/car code to read from an iterator interprets that as the end of the stream, and it stops reading from the iterator, even though there subsequent blocks in the stream. I'm not sure why it's generating an IPLD block with zero bytes. I'll try to make a smaller test case. /cc @rvagg
Here's my data. I see I have some zero length files. I bet that's triggering it.
https://bafybeiatccvommze36x5cy44m22qz4al63riz4p6bnxw4pns6g3lbw3aky.ipfs.dweb.link/
I created a test program and left an issue over at:
https://github.com/ipld/js-car/issues/46
It appears that when consuming a streaming iterable, @ipld/car sometimes will abort reading prematurely if the latest block has a zero length payload.
can confirm, this will be will be fixed by https://github.com/ipld/js-car/pull/48
This should now be fixed. @jimpick let us know if not
Tested. I was able to upload my data!
I'm using the unmodified script from here:
https://docs.web3.storage/#create-the-upload-script
The same script did work on some other directories with files. I'll do a bit more debugging to see if I can isolate it further.