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.

ERROR: getaddrinfo ENOTFOUND postgres postgres:5432 on migrations in docker-compose

See original GitHub issue

What are you doing?

I am running a microservice with sequelize and postgres it seems to properly connect to the database when running node app but on migrations it throws this error

Sequelize CLI [Node: 8.16.0, CLI: 5.4.0, ORM: 5.7.4]

Loaded configuration file "lib/sequelize/config.js".


ERROR: getaddrinfo ENOTFOUND postgres postgres:5432
// code here

Environment

Dialect:

  • mysql
  • postgres
  • sqlite
  • mssql
  • any Dialect library version: Don’t Know Database version: Don’t Know Sequelize version: 5.4.0 CLI Node Version: 8.16.0 OS: docker If TypeScript related: TypeScript version: XXX Tested with latest release:
  • No
  • Yes, specify that version:

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
sahilsharmafrankcommented, Jul 4, 2021

in your config.json use hopefully it will solve the problem "development": { ... "host": "host.docker.internal" .... }

4reactions
okabamaccommented, Aug 22, 2019

Please were you able to solve this? My connection is established but when I run migration it tells the address is not found

Read more comments on GitHub >

github_iconTop Results From Across the Web

Postgres ENOTFOUND error when connecting docker ...
One solution I found was to artificially delay Docker's connection attempt (basically wait until Postgres is ready before attempting to connect) ...
Read more >
ConnectionError: getaddrinfo ENOTFOUND postgres - Support
What is the problem? Be very detailed. I'm trying to use a local database and Nginx . I'm removing these services in my...
Read more >
Error getaddrinfo ENOTFOUND db when running sequelize ...
Edit. Okay, I just have to separate the port and host into individual fields: "development": { "username": "postgres", "password": "postgres", ...
Read more >
Having problems with connecting my node container ... - Reddit
The problem is the RUN yarn setup is supposed to run database migrations and seeds but I either get "ERROR: getaddrinfo ENOTFOUND postgres...
Read more >
Docker Compose networks - General Discussions
Hello I have a problem in my nodejs project with graphql and typescript ... SERVER_PORT=4000 DB_HOST=ci-postgres DB_PORT=5432 DB_USER=spirit ...
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