question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sequelize db:migrate fails on localhost without internet connection

See original GitHub issue

On my win10 laptop, in airplane mode:

> sequelize db:migrate

Sequelize [Node: 6.9.2, CLI: 2.7.0, ORM: 3.30.4]

Loaded configuration file "config\config.json".
Unable to connect to database: SequelizeConnectionError: getaddrinfo ENOENT localhost:5432

Works fine as soon as the WiFi reconnects.

My config.json:

{
	"username": "postgres",
	"password": "password",
	"database": "whatever",
	"host": "localhost",
	"dialect": "postgres"
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
matt222rcommented, Apr 28, 2017

If I replace “localhost” in the config file with “127.0.0.1”, the problem does not occur.

0reactions
AmitBenAmicommented, Dec 9, 2018

I also had this issue, and it was fixed by replacing to 127.0.0.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - sequelize migration not work properly - Stack Overflow
config.json file is Database connection file in sequelize. In my project config.json file have group of database. config.json look like:
Read more >
Migrations - Sequelize
With migrations you can transfer your existing database into another state and vice versa: Those state transitions are saved in migration files, ...
Read more >
Dockerizing a Node.js Web Application - Semaphore Tutorial
Create a new file for database migration at bin/migrate.js : ... to http://localhost:3000/persons/all you'll see a connection error message.
Read more >
Usage - db-migrate - Read the Docs
To use db-migrate, you call it via the command line. When entering only the command without paramaters you will see something like this:...
Read more >
Node, Postgres, and Sequelize - Michael Herman
November 1st, 2015 - Added Database Migrations ... Install Sequelize, pg (for making the database connection), and pg-hstore (for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found