Skip to content

Heroku deployment fail #1657

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

Closed
namrebmob opened this issue Feb 11, 2021 · 4 comments · Fixed by #1660
Closed

Heroku deployment fail #1657

namrebmob opened this issue Feb 11, 2021 · 4 comments · Fixed by #1660
Milestone

Comments

@namrebmob
Copy link

Heroku requre SSL mode for postgres connections, but sequelize db:migrate && node app.js always run with SSL off.
Try deploy with Docker (heroku:container), One Click Deployment, git Deployment - same result.

...
2021-02-11T06:22:28.954983+00:00 app[web.1]: Parsed url postgres://notadsewaccqnt:*****@ec2-34-254-69-72.eu-west-1.compute.amazonaws.com:5432/d7co6dtp1700qs
2021-02-11T06:22:29.028092+00:00 app[web.1]: ERROR: no pg_hba.conf entry for host "34.248.46.164", user "notadsewaccqnt", database "d7co6dtp1700qs", SSL off
@soulchild
Copy link

soulchild commented Feb 23, 2021

Same here on Kubernetes with a Postgres Operator which enforces SSL. We tried a couple of variations on the connection string params like ?ssl=true and ?sslmode=require and even setting the PGSSLMODE environment variable to no-verify, but Sequelize keeps connecting to the Postgres database without SSL.

Maybe updating the pg driver dependency might help with this? See: https://github.com/brianc/node-postgres/blob/4bc55834b93f945e3b60378db121e739e0950f92/CHANGELOG.md#pg810

@Yukaii
Copy link
Member

Yukaii commented Feb 28, 2021

@soulchild Could you try setting PGSSLMODE to require? That fixed our heroku deployment with current node-postgres version. (#1660)

@soulchild
Copy link

@Yukaii Thanks, I'll give that a try. Already found the relevant part in [email protected]:

https://github.com/brianc/node-postgres/blob/b0a2fe45059ba9d2c6279695260dd0a61fee99dc/lib/connection-parameters.js#L31-L42

Seems like no-verify is just not supported yet in that version.

@soulchild
Copy link

Indeed, this fixed the Postgres SSL-only connection problem: 👍

@Yukaii Yukaii added this to the Next milestone Mar 2, 2021
@Yukaii Yukaii modified the milestones: Next, 2.4.0 May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants