Connection reset by peer (upgrade lib/pq)
andyesys opened this issue · 2 comments
- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
What happened?
There is an issue with the database access. After running for over a week, we start getting database "connection reset by peer" errors.
I found the issue originates in the lib/pq postgresql driver where broken idle connections are not detected. This is supposed to be fixed starting with version 1.9. Reference: original issue lib/pq#835
This bug also applies to the application server and must be fixed there too.
So in order to fix this please upgrade lib/pq to the newest version here:
chirpstack-network-server/go.mod
Line 25 in c386dfd
What did you expect?
No connection errors. lib/pq should detect dead idle connections.
Steps to reproduce this issue
Hard to reproduce. Try to place a firewall in between chirpstack and database and reset connections there.
Could you share your log output?
We only have a screenshot:
Your Environment
Component | Version |
---|---|
Application Server | v3.16.0 |
Network Server | v3.14.0 |
Gateway Bridge | v3.12.0 |
Chirpstack API | |
Geolocation | |
Concentratord |
The above commit updates it in the ChirpStack Application Server.