superset icon indicating copy to clipboard operation
superset copied to clipboard

flask_appbuilder.security.sqla.manager:DB Creation and initialization failed: (psycopg2.OperationalError) could not translate host name "db" to address:

Open ngatilio opened this issue 2 years ago • 4 comments

A clear and concise description of what the bug is.

How to reproduce the bug

  1. Environment 'Windows 10 64'
  2. Go to 'superset master branch'
  3. Run 'docker-compose pull' and 'docker-compose up'
  4. Scroll down in logs
  5. See error

superset_worker_beat | 2022-04-28 18:26:06,338:ERROR:flask_appbuilder.security.sqla.manager:DB Creation and initialization failed: (psycopg2.OperationalError) could not translate host name "db" to address: Temporary failure in name resolution

when running localhost:8088

Expected results

what you expected to happen.

Actual results

what actually happens.

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

(please complete the following information):

  • browser type and version:
  • superset version: superset version
  • python version: python --version
  • node.js version: node -v
  • any feature flags active:

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • [ ] I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • [ ] I have reproduced the issue with at least the latest released version of superset.
  • [ ] I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

Add any other context about the problem here.

ngatilio avatar Apr 28 '22 18:04 ngatilio

+1

wyt1234 avatar Sep 06 '22 02:09 wyt1234

+1

soulstone-thanos avatar Sep 12 '22 07:09 soulstone-thanos

Im with the same issue

NephilimJaeger avatar Oct 05 '22 19:10 NephilimJaeger

same,i wanna too

unrulychump avatar Nov 22 '22 14:11 unrulychump

Hi I am also facing the same issue, looks like "db" is considered as a host, please let me know, ho can I fix, so that I can run superset.

Thanks Nagaraj M M

nagarajmmu avatar Dec 08 '22 01:12 nagarajmmu

Hi All

This issue resolved automatically, when I install the Superset in Ubuntu machine and run Superset with below command. docker-compose -f docker-compose.yml up It will take long time to setup, around one hour or more.

Thanks Nagaraj M M

nagarajmmu avatar Dec 12 '22 19:12 nagarajmmu

Encountered same problem. This seems to be caused by the db service was not able to start by the time superset_app try to connect to it. The root cause for db service failure need to be addressed first. In my case, I found the root cause for db service failure by bringing up only db service

# Bring down everything first
docker-compose down
# Bring up only db service
docker-compose up db

The problem in my case was

db_1                    | PostgreSQL Database directory appears to contain a database; Skipping initialization
db_1                    | 
db_1                    | 2023-01-08 04:16:00.303 UTC [1] FATAL:  database files are incompatible with server
db_1                    | 2023-01-08 04:16:00.303 UTC [1] DETAIL:  The data directory was initialized by PostgreSQL version 14, which is not compatible with this version 10.21 (Debian 10.21-1.pgdg90+1).

so my previous docker-compose up runs have created a database and the database is not at the right version. The old database is saved in superset_db_home volume. So what I had to do was remove this volume

docker volume rm superset_db_home

Then rerun docker-compose up

huankimtran avatar Jan 08 '23 05:01 huankimtran

Thank you @huankimtran Your method worked for me also

KrishnaPG avatar Jul 19 '23 06:07 KrishnaPG

@huankimtran ,it works! thanks!

cyann7 avatar Sep 08 '23 02:09 cyann7

Can anyone please suggest a way without deleting superset_db_home docker volume?

anantmulchandani avatar Sep 14 '23 07:09 anantmulchandani

Is anyone still considering this a bug? I.e. is there a PR to open around this, or can we call it case-closed? A documentation contribution would be fantastic if you think the advice on the thread will help others in the future.

rusackas avatar Mar 08 '24 21:03 rusackas