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

"Error: write after end" followed by npm-register crashing #90

Open
jessebye opened this issue Sep 21, 2017 · 14 comments
Open

"Error: write after end" followed by npm-register crashing #90

jessebye opened this issue Sep 21, 2017 · 14 comments

Comments

@jessebye
Copy link
Contributor

jessebye commented Sep 21, 2017

Just started seeing this error on our npm-register server (running version 2.5.2) last night:

Error: write after end
at writeAfterEnd (_stream_writable.js:236:12)
at PassThrough.Writable.write (_stream_writable.js:287:5)
at IncomingMessage.ondata (_stream_readable.js:642:20)
at emitOne (events.js:115:13)
at IncomingMessage.emit (events.js:210:7)
at addChunk (_stream_readable.js:266:12)
at readableAddChunk (_stream_readable.js:253:11)
at IncomingMessage.Readable.push (_stream_readable.js:211:10)
at HTTPParser.parserOnBody (_http_common.js:140:22)
at TLSSocket.socketOnData (_http_client.js:454:20)
at emitOne (events.js:115:13)
at TLSSocket.emit (events.js:210:7)
at addChunk (_stream_readable.js:266:12)
at readableAddChunk (_stream_readable.js:253:11)
at TLSSocket.Readable.push (_stream_readable.js:211:10)
at TLSWrap.onread (net.js:585:20)

After this error, the app dies.

@jessebye
Copy link
Contributor Author

Not sure if related, but seeing this in the logs too (app does not crash though):

logging error with Opbeat: { uuid: '7335b2e5-c94a-48d5-8061-4eaa09fc8f0f' }
Error: write EPIPE
at _errnoException (util.js:1026:11)
at WriteWrap.afterWrite [as oncomplete] (net.js:858:14)

@dgautsch
Copy link
Collaborator

@jessebye do you know what user actions were taking place when the error occured?

@jessebye
Copy link
Contributor Author

@dgautsch Most likely just npm install. We have a lot of users and servers using the registry, so it's hard to say what action was happening at a given time.

@jdx
Copy link
Owner

jdx commented Sep 21, 2017

this means the response timed out. Koa-timeout kills the request but then the code still tries to write to it.

@jessebye
Copy link
Contributor Author

@jdxcode maybe a case for better error handling then? This was crashing npm-register every time. It's not happening right now, probably because whatever URL was timing out isn't timing out any more, but I would prefer to not need to manually restart the npm-register process when there are timeouts like this 😄

@jdx
Copy link
Owner

jdx commented Sep 22, 2017

I’m certainly not arguing this is ok behavior, I’m just giving some color around why it’s happening. I’ve seen these errors come in on our installation and I don’t know if it’s causing the server to crash or not, but because we run this on a couple of instances in tandem and if one crashes another one simply replaces it it’s not causing us any practical issue.

My point again isn’t that this is okay, but it’s also not something worth investigating from my side right now. I’ll certainly accept a PR if someone wants to explore the behavior the CLI has on timeouts though.

@dgautsch dgautsch added the bug label Oct 14, 2017
@dgautsch
Copy link
Collaborator

@jessebye I'll have to narrow down the steps to reproduce. I can start going over the code and looking for areas where we're not error handling.

@tomasfse
Copy link
Contributor

tomasfse commented Jan 23, 2018

Well, I'm having the same error as @jessebye, the error:

logging error with Opbeat: { uuid: '7335b2e5-c94a-48d5-8061-4eaa09fc8f0f' }
Error: write EPIPE
at _errnoException (util.js:1026:11)
at WriteWrap.afterWrite [as oncomplete] (net.js:858:14)

Is repeated a lot of times, and it finally die with the error:
Error: write after end

However I'm concerned with the opbeat login error.

Why is it trying to loggin to opbeat if I have not the opbeat details defined? I think since Opbeat is an online profiling platform the initialization must be optional.

Maybe an ENV variable to disable/enable opbeat?

Thanks

@dgautsch
Copy link
Collaborator

@protheantom does this happen during npm install like jessebye mentioned?

@tomasfse
Copy link
Contributor

@dgautsch yes, also during the npm install (version 2.6.2)

I'm running it inside a Docker container, I think it isn't related, but could be... @jessebye are you running npm-register in a container too?

@jessebye
Copy link
Contributor Author

@protheantom not running in Docker. But I see the same logging errors when npm-register crashes. We are running into this bug seemingly once every few weeks now. Just about ready to jump over to a different NPM registry solution since we've had so much trouble with this 😢

@holms
Copy link
Contributor

holms commented Jun 19, 2018

Saddest part that other solutions doesn't follow 12factorapp and this brings troubles deploying registry with a docker. I mean how can people use only config file for configuration? This solution doesn't scale. That's why this project must live!

@dgautsch
Copy link
Collaborator

Does this still persist with v2.8.1?

@dgautsch
Copy link
Collaborator

dgautsch commented Oct 25, 2018

@jessebye and @protheantom I'm trying to shore up old bugs and this still seems relevant. I understand If you both had to move on at this point, but if you happen to still be running npm-register is this still a problem?

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

No branches or pull requests

5 participants