Unable to connect to database: SequelizeConnectionRefusedError: connect ECONNREFUSED

Viewed 6965

Whenever i launch my app, part of my task is to first run a migration. however, I get the below error 95% of the time.

Command failed: /bin/sh -c node_modules/.bin/sequelize db:migrate
Unable to connect to database: SequelizeConnectionRefusedError: connect ECONNREFUSED

Details:
 killed: false
 code: 1
 signal: null
 cmd: /bin/sh -c node_modules/.bin/sequelize db:migrate
 stdout:
Sequelize [Node: 0.12.7, CLI: 2.1.0, ORM: 3.14.0]

Note: I can still query and connect to the database after the failure, also when i check the TCP lsof -i tcp:5432 its only one instance of postgres that runs.

I would appreciate any assistance in solving this issue.

1 Answers
Related