1

I need help to deploy my project to Heroku. Every time that I attempt to deploy my project I get this error:

Error: no pg_hba.conf entry for host "104.57.187.158", user "epcifomwotivdd", database "dummyDB12", SSL off
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! barhop-api@1.0.0 migrate: `postgrator --config postgrator-config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the barhop-api@1.0.0 migrate script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Juan Mireles\AppData\Roaming\npm-cache\_logs\2021-01-23T21_21_52_677Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! barhop-api@1.0.0 migrate:production: `env SSL=true DATABASE_URL=dummyDB npm run migrate`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the barhop-api@1.0.0 migrate:production script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Juan Mireles\AppData\Roaming\npm-cache\_logs\2021-01-23T21_21_52_760Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! barhop-api@1.0.0 predeploy: `npm audit && npm run migrate:production`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the barhop-api@1.0.0 predeploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Juan Mireles\AppData\Roaming\npm-cache\_logs\2021-01-23T21_21_52_809Z-debug.log

I've tried adding the host to the pg_hba.conf and changed the postgresql.conf to the setting to accept all hosts.

This is my pg_hba.conf:

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
host    all             all             0.0.0.0/0               trust #inserted
# IPv6 local connections:
host    all             all             ::0/0                   trust #inserted
host    all             all             ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all                                     trust
host    replication     all             127.0.0.1/32            trust
host    replication     all             ::1/128                 trust
host    all             all             0.0.0.0/0               trust #inserted

I tried adding and removing the inserted host in different ways, but I can't get it to work. Also, with every change that I did I restarted the server. I did see some other options to try but they were for Mac and I'm on a Windows computer.

Juan Mireles
  • 31
  • 1
  • 3
  • Can you connect to the database with `psql`? – Laurenz Albe Jan 24 '21 at 03:49
  • "This is my `pg_hba.conf`"—where are you finding this file? Your local `pg_hba.conf` is entirely irrelevant on Heroku. Whatever service is providing your database (Heroku Postgres?) will have its own configuration that you cannot access. Though... your error message references a Windows-style path. What _exactly_ are you trying to do? What command are you running? – ChrisGPT was on strike Jan 24 '21 at 19:17
  • @LaurenzAlbe Yes I can connect to psql – Juan Mireles Jan 26 '21 at 01:56
  • ...you just leaked your database credentials. Please change them _**immediately**_. They are forever compromised. Deleting your comment is not enough. – ChrisGPT was on strike Jan 26 '21 at 02:33
  • You have this tagged with [tag:heroku], but it looks like you're just running this command locally? You say "Every time that I attempt to deploy my project", but `npm run migrate:production` isn't a deployment command. What does this have to do with Heroku, if anything? – ChrisGPT was on strike Jan 26 '21 at 02:34
  • I'm sorry I forgot to mention that when I run deploy it runs that command `npm run migrate:production` and I mentioned Heroku because I wasn't sure if it had anything to do with it. I'm new to all this so I'm not too familiar with everything. @Chris – Juan Mireles Jan 26 '21 at 20:02
  • Okay, but is _this error_ coming up when you _deploy_ or when you run `npm run migrate:production` on your development machine? – ChrisGPT was on strike Jan 26 '21 at 20:24
  • @Chris when I run npm run migrate:production – Juan Mireles Jan 30 '21 at 02:55

0 Answers0