Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect superset docker to local postgresql database #34

Closed
dominijk opened this issue Jul 20, 2019 · 3 comments
Labels
bug

Comments

@dominijk
Copy link

@dominijk dominijk commented Jul 20, 2019

Describe the bug
Deploying through kitematic I'm unable to connect to a postgres db running on local host. Pyscog seems to be successfully installed

Loaded your LOCAL configuration at [/home/superset/config/superset_config.py]
/usr/local/lib/python3.6/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.
  """)
Recognized Database Authentications.
Admin User admin created.
Loaded your LOCAL configuration at [/home/superset/config/superset_config.py]
/usr/local/lib/python3.6/site-packages/psycopg2/__init__.py:144: UserWarning: The psycopg2 wheel package will be renamed from release 2.8; in order to keep installing from binary please use "pip install psycopg2-binary" instead. For details see: <http://initd.org/psycopg/docs/install.html#binary-install-from-pypi>.

To Reproduce
Steps to reproduce the behavior:
Add new database
Enter URI as
postgresql://username:@localhost:5432/dbname

Expected behavior
Test connection should be successful instead receive error

ERROR: {"error": "Connection failed!\n\nThe error message returned was:\n(psycopg2.OperationalError) could not connect to server: Connection refused\n\tIs the server running on host \"127.0.0.1\" and accepting\n\tTCP/IP connections on port 5432?

Db is accessible through that address

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: Desktop
  • OS: Mac
  • Browser Chrome
  • Version 75.0.3770.142 (Official Build) (64-bit)

Additional context
Add any other context about the problem here.

@issue-label-bot

This comment has been minimized.

Copy link

@issue-label-bot issue-label-bot bot commented Jul 20, 2019

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.92. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@issue-label-bot issue-label-bot bot added the bug label Jul 20, 2019
@abhioncbr

This comment has been minimized.

Copy link
Owner

@abhioncbr abhioncbr commented Jul 20, 2019

@dominijk If my understanding is correct, you are trying to connect Postgres database instance running on the host machine inside Superset docker container using Kitematic. You can't connect it using 'localhost', please try to follow as per this post - https://nickjanetakis.com/blog/docker-tip-35-connect-to-a-database-running-on-your-docker-host.

@dominijk

This comment has been minimized.

Copy link
Author

@dominijk dominijk commented Jul 21, 2019

@abhioncbr Thankyou so much, hugely appreciated. For reference on the latest docker you need to use the tip here - https://nickjanetakis.com/blog/docker-tip-65-get-your-docker-hosts-ip-address-from-in-a-container

Which gives you the following URI for a postgres db;

postgresql+psycopg2://username:password@host.docker.internal:port_number/database

@dominijk dominijk closed this Jul 21, 2019
@dominijk dominijk changed the title local postgresql connection failure Connect superset docker to local postgresql database Jul 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.