Closed Hasenn closed 2 years ago
Is the linked database running? Does it show any errors in the logs?
yes, it is running, and i don't see any errors when i do dokku postgres:logs polyauth2-db
Whats the log output from your database, and what are the errors you are seeing with your app?
PostgreSQL Database directory appears to contain a database; Skipping initialization
2021-11-22 15:44:18.932 UTC [1] LOG: starting PostgreSQL 13.4 (Debian 13.4-4.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2021-11-22 15:44:18.959 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2021-11-22 15:44:18.959 UTC [1] LOG: listening on IPv6 address "::", port 5432
2021-11-22 15:44:19.295 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-11-22 15:44:19.689 UTC [26] LOG: database system was shut down at 2021-11-22 15:38:40 UTC
2021-11-22 15:44:20.175 UTC [1] LOG: database system is ready to accept connections
The errors in my app are ugly, but they say that some isConnected
thing is undefined (which happens on requests that do database things), and on startup it doesn't say it connected to the db like it should
If you run dokku postgres:connect $SERVICE
, does it connect you to psql?
Also, can you print out the connection string the app is using from within code, and compare that to what is specified in the env vars for the app, and also compare to the the dsn url in the output of dokku postgres:info $SERVICE
?
Yes it does connect to psql,
the code, config:show
and the dsn url in dokku postgres:info polyauth2
are all the same including the db name
Can you show the entire log output of your app? If the config s all the same and the :connect
command works, this feels like an app bug.
2021-11-25T15:59:07.750505978Z app[web.1]: [info] Auth server started in dev
2021-11-25T15:59:07.778882545Z app[web.1]: postgres://postgres:[REDACTED]@dokku-postgres-polyauth2-db:5432/polyauth2_db
2021-11-25T15:59:07.975891790Z app[web.1]: [info] Listening on port 5000
2021-11-25T15:59:07.989993767Z app[web.1]: [info] Connected to LDAP
2021-11-25T16:14:51.359977160Z app[web.1]: [error] read ECONNRESET # this is where it throws an error while connecting to the db
[...]
# When the request happens
2021-11-27T19:44:04.394219787Z app[web.1]: [debug] GET /authorize?client_id=admitech&state=85&redirect_uri=https%3A%2F%2F[REDACTED]%2Foauth - - ms - -
not sure the logs will help much
I'll look more closely into the code to see if i can find an app bug, It does work locally and that same code did work on the server before we upgraded dokku so its a bit puzzling.
Thanks a lot for your time !
i guess i'll also try going into the container and connecting to the db from there with the dburl
Okay, so the herokuish builder chooses what version of npm it wants, probably taking the latest stable release, and when it ran again after the upgrade it chose npm >= 14, which isn't compactible with pg-npm < 8 because of a bug that makes connecting to the db hang forever. Upgrading pg to >= 8 fixed it, and so nothing was wrong with either dokku or dokku-postgres Closing this issue
Description of problem
One of our applications can no longer connect to its postgres database after updating dokku from 0.22.1 to 0.26.6 we've deployed both the app and its pg service again and the app still can't. We've rebuilt everything after the upgrade, and restarted the pg services after updating the plugin
Environment Information
dokku 0.26.6 postgres plugin is updated to 1.17.0
dokku report APP_NAME
outputHow (deb/make/rpm) and where (AWS, VirtualBox, physical, etc.) was Dokku installed?:
using dokku's bootstrap.sh on a physical node
Additional information
dokku ps:inspect APP_NAME
dokku trace:on
no command failed, just the app throwing errors and not connecting to db