Not using ssl and sslmode parameters with Heroku / Migrations folder
See original GitHub issueI’m submitting a…
- Bug report
- Feature request
- Question
Current behavior
When deploying to Heroku, I receive the following error:
[ERROR] AssertionError [ERR_ASSERTION]: ifError got unwanted exception: no pg_hba.conf entry for host "{redacted}", user "{redacted}", database "{redacted}", SSL off
at module.exports (/app/node_modules/db-migrate/lib/commands/helper/assert.js:9:14)
Procfile:
release: db-migrate up
web: node server.js
Below is my database.json file. The environment in question is “production.”
{
"development": {
"driver": "pg",
"user": {"ENV": "DATABASE_USER"},
"password": {"ENV": "DATABASE_PASSWORD"},
"host": {"ENV": "DATABASE_HOST"},
"database": {"ENV": "DATABASE_NAME"},
"schema": {"ENV": "DATABASE_SCHEMA"}
},
"staging": {
"driver": "pg",
"user": {"ENV": "DATABASE_USER"},
"password": {"ENV": "DATABASE_PASSWORD"},
"host": {"ENV": "DATABASE_HOST"},
"database": {"ENV": "DATABASE_NAME"},
"schema": {"ENV": "DATABASE_SCHEMA"}
},
"production": {
"driver": "pg",
"url": {"ENV": "HEROKU_POSTGRESQL_BLACK_URL"},
"ssl": true,
"sslmode": "require"
}
}
I hard-coded the ssl and sslmode values after first trying them as environment variables.
I checked and the proper database name and user are being read from the URL.
Expected behavior
db-migrate attempts to connect using ssl.
Environment
db-migrate version: 0.11.6
db-migrate driver with versions: db-migrate-pg 1.0.0
Additional information:
- Node version: 12.3.1
- Platform: Windows 10
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
SSL error when pushing postgres db to heroku - Stack Overflow
psql: sslmode value "require" invalid when SSL support is not compiled in. I uninstalled postgres and reinstalled it with the configuration.
Read more >Connecting to Relational Databases on Heroku with Java
We used to suggest adding the URL parameter sslmode=disable to JDBC URLs. We now require use of SSL for all new Heroku Postgres...
Read more >How-To's - Miniflux
If you would like to connect via a Unix socket to Postgresql, set the parameter host=/path/to/socket/folder . Example: export DATABASE_URL="user=postgres ...
Read more >Deployment | postfacto - GitHub Pages
For deployments that do not want to setup Google OAuth, you will need to create your ... the application settings to include the...
Read more >Deploying Django to Heroku: Connecting Heroku Postgres
So, we'll use a hacky workaround to get dj_database_url to forget about SSL at the last second. As the very last line in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@desmondmc Glad I could help!
Just solved this issue myself. FYI, the
heroku
command will eat your-e
param sodb-migrate
never receives is. If you instead doheroku run bash
and then run your commands from the bash cli, it should work (I had success with this).