Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

go-ipfs sometimes closes the stream preemptively #339

Closed
daviddias opened this issue Aug 10, 2016 · 15 comments
Closed

go-ipfs sometimes closes the stream preemptively #339

daviddias opened this issue Aug 10, 2016 · 15 comments

Comments

@daviddias
Copy link
Contributor

daviddias commented Aug 10, 2016

From: #337 (comment)


Ok, I thought I had fixed the adding dirs on the browser, but then realised that there is a bug that only happens sometimes (like 1 out of 20), where we don't receive all the hashes for the files added.

I thought this could be an js-ipfs-api problem, but further testing (and some fixes) narrowed down the problem to how go-ipfs is responding, even when requests are 100% the same, the response may differ.

The failing failing test is: https://github.com/ipfs/interface-ipfs-core/blob/feat/ipfs.files.get/src/files.js#L113-L143 (again: just fails in the browser and some of the times)

(left -> success; center -> fails)
image

Full request + response of a Success
Full request + response of a Failure
wireshark pcap (filter for HTTP and then look for the POST /add

How to reproduce

> git clone git@github.com:ipfs/interface-ipfs-core.git -b feat/ipfs.files.get 
> cd interface-ipfs-core
> npm i && npm run build && npm link
> cd ..
> git clone git@github.com:ipfs/js-ipfs-api.git -b feat/ipfs.files.get
> cd js-ipfs-api 
> npm i && npm link interface-ipfs-core
> npm run test:browser # repeat this one till it fails
@whyrusleeping
Copy link
Contributor

@diasdavid @dignifiedquire could you find a way to reproduce this with a simple curl command? I guess i'm just not very good at javascript but i have trouble even getting these tests to run, consistently hitting new and exciting problems.

@daviddias
Copy link
Contributor Author

After we talked and you getting the test to run, are you still getting that issue?

@whyrusleeping
Copy link
Contributor

apparently i just needed to rerun it a few times for the tests to run. I was having issues with karma and chrome, but a few more tries and it started running the tests.

@whyrusleeping
Copy link
Contributor

A relevant note: this has only been reproduced in the browser testing.

@whyrusleeping
Copy link
Contributor

might be related to: ipfs/kubo#2112

Which i can only reproduce using ipfs 0.4.2 or earlier.

@daviddias daviddias changed the title go-ipfs sometimes closes the stream preemptively go-ipfs sometimes closes the stream preemptively Aug 20, 2016
@daviddias
Copy link
Contributor Author

Still seeing the same problem in 0.4.3.

@whyrusleeping
Copy link
Contributor

@diasdavid thanks for checking.

@daviddias
Copy link
Contributor Author

@whyrusleeping anything else I can do to help with this bug?

@daviddias
Copy link
Contributor Author

Any developments?

@daviddias
Copy link
Contributor Author

@keks, @whyrusleeping mentioned that you found an issue on the http-api that might be the root of this problem (about closing the multipart stream), does it ring a bell?

@daviddias daviddias added backlog and removed ready labels Jan 29, 2017
@daviddias daviddias self-assigned this Nov 17, 2017
daviddias added a commit to ipfs-inactive/interface-js-ipfs-core that referenced this issue Nov 17, 2017
@ghost ghost removed the in progress label Nov 17, 2017
@daviddias daviddias removed their assignment Nov 17, 2017
@daviddias daviddias reopened this Nov 17, 2017
@daviddias
Copy link
Contributor Author

Spoke too soon. This is still a thing, although less frequently!

@GTRI-nathan
Copy link

I think I might be running into this error, but it happens every time for me. I made a quick and dirty paired down testcase here: https://github.com/GTRI-nathan/js-ipfs-api-test
Does this seem to be the same thing or should I open a new issue?

Thanks!

@julientregoat
Copy link

julientregoat commented Mar 19, 2018

I think the same was happening to me. When I try to create a directory of files using ipfs.files.add([{path: /dir}, {path: /dir/filename.type}]), it only creates the directory, then stops at the next file.

I get the error from my daemon'expected at least one child dir'. But outside of an array of objects, it's working completely fine. Not sure if this is the same problem but it seemed similar since it would just stop and not return any errors.

Working around it with using ipfs.files.mkdir and write.

alanshaw added a commit that referenced this issue Jun 6, 2018
License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
alanshaw added a commit that referenced this issue Jun 25, 2018
License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
alanshaw added a commit that referenced this issue Jun 26, 2018
License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
alanshaw added a commit that referenced this issue Jun 29, 2018
License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
daviddias pushed a commit that referenced this issue Jul 4, 2018
* feat: uses modular interface tests

    Reduces code repetition, allows test skipping and running only some tests.

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* feat: skip unimplemented files tests and add ls* tests

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* fix: adds skips for #339

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* fix: adds skips for key and miscellaneous

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* feat: add types and util tests (skipped as currently failing)

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* feat: add pin tests

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* fix(pubsub): adds skips for tests on windows

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* fix(config): adds skip for config.replace

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* chore: re-adds bitswap tests

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* chore: move detect-node back to dependencies

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* chore: add skip reasons

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* chore: update interface-ipfs-core dependency

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* chore: add reason for pubsub in browser skips

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* chore: add bitswap skips for offline errors

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* fix: remove skip for test that was removed

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* chore: update interface-ipfs-core version

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* chore: update deps and test on CI (#802)

* chore: update interface-ipfs-core

* fix(dag): `dag.put()` allows for optional options (#801)

* fix(dag): ensure `dag.put()` allows for optional options

This is to align with API changes made in

ipfs-inactive/interface-js-ipfs-core@011c417

and

ipfs/js-ipfs#1415

License: MIT
Signed-off-by: Pascal Precht <pascal.precht@gmail.com>

* fix(dag): fixes to allow options to be optional

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* chore: update interface-ipfs-core dependency

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* chore: update ipfsd-ctl dependency

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* fix: increase timeout for addFromURL with wrap-with-directory

Sadly we can't guarantee ipfs.io will respond within 5s

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* fix: skip bitswap offline tests on all platforms

The offline tests create and stop a node. ipfs/kubo#4078 seems to not only be restricted to windows.

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
danieldaf pushed a commit to danieldaf/js-ipfs-api that referenced this issue Jul 21, 2018
* feat: uses modular interface tests

    Reduces code repetition, allows test skipping and running only some tests.

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* feat: skip unimplemented files tests and add ls* tests

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* fix: adds skips for ipfs-inactive#339

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* fix: adds skips for key and miscellaneous

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* feat: add types and util tests (skipped as currently failing)

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* feat: add pin tests

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* fix(pubsub): adds skips for tests on windows

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* fix(config): adds skip for config.replace

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* chore: re-adds bitswap tests

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* chore: move detect-node back to dependencies

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* chore: add skip reasons

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* chore: update interface-ipfs-core dependency

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* chore: add reason for pubsub in browser skips

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* chore: add bitswap skips for offline errors

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* fix: remove skip for test that was removed

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* chore: update interface-ipfs-core version

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* chore: update deps and test on CI (ipfs-inactive#802)

* chore: update interface-ipfs-core

* fix(dag): `dag.put()` allows for optional options (ipfs-inactive#801)

* fix(dag): ensure `dag.put()` allows for optional options

This is to align with API changes made in

ipfs-inactive/interface-js-ipfs-core@011c417

and

ipfs/js-ipfs#1415

License: MIT
Signed-off-by: Pascal Precht <pascal.precht@gmail.com>

* fix(dag): fixes to allow options to be optional

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* chore: update interface-ipfs-core dependency

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* chore: update ipfsd-ctl dependency

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* fix: increase timeout for addFromURL with wrap-with-directory

Sadly we can't guarantee ipfs.io will respond within 5s

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>

* fix: skip bitswap offline tests on all platforms

The offline tests create and stop a node. ipfs/kubo#4078 seems to not only be restricted to windows.

License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
@achingbrain
Copy link
Collaborator

This issue is very stale so I'm going to close it. Tests were previously skipped for this PR but aren't any more. Please open a new issue against ipfs/js-ipfs if you still see it.

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

No branches or pull requests

5 participants