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

Sometimes not all files passed to add() function are added #85

Closed
TheKysek opened this issue May 24, 2017 · 4 comments
Closed

Sometimes not all files passed to add() function are added #85

TheKysek opened this issue May 24, 2017 · 4 comments

Comments

@TheKysek
Copy link
Contributor

While running tests against newest versions of go-ipfs i noticed that "test_add_multiple_from_list" was seemingly randomly failing.

It seems like while adding multiple files using "add(['file1', 'file2'])" sometimes this call fails.

>>> a.add(['/home/krzysiek/Dokumenty/PyCharmProjects/py-ipfs-api/test/functional/fake_dir/fsdfgh', '/home/krzysiek/Dokumenty/PyCharmProjects/py-ipfs-api/test/functional/fake_dir/popoiopiu'])
[{'Hash': 'QmQcCtMgLVwvMQGu6mvsRYLjwqrZJcYtH4mboM9urWW9vX', 'Name': 'fsdfgh'}, {'Hash': 'QmYAhvKYu46rh5NcHzeu6Bhc7NG9SqkF9wySj2jvB74Rkv', 'Name': 'popoiopiu'}]
>>> a.add(['/home/krzysiek/Dokumenty/PyCharmProjects/py-ipfs-api/test/functional/fake_dir/fsdfgh', '/home/krzysiek/Dokumenty/PyCharmProjects/py-ipfs-api/test/functional/fake_dir/popoiopiu'])
{'Hash': 'QmQcCtMgLVwvMQGu6mvsRYLjwqrZJcYtH4mboM9urWW9vX', 'Name': 'fsdfgh'}
>>> a.add(['/home/krzysiek/Dokumenty/PyCharmProjects/py-ipfs-api/test/functional/fake_dir/fsdfgh', '/home/krzysiek/Dokumenty/PyCharmProjects/py-ipfs-api/test/functional/fake_dir/popoiopiu'])
[{'Hash': 'QmQcCtMgLVwvMQGu6mvsRYLjwqrZJcYtH4mboM9urWW9vX', 'Name': 'fsdfgh'}, {'Hash': 'QmYAhvKYu46rh5NcHzeu6Bhc7NG9SqkF9wySj2jvB74Rkv', 'Name': 'popoiopiu'}]

When this happens the following error is printed in go-ipfs daemon console:

13:46:35.014 ERROR commands/h: err: http: invalid Read on closed Body handler.go:288
@ntninja
Copy link
Contributor

ntninja commented May 27, 2017

Thanks for reporting, but we unfortunately do not currently have time to look into fixing this. (Maybe in a couple of weeks.)

You, or anybody else interested in helping out, are very welcome to provide patches or further hints for this through.
Thanks for helping out by reporting either way!

Sorry for the delayed response, this should have been sent on Thursday, but GitHub apparently told me: „You can't comment at this time.“ – And I didn't see. 😒

@whereswaldon
Copy link
Contributor

@TheKysek Nice catch! I also can't try to debug this at the moment, but we'd welcome any further hints as to where the error originates. It seems like the IPFS node is sometimes receiving an invalid HTTP body. It's possible that the error has something to do with the code that generates the multipart HTTP request body.

@ntninja
Copy link
Contributor

ntninja commented Feb 15, 2019

This should be fixed by the new multipart code (9edc945), although I think the issue was already fixed before that.

@ntninja ntninja closed this as completed Feb 15, 2019
@lidel
Copy link
Member

lidel commented Feb 15, 2019

For anyone googling http: invalid Read on closed Body and finding this, the upstream error will be fixed in go-ipfs v0.4.19: ipfs/kubo#5168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants