Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Error: write EPIPE #130

Closed
achingbrain opened this issue May 7, 2020 · 8 comments
Closed

Error: write EPIPE #130

achingbrain opened this issue May 7, 2020 · 8 comments
Assignees
Labels
exp/expert Having worked on the specific codebase is important kind/bug A bug in existing code (including security flaws) P0 Critical: Tackled by core team ASAP status/in-progress In progress

Comments

@achingbrain
Copy link
Member

achingbrain commented May 7, 2020

This sometimes happens during CI for js-IPFS, usually after a test has passed and it's tearing down the nodes in an after or afterEach block.

ipfs: [stdout] Error: write EPIPE
ipfs:     at afterWriteDispatched (internal/stream_base_commons.js:154:25)
ipfs:     at writeGeneric (internal/stream_base_commons.js:145:3)
ipfs:     at Socket._writeGeneric (net.js:784:11)
ipfs:     at Socket._write (net.js:796:8)
ipfs:     at doWrite (_stream_writable.js:403:12)
ipfs:     at writeOrBuffer (_stream_writable.js:387:5)
ipfs:     at Socket.Writable.write (_stream_writable.js:318:11)
ipfs:     at /Users/travis/build/ipfs/js-ipfs/node_modules/stream-to-it/sink.js:90:21
ipfs:     at processTicksAndRejections (internal/process/task_queues.js:97:5)
ipfs:     at async sink (/Users/travis/build/ipfs/js-ipfs/node_modules/libp2p-tcp/src/socket-to-conn.js:31:9) {
ipfs:   errno: 'EPIPE',
ipfs:   code: 'ERR_UNSUPPORTED_PROTOCOL',
ipfs:   syscall: 'write'
ipfs: }

This is with [email protected].

@jacobheun
Copy link
Contributor

Is this causing CI to fail when shutting down? The remote end is likely terminating while we're trying to write but we should be catching the error.

@achingbrain
Copy link
Member Author

Yes, it causes CI failures.

@jacobheun jacobheun added kind/bug A bug in existing code (including security flaws) exp/expert Having worked on the specific codebase is important P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked labels May 7, 2020
@achingbrain
Copy link
Member Author

Any idea where this should be handled? I'm seeing this maybe 1 job in 10, and considering each build has 18 jobs that means I see it pretty often.

@jacobheun jacobheun added P0 Critical: Tackled by core team ASAP and removed P2 Medium: Good to have, but can wait until someone steps up labels Jun 5, 2020
@jacobheun jacobheun self-assigned this Jun 5, 2020
@jacobheun
Copy link
Contributor

Bumping this to a P0 and looking into it as it's currently a huge pain in CI

@jacobheun
Copy link
Contributor

Based on the added code it looks like the error is coming from the newStream function at https://github.com/libp2p/js-libp2p/blob/v0.27.8/src/upgrader.js#L256. This would indicate that something is calling newStream and during protocol negotiation the socket is closed by the other side.

This may not be an issue with TCP itself but application/library code not catching errors when calling dialProtocol or connection.newStream. Looking into where this is being thrown in IPFS.

@jacobheun
Copy link
Contributor

@achingbrain I added a patch in [email protected] that should help catch errors like this. Can you let me know if you continue to see this in CI after upgrading?

@jacobheun jacobheun added status/in-progress In progress and removed status/ready Ready to be worked labels Jun 18, 2020
@dapplion
Copy link
Contributor

Seeing the same issue recurrently in Lodestar CI and local tests

@achingbrain
Copy link
Member Author

I haven't seen this for at least a year so I'm going to close this. @dapplion please shout if this is still causing problems.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/expert Having worked on the specific codebase is important kind/bug A bug in existing code (including security flaws) P0 Critical: Tackled by core team ASAP status/in-progress In progress
Projects
None yet
Development

No branches or pull requests

3 participants