You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/02/04 12:05:06 UTC

[GitHub] [superset] PullGituser opened a new issue #12941: Unable to Login after docker container connect to Postgres Container

PullGituser opened a new issue #12941:
URL: https://github.com/apache/superset/issues/12941


   A clear and concise description of what the bug is.
   I have configured superset docker container and then change the URI in conifig.py to point to postgres. I am able to run the 'superset db upgrade' and could see tables are getting created under the database. Also able to create a new user in the postgres DB. But unable to login to the application using 'admin:admin'. 
   ### Expected results
   
   what you expected to happen.
   Should be able to login to application with dafult admin username and can add the postgres database in screen.
   ### Actual results
   Invalid User name/password error
   what actually happens.
   
   #### Screenshots
   
   If applicable, add screenshots to help explain your problem.
   
   #### How to reproduce the bug
   
   1. Go to '...'
   2. Click on '....'
   3. Scroll down to '....'
   4. See error
   
   ### Environment
   
   (please complete the following information):
   
   - superset version: `superset version`
   - python version: `python --version`
   - node.js version: `node -v`
   
   ### 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.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] BenCh94 commented on issue #12941: Unable to Login after docker container connect to Postgres Container

Posted by GitBox <gi...@apache.org>.
BenCh94 commented on issue #12941:
URL: https://github.com/apache/superset/issues/12941#issuecomment-953864654


   I'm seeing a similar issue with a docker image deployed in AWS ECS.
   
   I have created a superset_config.py file and added it to pythonpath:
   
   ```
   # Backend metadata access
   SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URI")
   
   WEBDRIVER_BASEURL = "http://0.0.0.0:8080/"
   SUPERSET_WEBSERVER_PROTOCOL = "http"
   SUPERSET_WEBSERVER_ADDRESS = "0.0.0.0"
   SUPERSET_WEBSERVER_PORT = 8088
   
   DEBUG = True
   ```
   
   Running superset db upgrade:
   
   ```
   root@xxxxxxx:/app# superset db upgrade
   Loaded your LOCAL configuration at [/usr/local/bin/superset_config.py]
   2021-10-28 11:50:51,859:INFO:superset.utils.logging_configurator:logging was configured successfully
   2021-10-28 11:50:51,865:INFO:root:Configured event logger of type <class 'superset.utils.log.DBEventLogger'>
   /usr/local/lib/python3.8/site-packages/flask_caching/__init__.py:201: UserWarning: Flask-Caching: CACHE_TYPE is set to null, caching is effectively disabled.
     warnings.warn(
   INFO  [alembic.runtime.migration] Context impl **PostgresqlImpl.**
   INFO  [alembic.runtime.migration] Will assume transactional DDL.
   INFO  [alembic.runtime.migration] Running upgrade  -> 4e6a06bad7a8, Init
   INFO  [alembic.runtime.migration] Running upgrade 4e6a06bad7a8 -> 5a7bad26f2a7, empty message
   INFO  [alembic.runtime.migration] Running upgrade 5a7bad26f2a7 -> 1e2841a4128, empty message
   INFO  [alembic.runtime.migration] Running upgrade 1e2841a4128 -> 2929af7925ed, TZ offsets in data sources
   ...
   ```
   
   Followed by create-admin:
   
   ```
   root@xxxxxxxx:/app# superset fab create-admin \
                  --username admin \
                  --firstname Superset \
                  --lastname Admin \
                  --email admin@superset.com \
                  --password <xxxxxxxxxx>
   **Loaded your LOCAL configuration at [/usr/local/bin/superset_config.py]**
   2021-10-28 11:57:11,564:INFO:superset.utils.logging_configurator:logging was configured successfully
   2021-10-28 11:57:11,647:INFO:root:Configured event logger of type <class 'superset.utils.log.DBEventLogger'>
   /usr/local/lib/python3.8/site-packages/flask_caching/__init__.py:201: UserWarning: Flask-Caching: CACHE_TYPE is set to null, caching is effectively disabled.
     warnings.warn(
   Recognized Database Authentications.
   Admin User admin created.
   ```
   and finally superset init
   
   These commands create the tables in Postgres and add the user into the ab_user table fine.
   
   But when I try to login I can see in the application logs superset is attempting to use sqlite3 and the superset_home folder has a new superset.db file created in it.
   
   ```
   2021-10-28T13:00:26.321+01:00 (sqlite3.OperationalError) no such table: ab_user
   2021-10-28T13:00:26.321+01:00 [SQL: SELECT ab_user.id AS ab_user_id, ab_user.first_name AS ab_user_first_name, ab_user.last_name AS ab_user_last_name, ab_user.username AS ab_user_username, ab_user.password AS ab_user_password, ab_user.active AS ab_user_active, ab_user.email AS ab_user_email, ab_user.last_login AS ab_user_last_login, ab_user.login_count AS ab_user_login_count, ab_user.fail_login_count AS ab_user_fail_login_count, ab_user.created_on AS ab_user_created_on, ab_user.changed_on AS ab_user_changed_on, ab_user.created_by_fk AS ab_user_created_by_fk, ab_user.changed_by_fk AS ab_user_changed_by_fk
   2021-10-28T13:00:26.322+01:00 FROM ab_user
   2021-10-28T13:00:26.322+01:00 WHERE lower(ab_user.username) = lower(?)]
   2021-10-28T13:00:26.322+01:00 [parameters: ('admin',)]
   2021-10-28T13:00:26.322+01:00 (Background on this error at: http://sqlalche.me/e/13/e3q8)
   2021-10-28T13:00:26.322+01:00 Traceback (most recent call last):
   2021-10-28T13:00:26.322+01:00 File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
   2021-10-28T13:00:26.322+01:00 self.dialect.do_execute(
   2021-10-28T13:00:26.322+01:00 File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
   2021-10-28T13:00:26.322+01:00 cursor.execute(statement, parameters)
   2021-10-28T13:00:26.322+01:00 sqlite3.OperationalError: no such table: ab_user
   2021-10-28T13:00:26.322+01:00 The above exception was the direct cause of the following exception:
   2021-10-28T13:00:26.322+01:00 Traceback (most recent call last):
   2021-10-28T13:00:26.322+01:00 File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
   2021-10-28T13:00:26.322+01:00 rv = self.dispatch_request()
   2021-10-28T13:00:26.322+01:00 File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
   2021-10-28T13:00:26.322+01:00 return self.view_functions[rule.endpoint](**req.view_args)
   2021-10-28T13:00:26.322+01:00 File "/usr/local/lib/python3.8/site-packages/flask_appbuilder/security/views.py", line 510, in login
   2021-10-28T13:00:26.322+01:00 user = self.appbuilder.sm.auth_user_db(
   2021-10-28T13:00:26.322+01:00 File "/usr/local/lib/python3.8/site-packages/flask_appbuilder/security/manager.py", line 846, in auth_user_db
   2021-10-28T13:00:26.322+01:00 user = self.find_user(username=username)
   2021-10-28T13:00:26.322+01:00 File "/usr/local/lib/python3.8/site-packages/flask_appbuilder/security/sqla/manager.py", line 159, in find_user
   2021-10-28T13:00:26.322+01:00 self.get_session.query(self.user_model)
   2021-10-28T13:00:26.322+01:00 File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3459, in one_or_none
   2021-10-28T13:00:26.322+01:00 ret = list(self)
   2021-10-28T13:00:26.322+01:00 File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3535, in __iter__
   2021-10-28T13:00:26.322+01:00 return self._execute_and_instances(context)
   2021-10-28T13:00:26.322+01:00 File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3560, in _execute_and_instances
   2021-10-28T13:00:26.322+01:00 result = conn.execute(querycontext.statement, self._params)
   2021-10-28T13:00:26.322+01:00 File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
   2021-10-28T13:00:26.322+01:00 return meth(self, multiparams, params)
   2021-10-28T13:00:26.322+01:00 File "/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
   2021-10-28T13:00:26.322+01:00 return connection._execute_clauseelement(self, multiparams, params)
   2021-10-28T13:00:26.322+01:00 File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1124, in _execute_clauseelement
   2021-10-28T13:00:26.322+01:00 ret = self._execute_context(
   2021-10-28T13:00:26.322+01:00 File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
   2021-10-28T13:00:26.322+01:00 self._handle_dbapi_exception(
   2021-10-28T13:00:26.322+01:00 File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1510, in _handle_dbapi_exception
   2021-10-28T13:00:26.322+01:00 util.raise_(
   2021-10-28T13:00:26.322+01:00 File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
   2021-10-28T13:00:26.322+01:00 raise exception
   2021-10-28T13:00:26.322+01:00 File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
   2021-10-28T13:00:26.322+01:00 self.dialect.do_execute(
   2021-10-28T13:00:26.322+01:00 File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
   2021-10-28T13:00:26.322+01:00 cursor.execute(statement, parameters)
   ```
   
   @dheeraj-chaudhari is it neccessary to update the config.py manually even with the SQLALCHEMY_DATABASE_URI set in the superset_config.py file. This seems like a difficult workaround for docker container deployed in ECS.
   
   Is there anyway to force superset to use the postgres DB instead of defaulting to the sqlite db.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] dheeraj-chaudhari commented on issue #12941: Unable to Login after docker container connect to Postgres Container

