-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Postgrest calls fail with "Database connection lost..." but no connection issues are captured in stdout #1345
Comments
Try upgrading postgrest, several performance optimizations were made since |
I tried a 6.0 upgrade, the problem seems to be persistent. Is there some way I can get more detailed debugging information out of postgres regarding what was happening when the connection dropped? |
A different query is used starting from Regarding debugging, see http://postgrest.org/en/v5.2/admin.html#database-logs. Not sure if the same config params are exposed in RDS, but there should be a way to get more detailed logging. |
This is the kind of error I get when something is wrong with the connection: ./postgrest support/configs/config
Listening on port 3000
Attempting to connect to the database...
{"details":"could not connect to server: Connection refused\n\tIs the server running on host \"localhost\" (::1) and accepting\n\tTCP/IP connections on port 5432?\ncould not connect to server: Connection refused\n\tIs the server running on host \"localhost\" (127.0.0.1) and accepting\n\tTCP/IP connections on port 5432?\n","code":"","message":"Database connection error"}
Attempting to reconnect to the database in 0 seconds...
{"details":"could not connect to server: Connection refused\n\tIs the server running on host \"localhost\" (::1) and accepting\n\tTCP/IP
connections on port 5432?\ncould not connect to server: Connection refused\n\tIs the server running on host \"localhost\" (127.0.0.1) a
nd accepting\n\tTCP/IP connections on port 5432?\n","code":"","message":"Database connection error"}
Attempting to reconnect to the database in 1 seconds... There should be some error when you try to connect to RDS. |
I don't get any errors in the postgrest stdout log. The problem resolved after another engineer went through and rebuilt the ec2 instance from scratch, so unfortunately we don't know what change fixed it, or what exactly postgrest didn't like. It might be helpful to have higher levels of debug output verbosity for this type of situation. |
Definitely taking note of this for #540, thanks for the feedback. |
Environment
Description of issue
Database seems to work fine, can psql in and run queries no problem. Postgrest starts up just fine with no errors connecting to the database reported, but when any rest call is made it fails with a 503 and the error {"message":"Database connection lost, retrying the connection."}.
According to RDS performance insights, the following query is causing some issues:
The text was updated successfully, but these errors were encountered: