-
Notifications
You must be signed in to change notification settings - Fork 622
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
Uncaught BrokenPipe: Broken pipe (os error 32) #659
Comments
I'm also getting this error, but for different reasons |
Please provide more reproduction. |
WebSocket demo reload web page and deno server exit And I cannot catch the exception
Exception Stack Message
deno version
|
I get this error when starting a localhost webserver with Probably the browser tries to use the previous connection and the server crashes because the connection is unknown. |
I get this error every 24h or so, after which I need to restart the process. I'm on Ubuntu, behind nginx. Server serves HTML at about 30-60 request / h. Basically the "hello world" like setup, no extra dependencies. I am on deno 1.3.x. |
Running into this as well.. about 12 hours after starting the service. Might be that the client changed ip addresses and that confused deno or something like that? Also Deno error message doesn't tell me where in my code the issue originated from. error: Uncaught BrokenPipe: Broken pipe (os error 32)
at unwrapResponse (deno:cli/rt/10_dispatch_minimal.js:59:13)
at sendAsync (deno:cli/rt/10_dispatch_minimal.js:98:12)
at async write (deno:cli/rt/12_io.js:117:20)
at async BufWriter.write (bufio.ts:499:29)
at async writeResponse (_io.ts:273:15)
at async ServerRequest.respond (server.ts:84:7)
at async Response.end (response.ts:218:5) |
Same problem here. Very frequently after a few hours of running (between 6 and 12 hours I guess). Edit: Ubuntu, behind nginx, no ws - just static files and a simple api over http. error: Uncaught (in promise) BrokenPipe: Broken pipe (os error 32)
at unwrapResponse (deno:cli/rt/10_dispatch_minimal.js:59:13)
at sendAsync (deno:cli/rt/10_dispatch_minimal.js:98:12)
at async write (deno:cli/rt/12_io.js:117:20)
at async Object.writeAll (deno:cli/rt/13_buffer.js:223:19)
at async BufWriter.flush (bufio.ts:468:7)
at async writeResponse (_io.ts:288:3)
at async Server.iterateHttpRequests (server.ts:154:11)
at async Server.acceptConnAndIterateHttpRequests (server.ts:227:5)
at async MuxAsyncIterator.callIteratorNext (mux_async_iterator.ts:30:31) |
Has anyone found a workaround for this? i.e., catching the error or restarting the server after the error occurs? For me, Deno is currently unusable because of this, unfortunately ... |
Closest I found to a workaround is to switch to http and run a nginx reverse proxy with the certificate/key infront of deno |
Thanks for the suggestion! However, this already is my configuration and Deno crashes even when using http only. |
Errors originating from HTTP server should be fixed by denoland/deno#8365 |
This Please reopen this issue!
|
Do you use other library or call |
Thanks for coming back to this issue @lideming ! Although I still don't know what exactly causes this error, it looks like I made a mistake in my error handling function. |
@timonson The |
For me this error tends to happen when I saturate the TCP connection, maybe some connection gets dropped by the os for whatever reason and now you're writing to a broken pipe. What makes it troubling is that this is uncatchable within the while(true) {
try {
for await (const request of server) {
// serve the request
}
}
catch(e) {
// handel error
}
} The reason of which I'm sure can be made sense of by folks who understand how async iterators work better than I do, but I'm still confused by this lol. Edit: So I know now that the error occurs at the point where the |
Same problem for me. Every 6 -12 hours of running.
How can I help for debugging this ? This is in production and I really want to dig into this. |
Is there a fix coming out for this? Deno is pretty unusable at this point |
@malimohub The error is that you are not catching the error... see #659 (comment). It is totally expected for this error to happen (connections sometimes close unexpectedly). It might be more obvious what is happening if instead of using |
Well, I have a minor objection. Because all the docs and tutorials, official or not, was pretty much using the pattern So anyways maybe update the docs to reflect this? On the other hand, |
In my case, broken pipe error generated from deno_mongo. |
I was also getting this error using |
I also switch to the new api, but got the same error as mentioned previously in this issue. await respondWith(
new Response(body, {
headers,
status: 200,
}),
); I made the same mistake with the previous api, by not prefixing |
|
does this impact oak? I'm runngin puppeteer and if I do 5 instances at a time it crashes. |
|
I get this error when I intensively fill with data of 64 kb 3000 iterations let size_byte = 65535;
let buff = (0..=size_byte).map(|_|78).collect::<Vec<u8>>();
addr.do_send(ClientCommand( Item::FirstBinary( Bytes::from_iter(buff.clone()))));
for i in (0..3000){
addr.do_send(ClientCommand( Item::Continue( Bytes::from_iter(buff.clone()))));
}
addr.do_send(ClientCommand( Item::Last( Bytes::from_iter(buff.clone())))); Error: Io(Os { code: 32, kind: BrokenPipe, message: "Broken pipe" }) |
Currently, when you add your own license to modified files, it will complain. This changes the regex so that it can be multiline.
After running my ws client for 11 hours, I got this error (for the first time):
Any reasons as to why?
The text was updated successfully, but these errors were encountered: