superset icon indicating copy to clipboard operation
superset copied to clipboard

import_datasources not working

Open rinshadka opened this issue 7 years ago • 9 comments

I am running superset version - 0.29.0rc7 and using postgresql as backend. While I tried importing datasource from yaml file , the encrypted password field in not updating in the dbs table. But if I configure datasource from interface , its working fine.

I have tried the following command,

superset import_datasources -p DBConnection.yaml

-------- cat DBConnection.yaml ----------

  • database_name: DEVL-Database extra: "{\r\n "metadata_params": {},\r\n "engine_params": {},\r\n "
    metadata_cache_timeout": {},\r\n "schemas_allowed_for_csv_upload": []\r\n
    }\r\n" sqlalchemy_uri: postgresql+psycopg2://postgres:[email protected]/devl tables: []

When I click "Test" connection , showing no authentication password supplied.

rinshadka avatar Oct 15 '19 14:10 rinshadka

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.61. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

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

issue-label-bot[bot] avatar Oct 15 '19 14:10 issue-label-bot[bot]

While clicking "Test Connection" getting error as -> ERROR: {"error": "Connection failed!\n\nThe error message returned was:\n(psycopg2.OperationalError) fe_sendauth: no password supplied\n (Background on this error at: http://sqlalche.me/e/e3q8)"

rinshadka avatar Oct 17 '19 04:10 rinshadka

@rinshadka any solution found? I am having exactly the same problem. Thanks in advance.

ivansocket avatar Nov 21 '19 16:11 ivansocket

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

stale[bot] avatar Jan 20 '20 16:01 stale[bot]

same problem, import datasources -p file.yaml is not working

DungLai avatar Jan 23 '20 03:01 DungLai

source venv/bin/activate superset import_datasources -p /workspace/

ivansocket avatar Jan 23 '20 12:01 ivansocket

I've managed to get it to work:

superset import_datasources -p /tmp/DATABASE.yaml
superset set_database_uri -d name_of_datasource_in_DATABASE.yaml -u postgresql://user:password@host:5432/database

after which I have a successful connection test.

ljpeters avatar Mar 13 '20 21:03 ljpeters

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

stale[bot] avatar May 13 '20 04:05 stale[bot]

Just in case anyone finds this via google, the example provided by @ljpeters works, but for me the name_of_datasource_in_DATABASE.yaml was confusing so here's another example that works:

sources.yaml:

databases:
- database_name: My database
[...]
superset import_datasources -p sources.yaml
superset set_database_uri -d "My database" -u postgresql://user:pass@db_host:5432/db_name

In our case, we use Docker to build out a superset instance with pre-built database and dashboards and this is what we use

zseta avatar Feb 01 '22 14:02 zseta