Posted by GitBox <gi...@apache.org>.
dheeraj-chaudhari commented on issue #12941:
URL: https://github.com/apache/superset/issues/12941#issuecomment-912105686


   I was getting the same issue. If you use docker image, then you must modify the config.py and delete superset_home/superser_db and then restart the container. After you restart the container you will see 8 tables created in your postgres. Then run the below commands
   
   - superset db upgrade
      --you will see 57 tables created in Postgres
   
   - superset fab create-admin \
                  --username admin \
                  --firstname Superset \
                  --lastname Admin \
                  --email admin@superset.com \
                  --password admin
      -- you should see admin user created in ab_user table.
   
   Make sure you should not have /app/superset_home/superser_db file created when you restart container else its still referring to sqlite
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] dheeraj-chaudhari edited a comment on issue #12941: Unable to Login after docker container connect to Postgres Container

Posted by GitBox <gi...@apache.org>.
dheeraj-chaudhari edited a comment on issue #12941:
URL: https://github.com/apache/superset/issues/12941#issuecomment-912105686


   I was getting the same issue. If you are using docker image, then you modify DATABASE_URI to point to postgres in config.py and delete superset_home/superser_db and then restart the container. After you restart the container you will see 8 tables created in your postgres. Then run the below commands
   
   - superset db upgrade
      --you will see 57 tables created in Postgres
   
   - superset fab create-admin \
                  --username admin \
                  --firstname Superset \
                  --lastname Admin \
                  --email admin@superset.com \
                  --password admin
      -- you should see admin user created in ab_user table.
   
   Make sure you should not have /app/superset_home/superser_db file created when you restart container else its still referring to sqlite
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] anilkulkarni87 commented on issue #12941: Unable to Login after docker container connect to Postgres Container

Posted by GitBox <gi...@apache.org>.
anilkulkarni87 commented on issue #12941:
URL: https://github.com/apache/superset/issues/12941#issuecomment-777980408


   I get the same error. I am trying this on a Windows WSL2 Ubuntu. I am using docker-compose up after cloning the repo.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] junlincc commented on issue #12941: Unable to Login after docker container connect to Postgres Container

Posted by GitBox <gi...@apache.org>.
junlincc commented on issue #12941:
URL: https://github.com/apache/superset/issues/12941#issuecomment-773703706


   this is strange, i run the same steps on a daily basis but never encountered this issue. 
   @dpgaspar @srinify do you guys know? thanks 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] dpgaspar commented on issue #12941: Unable to Login after docker container connect to Postgres Container

Posted by GitBox <gi...@apache.org>.
dpgaspar commented on issue #12941:
URL: https://github.com/apache/superset/issues/12941#issuecomment-778087505


   @PullGituser,
   
   make sure that when you update the config you reinstall superset `pip install -e .` or `python setup.py install` and then follow the init steps: `superset db upgrade`, `superset init` etc. What procedure did you use to create the user on Postgres?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] dheeraj-chaudhari edited a comment on issue #12941: Unable to Login after docker container connect to Postgres Container

Posted by GitBox <gi...@apache.org>.
dheeraj-chaudhari edited a comment on issue #12941:
URL: https://github.com/apache/superset/issues/12941#issuecomment-911985560


   I am facing the same issue. I am following the below link, In my case i am using postgres DB on host 
   https://hub.docker.com/r/apache/superset
   
   So before creating an admin user, i modified config.py in my container and then did "superset db upgrade". Upgrade went successful and i can see the tables get created in Postgres DB. Then i create an admin user using below command, admin user was created successfully and i can see the user in ab_user table
   
   docker exec -it superset superset fab create-admin \
                  --username admin \
                  --firstname Superset \
                  --lastname Admin \
                  --email admin@superset.com \
                  --password admin
   
   and then performed
   
   docker exec -it superset superset init
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] dheeraj-chaudhari commented on issue #12941: Unable to Login after docker container connect to Postgres Container

Posted by GitBox <gi...@apache.org>.
dheeraj-chaudhari commented on issue #12941:
URL: https://github.com/apache/superset/issues/12941#issuecomment-911985560


   I am facing the same issue. I am following the below link, In my case i am using postgres DB on host 
   https://hub.docker.com/r/apache/superset
   
   So before creating an admin user, i modified config.py in my container and then did "superset db upgrade". Upgrade went successful and i can see the tables get created. Then i create an admin user using below command, admin use was created successfully and i can see the user in ab_user table
   
   docker exec -it superset superset fab create-admin \
                  --username admin \
                  --firstname Superset \
                  --lastname Admin \
                  --email admin@superset.com \
                  --password admin
   
   and then performed
   
   docker exec -it superset superset init
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] junlincc commented on issue #12941: Unable to Login after docker container connect to Postgres Container

Posted by GitBox <gi...@apache.org>.
junlincc commented on issue #12941:
URL: https://github.com/apache/superset/issues/12941#issuecomment-773703706


   this is strange, i run the same steps on a daily basis but never encountered this issue. 
   @dpgaspar @srinify do you guys know? thanks 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] dheeraj-chaudhari edited a comment on issue #12941: Unable to Login after docker container connect to Postgres Container

Posted by GitBox <gi...@apache.org>.
dheeraj-chaudhari edited a comment on issue #12941:
URL: https://github.com/apache/superset/issues/12941#issuecomment-911985560


   I am facing the same issue. I am following the below link, In my case i am using postgres DB on host 
   https://hub.docker.com/r/apache/superset
   
   So before creating an admin user, i modified config.py in my container and then did "superset db upgrade". Upgrade went successful and i can see the tables get created in Postgres DB. Then i create an admin user using below command, admin use was created successfully and i can see the user in ab_user table
   
   docker exec -it superset superset fab create-admin \
                  --username admin \
                  --firstname Superset \
                  --lastname Admin \
                  --email admin@superset.com \
                  --password admin
   
   and then performed
   
   docker exec -it superset superset init
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] dheeraj-chaudhari removed a comment on issue #12941: Unable to Login after docker container connect to Postgres Container

Posted by GitBox <gi...@apache.org>.
dheeraj-chaudhari removed a comment on issue #12941:
URL: https://github.com/apache/superset/issues/12941#issuecomment-911985560


   I am facing the same issue. I am following the below link, In my case i am using postgres DB on host 
   https://hub.docker.com/r/apache/superset
   
   So before creating an admin user, i modified config.py in my container and then did "superset db upgrade". Upgrade went successful and i can see the tables get created in Postgres DB. Then i create an admin user using below command, admin user was created successfully and i can see the user in ab_user table
   
   docker exec -it superset superset fab create-admin \
                  --username admin \
                  --firstname Superset \
                  --lastname Admin \
                  --email admin@superset.com \
                  --password admin
   
   and then performed
   
   docker exec -it superset superset init
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] PullGituser commented on issue #12941: Unable to Login after docker container connect to Postgres Container

Posted by GitBox <gi...@apache.org>.
PullGituser commented on issue #12941:
URL: https://github.com/apache/superset/issues/12941#issuecomment-774081501


   I am using superset as a different container and postgres as a different container. (NOT USING Docker Compose). After updating the sqlalchemy connection string in config.py file to point to postgres container, I am not able to Login to application. Let me know if you need any additional details.
   
   Note - Tables are and user entry details are present in Postgres DB...


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org