deploy_feedback
deploy_feedback copied to clipboard
Oak is having strange `UnexpectedEof` errors after being idle for 15s
I'm using Oak for a server and after a while the pod starts emitting these errors:
[uncaught application error]: UnexpectedEof - early eof at async Listener.accept (deno:ext/net/01_net.js:207:19) at async accept (https://deno.land/x/[email protected]/http_server_native.ts:166:38)

I am wondering if after some idle time, is Deno Deploy being actively shutdown? Is there a signal being sent I should be handling to gracefully shutdown the server? These errors always seem to come at the end of the logs.
This may well be a bug in Oak. We'll investigate. Thanks for reporting!
I just ran locally for 10hrs plus do not get the error, did the same on a hosted VM, and also as a container, again do not see error.
I only see that error when running on Deno Deploy, in its logs...
It is most curious... even running with listener on all evt.. I cant replicate locally at all. (yeah I ran test in background as I did other work..)
This is still an Issue even with latest build of Oak 10.6.0, it occurs after running for a while. (not causing any big issues, but I do hate seeing all that red.)
I also get this with other frameworks and only when deployed to Deno Deploy, it works fine on Fly.io for example, or my oen hosted VM's/servers. So am pretty sure its a Deno Deploy based issue, I have had other versions of same code running on fly and local vms, and hosted vms now for a couple weeks -> only have issue on Deno Deploy, and no idea why...
It's a strange one, anyway image posted below:

I am seeing the same thing running Oak 10.2 on Deploy.
When deno deploy goes idle and it shuts down the server, is it sending a kill signal to the deno process?
Any updates on this? I just deployed my first project and I don't know where to go from here. I have the same error logging.
edit: using [email protected]
nothing yet, but does not seem to be destructive I left a server running for past couple weeks or so no issues, it does seem once in a while (maybe when resources are refreshed due to inactivity on the deno side of things.)
I have not been able to find issue on the Oak side of things. On Jun 28 2022, at 5:20 pm, Ionut Rogojan @.***> wrote:
Any updates on this? I just deployed my first project and I don't know where to go from here. I have the same error logging. — Reply to this email directly, view it on GitHub (https://github.com/denoland/deploy_feedback/issues/179#issuecomment-1168932251), or unsubscribe (https://github.com/notifications/unsubscribe-auth/ATXWUNS4KKR3DOMC5FAYGRLVRMQ4VANCNFSM5QDIJGHA). You are receiving this because you commented.
Same error here. does not seem to affect the site. It only happens to me in production on deno.dev. Locally I can't reproduce so I am at a loss.
yup, same here -> hoping its just a sigint issue. -> but has not caused me lost data or other issues yet
On Jun 28 2022, at 7:22 pm, Taylor Young @.***> wrote:
Same error here. does not seem to affect the site. It only happens to me in production on deno.dev. Locally I can't reproduce so I am at a loss. — Reply to this email directly, view it on GitHub (https://github.com/denoland/deploy_feedback/issues/179#issuecomment-1169071480), or unsubscribe (https://github.com/notifications/unsubscribe-auth/ATXWUNUESM5ASFTZ4RTXPIDVRM7GBANCNFSM5QDIJGHA). You are receiving this because you commented.
Is Oak producing background threads? I suspect the listening socket is being hard closed, probably before the server is shutdown, maybe the problem is that a sigint isn't being sent before the process exits?
This seems to have been answered in https://github.com/oakserver/oak/issues/483#issuecomment-1060109388.
Ok, I forgot about that. So we're saying you can add a app.addEventListener("error", handler) and then possibly filter out these errors?