After running my ws client for 11 hours, I got this error (for the first time):
error: Uncaught BrokenPipe: Broken pipe (os error 32)
at unwrapResponse ($deno$/ops/dispatch_minimal.ts:63:11)
at Object.sendAsyncMinimal ($deno$/ops/dispatch_minimal.ts:106:10)
at async Object.write ($deno$/ops/io.ts:65:18)
at async BufWriter.flush (https://deno.land/[email protected]/io/bufio.ts:479:25)
at async writeFrame (https://deno.land/[email protected]/ws/mod.ts:144:3)
Any reasons as to why?
I'm also getting this error, but for different reasons
Please provide more reproduction. Broken pipe might happen for number of reasons, eg. the other side of connection closes it abruptly.
WebSocket demo reload web page and deno server exit
And I cannot catch the exception
async function dispatch(msg: string): Promise<void> {
for (const client of clients.values()) {
try {
await client.send(msg)
} catch (err) {}
}
}
Exception Stack Message
Uncaught BrokenPipe: Broken pipe (os error 32)
at unwrapResponse (rt/10_dispatch_minimal.js:52:13)
at sendAsync (rt/10_dispatch_minimal.js:95:12)
at async write (rt/12_io.js:117:20)
at async Object.writeAll (rt/13_buffer.js:223:19)
at async BufWriter.flush (bufio.ts:467:7)
at async writeFrame (mod.ts:141:3)
deno version
deno 1.2.0
v8 8.5.216
typescript 3.9.2
I get this error when starting a localhost webserver with for await (const req of server) { and then select a tab in Firefox from yesterday for the first time.
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 https://github.com/denoland/deno/pull/8365
Most helpful comment
Errors originating from HTTP server should be fixed by https://github.com/denoland/deno/pull/8365