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.

Why sequelize doesn't connect to DB when system is offline?

See original GitHub issue

I try to run my project when my computer is offline but it showed me this error:

Unhandled rejection SequelizeConnectionError: getaddrinfo ENOENT
    at C:\Users\moslem\WebstormProjects\exchange\node_modules\sequelize\lib\dial
ects\postgres\connection-manager.js:74:20
    at null.<anonymous> (C:\Users\moslem\WebstormProjects\exchange\node_modules\
pg\lib\client.js:176:5)
    at emit (events.js:107:17)
    at Socket.<anonymous> (C:\Users\moslem\WebstormProjects\exchange\node_module
s\pg\lib\connection.js:59:10)
    at Socket.emit (events.js:107:17)
    at net.js:923:16
    at process._tickCallback (node.js:355:11)

after that I connected to internet then everything works as expected

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
moslemezzaticommented, Oct 16, 2015

I found out where is issue my config file is set like this:

 "development": {
    "username": "postgres",
    "password": "1",
    "database": "exchange",
    "host": "localhost",
    "dialect": "postgres",
    "port": "5432"
  },

and I changed it to this:

 "development": {
    "username": "postgres",
    "password": "1",
    "database": "exchange",
    "host": "127.0.0.1",
    "dialect": "postgres",
    "port": "5432"
  },

And then everything worked fine. Did you have this experience before?

0reactions
Jandsonncommented, Dec 20, 2021

Deu certo aqui também, eu estava com o mesmo problema coloquei o endereço host local e e deu certo. Obrigado irmãozinho

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sequelize Connect ETIMEOUT when connecting to remote ...
For me, I have to: 1) Define exact information of my database at the local server (Xamp/ Mamp). It means I must have...
Read more >
How To Use Sequelize with Node.js and MySQL - DigitalOcean
Step 1 — Installing and Configuring Sequelize. In this step, you will install Sequelize and create the connection to your MySQL database. To...
Read more >
Building a Web Service with Postgres and Sequelize
Connect to the dev database ( \c ) and check ( \d ) that the database is empty (has no tables). You might...
Read more >
Using sequelize in AWS Lambda
sequelize uses connection pooling for optimizing usage of database connections. The connection pool used by sequelize is implemented using setTimeout() ...
Read more >
Connect to MySQL Database with Sequelize - YouTube
Connect Express to a MySQL database using Sequelize. Learn about Sequelize models, the MVC design pattern, and MySQL.⬇️Install MySQL and ...
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