sandstorm-io / sandstorm

Sandstorm is a self-hostable web productivity suite. It's implemented as a security-hardened web app package manager.
https://sandstorm.io
Other
6.69k stars 708 forks source link

Unhandled exception "previous HTTP message body incomplete; can't write more messages several times" #3480

Open larjona opened 3 years ago

larjona commented 3 years ago

Hi I got 2 times error 502 Bad Gateway while creating a framadate poll, and later another person also got 502 while trying to vote. We both retried and succeeded, but looking at the server logs we saw this near the time we got the errors:

kj/compat/http.c++:5091: error: unhandled exception in HTTP server; exception = kj/compat/http.c++:1852: failed: previous HTTP message body incomplete; can't write more messages several times

None of our users notified more issues, but the error persist every day in the logs. Searching for the text of the error, I've seen these messages, not sure if they are related (I think that Sandstorm uses capnproto isn't it?) https://www.mail-archive.com/capnproto@googlegroups.com/msg01292.html https://www.mail-archive.com/capnproto@googlegroups.com/msg01305.html

Kind regards

kentonv commented 3 years ago

This message comes from the KJ HTTP implementation, which Sandstorm uses. (KJ is part of Cap'n proto.)

Was the error followed by a stack trace at all? It's kind of hard to debug without a stack trace.

paddatrapper commented 3 years ago

This is all the logs have:

kj/compat/http.c++:4343: error: HttpService threw exception after generating a partial response; too late to report error to client; e = sandstorm/web-session-bridge.c++:861: failed: app did not finish writing HTTP response stream
stack: 71a520 71d0a0

The stack list varies each time