question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crash on Deno Deploy: Connection reset by peer

See original GitHub issue
ConnectionReset: Connection reset by peer (os error 104)     
at async read (deno:ext/net/01_net.js:21:19)     
at async BufReader.read (https://deno.land/std@0.118.0/io/buffer.ts:314:18)     
at async BufReader.readFull (https://deno.land/std@0.118.0/io/buffer.ts:343:28)     
at async WireProtocol.receive (https://deno.land/x/mongo@v0.29.0/src/protocol/protocol.ts:77:34)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
manyuanrongcommented, Nov 25, 2022

This is indeed a problem with keepalive, which also exists in other database drivers of deno. I have recently used redis and pgsql in a production environment. Sending heartbeat requests regularly is simple and effective. Of course, this should also be added as a feature of the driver library.

1reaction
FinlayDaG33kcommented, Aug 8, 2022

I did manage to “circumvent” this issue for now by having my app make a small query every 5 seconds (might want to increase this but it’ll do for now), keeping the connection alive.
Because I use DangoDB and am not very knowledgeable on MongoDB, this was the easiest way for me to accomplish it for me.
A better solution will need to be built.

I don’t know how this will affect users of Deno Deploy since I am not familiar with the service.

EDIT: Here’s a little overview on when my app crashed (red section) vs after the “fix” (green section). Missing dots on the graph represent moments when the app crashed. As one can see, the crashing was pretty frequently before the fix and after it, it hasn’t crashed a single time yet. image

Update after ~8 days

It’s been about 8-days now since I’ve added this and I haven’t had a single crash yet.
So it does seem that implementing some kind of keepalive may help solve this issue. afbeelding

Read more comments on GitHub >

github_iconTop Results From Across the Web

feat: Automatic reconnect · Issue #278 · denodrivers/mongo · GitHub
Many mongodb drivers implement a reconnect for when a connection to remote server is dropped. ... Crash on Deno Deploy: Connection reset by...
Read more >
Thread: Applicationl Crash - Connection reset by peer
Hi, I am using Postgresql 7.4.3 running on RedHat Linux 2.4.7. My Application is coded in C. I am using libpq functions inorder...
Read more >
Connecting to Postgres | Deploy Docs
Setup Postgres · Select a name, password, and region for your database. · Click "Create new project". · Once the project is created,...
Read more >
Heroku PostgreSQL Connection reset by peer - Stack Overflow
Your application happened to crash while connected to postgres, and did not clean up its connection to the database. Postgres noticed that the...
Read more >
Connection reset by peer:Socket write error — oracle-tech
Hi, I am running my application in weblogic server 8.1,when i deploy the application in exploded format i get the following error.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found