StateVoicesNational / Spoke

mass-contact text/SMS distribution tool
Other
465 stars 409 forks source link

Bug: Running Node 14.5.0, Knex connection error with Knex 0.20.7 and pg 6.4.2 #1681

Open mayefsky opened 4 years ago

mayefsky commented 4 years ago

Hi folks--I am trying to set up Spoke on a managed service (Render); I can build and deploy the app but seem to be unable to connect to the database; this error appears after deployment and when I try to log in: TimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?

The environment variables I think are relevant:

DB_TYPE=pg DB_HOST=oregon-postgres.render.com DB_NAME=spoke_testing DB_PORT=5432 DB_USER=spoke_testing_user DB_USE_SSL=require[I've also tried false] PGSSLMODE=require[I've also tried false; not sure how this and ^^ interact] DB_PASSWORD=[redacted] NODE_ENV=production

Build command: yarn install Launch command: npm start

And again the app does load, I can see the splash page and get to Auth0, but upon callback it won't load, and when I look in the db I don't see any of the spoke tables built.

I also don't think I have messed up the credentials themselves because I can connect to this database with these credentials using a SQL GUI tool; but almost certainly I've mis-set something elsewhere, or there's something else about this particular approach to deployment that I'm doing wrong, versus there being an outright bug. I appreciate your help!

mayefsky commented 4 years ago

Update: per https://stackoverflow.com/questions/40435315/knex-timeout-acquiring-a-connection-the-pool-is-probably-full-are-you-missing this seemingly is a Node 14 related problem and bumping to "pg": "^8.0.3" "knex": "^0.21.1"

Solved the issue for me. Will leave this open for now in case this is more broadly useful.

ltieman commented 4 years ago

Can confirm this bug and that this fixes the issue.

Frydafly commented 3 years ago

@mayefsky Do ya think it'll be helpful to add this to the documentation?