deploy_feedback icon indicating copy to clipboard operation
deploy_feedback copied to clipboard

Oak is having strange `UnexpectedEof` errors after being idle for 15s

Open justinmchase opened this issue 3 years ago • 12 comments

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)

Screen Shot 2022-03-07 at 6 55 22 AM

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.

justinmchase avatar Mar 07 '22 13:03 justinmchase

This may well be a bug in Oak. We'll investigate. Thanks for reporting!

lucacasonato avatar Apr 17 '22 10:04 lucacasonato

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..)

OldManFroggy avatar May 13 '22 23:05 OldManFroggy

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:

image

OldManFroggy avatar Jun 01 '22 14:06 OldManFroggy

I am seeing the same thing running Oak 10.2 on Deploy.

mikehall314 avatar Jun 14 '22 10:06 mikehall314

When deno deploy goes idle and it shuts down the server, is it sending a kill signal to the deno process?

justinmchase avatar Jun 14 '22 21:06 justinmchase

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]

ionutrogojan avatar Jun 28 '22 16:06 ionutrogojan

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.

OldManFroggy avatar Jun 28 '22 16:06 OldManFroggy

Screen Shot 2022-06-28 at 11 20 44 AM 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.

digitaldesigndj avatar Jun 28 '22 18:06 digitaldesigndj

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.

OldManFroggy avatar Jun 28 '22 18:06 OldManFroggy

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?

justinmchase avatar Jul 08 '22 14:07 justinmchase

This seems to have been answered in https://github.com/oakserver/oak/issues/483#issuecomment-1060109388.

kidonng avatar Jul 25 '22 04:07 kidonng

Ok, I forgot about that. So we're saying you can add a app.addEventListener("error", handler) and then possibly filter out these errors?

justinmchase avatar Jul 25 '22 14:07 justinmchase