2

I have an updated Strapi site, running V3.1.4 - we've come from a V3.0.6 site, with minimal structural changes. Strapi can connect to Postgres on my local version, and everything is fine, but when deploying to Heroku it gets more complicated.

I have a staging site using a Heroku Hobby database, with the following packages:

"knex": "^0.20.10", "pg": "^8.0.3", "pg-connection-string": "^2.3.0", 

and my config uses:

options: { pool: { min: 0, max: 18, createTimeoutMillis: 30000, acquireTimeoutMillis: 600000, idleTimeoutMillis: 30000 } } 

and SSL is set to false.

This runs fine, but if I then deploy this to 'live' (ie using a Production database that requires SSL) I get the following error:

[DATABASE] [10-1] sql_error_code = 28000 FATAL: no pg_hba.conf entry for host "3.249.190.208", user "XXX", database "XXX", SSL off 

I've had this before, and as per this post, I've taken PG down to V7.4.3, but I then get this error:

error KnexTimeoutError: Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? 

and no cannot get this to work by altering any of thee pool settings, including using:

ssl:true, rejectUnauthorized: false, 

Node and NPM are set to:

 "engines": { "node": ">=10.0.0", "npm": ">=6.0.0" }, 

I think I've read most posts around this subject but nothing seems to be working. Any ideas greatly received.

1
  • What was your solution here? Seems Heroku now requires SSL configs for the free/hobby tier for all Postgres connections? Commented Apr 6, 2021 at 18:40

1 Answer 1

1

After a bit more searching and focusing on the Self Signed issue that is a result of no pg_hba.conf entry for host I came across https://github.com/strapi/strapi/pull/6050 which helped to resolve it.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.