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

overriding config with SUPERSET_CONFIG_PATH env variable not working #2982

Closed
2 of 3 tasks
tclass opened this issue Jun 16, 2017 · 7 comments · Fixed by #2983
Closed
2 of 3 tasks

overriding config with SUPERSET_CONFIG_PATH env variable not working #2982

tclass opened this issue Jun 16, 2017 · 7 comments · Fixed by #2983

Comments

@tclass
Copy link

tclass commented Jun 16, 2017

Make sure these boxes are checked before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if 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

Superset version

0.18.4

Expected results

creating tables in postgres

Actual results

created sqllite db

Steps to reproduce

SQLALCHEMY_DATABASE_URI = 'postgresql://supersetdb:xxx@somehost/supersetdb'
The database is outside of the docker container, user and password are correct, it loads the config.py, at least it says so.

INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.```
@andrewmchen
Copy link
Contributor

andrewmchen commented Jun 16, 2017

I have the same issue. It looks like superset doesn't initialize the config correctly from ENV var.

If you run

import superset
superset.app.config.get('SQLALCHEMY_DATABASE_URI')

You'll get the sqlite path.

I found however that if I don't configure superset.config to pick up config form CONFIG_PATH_ENV_VAR the config starts working.


    if CONFIG_PATH_ENV_VAR in os.environ and False:
        # Explicitly import config module that is not in pythonpath; useful
        # for case where app is being executed via pex.
        print('Loaded your LOCAL configuration at [{}]'.format(
            os.environ[CONFIG_PATH_ENV_VAR]))
        imp.load_source('superset_config', os.environ[CONFIG_PATH_ENV_VAR])

This code path may be a bit wonky.

@xrmx
Copy link
Contributor

xrmx commented Jun 16, 2017

How are you starting superset? I mean, how do you tell superset which config to read.

@andrewmchen
Copy link
Contributor

Easy workaround is to just use the PYTHONPATH method of loading the config.

@tclass
Copy link
Author

tclass commented Jun 19, 2017

@xrmx I set the environment variable: SUPERSET_CONFIG_PATH: /home/superset/.superset/superset_config.py

@xrmx xrmx changed the title Connect with Postgres as metadata store overriding config path with SUPERSET_CONFIG_PATH env variable not working Jun 19, 2017
@xrmx xrmx changed the title overriding config path with SUPERSET_CONFIG_PATH env variable not working overriding config with SUPERSET_CONFIG_PATH env variable not working Jun 19, 2017
@aquinovo
Copy link

Easy workaround is to just use the PYTHONPATH method of loading the config.

How do I add my configuration file to PYTHONPATH?

@andrewmchen
Copy link
Contributor

@aquinovo
Copy link

It's been a while since I've done this but if I recall correctly it's like this: https://superset.incubator.apache.org/faq.html#why-does-flask-fab-or-superset-freezed-hung-not-responding-when-started-my-home-directory-is-nfs-mounted

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants