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/08/01 17:42:21 UTC
[GitHub] [superset] EMCP opened a new issue #16001: unable to add database of data via superset CLI on fresh install
EMCP opened a new issue #16001:
URL: https://github.com/apache/superset/issues/16001
### Expected results
instantiate a fresh install of apache-superset and connect a pre-existing pgsql database to it via CLI `superset set-database-uri` for the purpose of visualizing and exploring that postgresql's data
### Actual results
my apache-superset complains in the CLI about `no such table: dbs` and nothing seems to get added.
#### Screenshots
#### How to reproduce the bug
I basically follow the "from scratch" instructions on Ubuntu 20.04
```
apt-get update
apt-get y install build-essential libssl-dev libffi-dev python3-dev python3-pip libsasl2-dev libldap2-dev
pip install werkzeug==1.0.1
pip install itsdangerous==1.1.0
pip install flask-appbuilder==3.1.1
pip install psycopg2-binary
pip install pillow
pip install gunicorn gevent
pip install apache-superset
superset db upgrade
export FLASK_APP=superset
superset fab create-admin --username BLAH --firstname BLAH --lastname BLEGH --email blegh@some.co --password BLAHBLAH
superset init
<REBOOT>
superset set-database-uri --database_name SOMEDB --uri postgresql://SOME_SUER:SOMEPASS@localhost:5432/SOMEDB --skip_create
logging was configured successfully
2021-08-01 16:24:23,385:INFO:superset.utils.logging_configurator:logging was configured successfully
2021-08-01 16:24:23,389:INFO:root:Configured event logger of type <class 'superset.utils.log.DBEventLogger'>
/usr/local/lib/python3.8/dist-packages/flask_caching/__init__.py:201: UserWarning: Flask-Caching: CACHE_TYPE is set to null, caching is effectively disabled.
warnings.warn(
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
self.dialect.do_execute(
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/engine/default.py", line 608, in do_execute
cursor.execute(statement, parameters)
sqlite3.OperationalError: no such table: dbs
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/superset", line 8, in <module>
sys.exit(superset())
File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/flask/cli.py", line 586, in main
return super(FlaskGroup, self).main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/flask/cli.py", line 426, in decorator
return __ctx.invoke(f, *args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/superset/cli.py", line 214, in set_database_uri
utils.get_or_create_db(database_name, uri, not skip_create)
File "/usr/local/lib/python3.8/dist-packages/superset/utils/core.py", line 1223, in get_or_create_db
db.session.query(models.Database).filter_by(database_name=database_name).first()
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/orm/query.py", line 3429, in first
ret = list(self[0:1])
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/orm/query.py", line 3203, in __getitem__
return list(res)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/orm/query.py", line 3535, in __iter__
return self._execute_and_instances(context)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/orm/query.py", line 3560, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/engine/base.py", line 1011, in execute
return meth(self, multiparams, params)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/engine/base.py", line 1124, in _execute_clauseelement
ret = self._execute_context(
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
self._handle_dbapi_exception(
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/engine/base.py", line 1510, in _handle_dbapi_exception
util.raise_(
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/util/compat.py", line 182, in raise_
raise exception
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
self.dialect.do_execute(
File "/usr/local/lib/python3.8/dist-packages/sqlalchemy/engine/default.py", line 608, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: dbs
[SQL: SELECT dbs.uuid AS dbs_uuid, dbs.created_on AS dbs_created_on, dbs.changed_on AS dbs_changed_on, dbs.id AS dbs_id, dbs.verbose_name AS dbs_verbose_name, dbs.database_name AS dbs_database_name, dbs.sqlalchemy_uri AS dbs_sqlalchemy_uri, dbs.password AS dbs_password, dbs.cache_timeout AS dbs_cache_timeout, dbs.select_as_create_table_as AS dbs_select_as_create_table_as, dbs.expose_in_sqllab AS dbs_expose_in_sqllab, dbs.allow_run_async AS dbs_allow_run_async, dbs.allow_csv_upload AS dbs_allow_csv_upload, dbs.allow_ctas AS dbs_allow_ctas, dbs.allow_cvas AS dbs_allow_cvas, dbs.allow_dml AS dbs_allow_dml, dbs.force_ctas_schema AS dbs_force_ctas_schema, dbs.allow_multi_schema_metadata_fetch AS dbs_allow_multi_schema_metadata_fetch, dbs.extra AS dbs_extra, dbs.encrypted_extra AS dbs_encrypted_extra, dbs.impersonate_user AS dbs_impersonate_user, dbs.server_cert AS dbs_server_cert, dbs.created_by_fk AS dbs_created_by_fk, dbs.changed_by_fk AS dbs_changed_by_fk
FROM dbs
WHERE dbs.database_name = ?
LIMIT ? OFFSET ?]
[parameters: ('SOMEDB', 1, 0)]
(Background on this error at: http://sqlalche.me/e/13/e3q8)
```
### Environment
(please complete the following information):
- superset version: `superset version` `v1.2.0`
- python version: `python3 --version` `3.8.10`
- node.js version: `node -v`
- any feature flags active:
--
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] EMCP edited a comment on issue #16001: unable to add database of data via superset CLI on fresh install
Posted by GitBox <gi...@apache.org>.
EMCP edited a comment on issue #16001:
URL: https://github.com/apache/superset/issues/16001#issuecomment-890560239
sorry one last question, it isn't clear how do I programmatically install the new DB.. do I authorize via token or where should I be placing what in the HTTP headers in order to get authorization to create new DBs ? Not seeing where or how programmatically (or via GUI) to get a token
EDIT: ah okay I can do it via a REST CALL, perfect
/security/login
--
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] EMCP commented on issue #16001: unable to add database of data via superset CLI on fresh install
Posted by GitBox <gi...@apache.org>.
EMCP commented on issue #16001:
URL: https://github.com/apache/superset/issues/16001#issuecomment-890558496
ah, now I saw this..
https://superset.apache.org/docs/installation/configuring-superset
```
# The SQLAlchemy connection string to your database backend
# This connection defines the path to the database that stores your
# superset metadata (slices, connections, tables, dashboards, ...).
# Note that the connection information to connect to the datasources
# you want to explore are managed directly in the web UI
SQLALCHEMY_DATABASE_URI = 'sqlite:////path/to/superset.db'
```
so then I should NOT use this `superset set-database-uri` command at all.. and JUST try the REST api?
--
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] EMCP edited a comment on issue #16001: unable to add database of data via superset CLI on fresh install
Posted by GitBox <gi...@apache.org>.
EMCP edited a comment on issue #16001:
URL: https://github.com/apache/superset/issues/16001#issuecomment-890553991
Should I switch to the REST API for these operations? I am not understanding if that API and the CLI are an exact mirror or not..
https://superset.apache.org/docs/rest-api
I see the POST command but is there an official call for that within the CLI ?
--
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] EMCP edited a comment on issue #16001: unable to add database of data via superset CLI on fresh install
Posted by GitBox <gi...@apache.org>.
EMCP edited a comment on issue #16001:
URL: https://github.com/apache/superset/issues/16001#issuecomment-890553991
Should I switch to the REST API for these operations? I am not understanding if that API and the CLI are an exact mirror or not..
https://superset.apache.org/docs/rest-api
I see the POST command but is there an official call for that within the CLI ?
When I try testing against the URI according to Swagger I just get 404s'' if this is an autorization issue shouldn't it be a 403?

--
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] EMCP edited a comment on issue #16001: unable to add database of data via superset CLI on fresh install
Posted by GitBox <gi...@apache.org>.
EMCP edited a comment on issue #16001:
URL: https://github.com/apache/superset/issues/16001#issuecomment-890560239
sorry one last question, it isn't clear how do I programmatically install the new DB.. do I authorize via token or where should I be placing what in the HTTP headers in order to get authorization to create new DBs ? Not seeing where or how programmatically (or via GUI) to get a token
--
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] EMCP edited a comment on issue #16001: unable to add database of data via superset CLI on fresh install
Posted by GitBox <gi...@apache.org>.
EMCP edited a comment on issue #16001:
URL: https://github.com/apache/superset/issues/16001#issuecomment-890553991
Should I switch to the REST API for these operations? I am not understanding if that API and the CLI are an exact mirror or not..
https://superset.apache.org/docs/rest-api
I see the POST command but is there an official call for that within the CLI ?
When I try testing against the URI according to Swagger I just get 404s'' if this is an authorization issue shouldn't it be a 403?
--
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] EMCP closed issue #16001: unable to add database of data via superset CLI on fresh install
Posted by GitBox <gi...@apache.org>.
EMCP closed issue #16001:
URL: https://github.com/apache/superset/issues/16001
--
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] EMCP commented on issue #16001: unable to add database of data via superset CLI on fresh install
Posted by GitBox <gi...@apache.org>.
EMCP commented on issue #16001:
URL: https://github.com/apache/superset/issues/16001#issuecomment-890560239
sorry one last question, it isn't clear how do I programmatically install the new DB.. do I authorize via token or where should I be placing what in the HTTP headers in order to get authorization to create new DBs ?
--
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] EMCP commented on issue #16001: unable to add database of data via superset CLI on fresh install
Posted by GitBox <gi...@apache.org>.
EMCP commented on issue #16001:
URL: https://github.com/apache/superset/issues/16001#issuecomment-890553991
Should I switch to the REST API for these operations? I am not understanding if that API and the CLI are an exact mirror or not..
https://superset.apache.org/docs/rest-api
--
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] EMCP edited a comment on issue #16001: unable to add database of data via superset CLI on fresh install
Posted by GitBox <gi...@apache.org>.
EMCP edited a comment on issue #16001:
URL: https://github.com/apache/superset/issues/16001#issuecomment-890553991
Should I switch to the REST API for these operations? I am not understanding if that API and the CLI are an exact mirror or not..
https://superset.apache.org/docs/rest-api
I see the POST command but is there an official call for that within the CLI ?
--
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] EMCP closed issue #16001: unable to add database of data via superset CLI on fresh install
Posted by GitBox <gi...@apache.org>.
EMCP closed issue #16001:
URL: https://github.com/apache/superset/issues/16001
--
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