question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sqlalchemy.exc.ProgrammingError when installing via docker-compose up on Windows as of Commit 3e374dab0

See original GitHub issue

A clear and concise description of what the bug is.

Expected results

docker-compose up as per instructions. Open http://localhost:8088/ and see home page of Superset.

Actual results

sqlalchemy.exc.ProgrammingError. Reading the logs it looks like one of the dbs or tables hasn’t fully initialised.

Screenshots

If applicable, add screenshots to help explain your problem.

Traceback:

sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation "ab_permission_view_role" does not exist
LINE 2: FROM ab_permission_view JOIN ab_permission_view_role ON ab_p...
                                     ^

[SQL: SELECT ab_permission_view.id AS ab_permission_view_id, ab_permission_view.permission_id AS ab_permission_view_permission_id, ab_permission_view.view_menu_id AS ab_permission_view_view_menu_id 
FROM ab_permission_view JOIN ab_permission_view_role ON ab_permission_view.id = ab_permission_view_role.permission_view_id JOIN ab_role ON ab_role.id = ab_permission_view_role.role_id JOIN ab_permission ON ab_permission.id = ab_permission_view.permission_id JOIN ab_view_menu ON ab_view_menu.id = ab_permission_view.view_menu_id 
WHERE ab_permission.name = %(name_1)s AND ab_role.id IN (%(id_1)s)]
[parameters: {'name_1': 'menu_access', 'id_1': 2}]
(Background on this error at: http://sqlalche.me/e/13/f405)

Traceback (most recent call last)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1278, in _execute_context
cursor, statement, parameters, context
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
cursor.execute(statement, parameters)
The above exception was the direct cause of the following exception:
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2464, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2450, in wsgi_app
response = self.handle_exception(e)
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1867, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/security/views.py", line 501, in login
self.login_template, title=self.title, form=form, appbuilder=self.appbuilder
File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/baseviews.py", line 281, in render_template
template, **dict(list(kwargs.items()) + list(self.extra_args.items()))
File "/usr/local/lib/python3.6/site-packages/flask/templating.py", line 140, in render_template
ctx.app,
File "/usr/local/lib/python3.6/site-packages/flask/templating.py", line 120, in _render
rv = template.render(context)
File "/usr/local/lib/python3.6/site-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/usr/local/lib/python3.6/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/usr/local/lib/python3.6/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/templates/appbuilder/general/security/login_db.html", line 2, in top-level template code
{% extends "appbuilder/base.html" %}
File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/templates/appbuilder/base.html", line 1, in top-level template code
{% extends base_template %}
File "/app/superset/templates/superset/base.html", line 20, in top-level template code
{% from 'superset/partials/asset_bundle.html' import css_bundle, js_bundle with context %}
File "/app/superset/templates/appbuilder/baselayout.html", line 20, in top-level template code
{% import 'appbuilder/baselib.html' as baselib %}
File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/templates/appbuilder/init.html", line 46, in top-level template code
{% block body %}
File "/app/superset/templates/appbuilder/baselayout.html", line 45, in block "body"
<div id="app" data-bootstrap="{{ bootstrap_data() }}"></div>
File "/app/superset/views/base.py", line 326, in serialize_bootstrap_data
{"common": common_bootstrap_payload()},
File "/app/superset/views/base.py", line 318, in common_bootstrap_payload
"menu_data": menu_data(),
File "/app/superset/views/base.py", line 259, in menu_data
menu = appbuilder.menu.get_data()
File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/menu.py", line 64, in get_data
self.get_flat_name_list()
File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/security/manager.py", line 1169, in get_user_menu_access
None, "menu_access", view_menus_name=menu_names
File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/security/manager.py", line 1141, in _get_user_permission_view_menus
permission_name, db_role_ids
File "/usr/local/lib/python3.6/site-packages/flask_appbuilder/security/sqla/manager.py", line 362, in find_roles_permission_view_menus
self.role_model.id.in_(role_ids),
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3341, in all
return list(self)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3503, in __iter__
return self._execute_and_instances(context)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 3528, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1014, in execute
return meth(self, multiparams, params)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1133, in _execute_clauseelement
distilled_params,
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1318, in _execute_context
e, statement, parameters, cursor, context
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1512, in _handle_dbapi_exception
sqlalchemy_exception, with_traceback=exc_info[2], from_=e
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
raise exception
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1278, in _execute_context
cursor, statement, parameters, context
File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation "ab_permission_view_role" does not exist
LINE 2: FROM ab_permission_view JOIN ab_permission_view_role ON ab_p...
^

[SQL: SELECT ab_permission_view.id AS ab_permission_view_id, ab_permission_view.permission_id AS ab_permission_view_permission_id, ab_permission_view.view_menu_id AS ab_permission_view_view_menu_id
FROM ab_permission_view JOIN ab_permission_view_role ON ab_permission_view.id = ab_permission_view_role.permission_view_id JOIN ab_role ON ab_role.id = ab_permission_view_role.role_id JOIN ab_permission ON ab_permission.id = ab_permission_view.permission_id JOIN ab_view_menu ON ab_view_menu.id = ab_permission_view.view_menu_id
WHERE ab_permission.name = %(name_1)s AND ab_role.id IN (%(id_1)s)]
[parameters: {'name_1': 'menu_access', 'id_1': 2}]
(Background on this error at: http://sqlalche.me/e/13/f405)
The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error.
To switch between the interactive traceback and the plaintext one, you can click on the "Traceback" headline. From the text traceback you can also create a paste of it. For code execution mouse-over the frame you want to debug and click on the console icon on the right side.

You can execute arbitrary Python code in the stack frames and there are some extra helpers available for introspection:

dump() shows all variables in the frame
dump(obj) dumps all that's known about the object

How to reproduce the bug

  1. git pull
  2. git checkout 3e374dab0 or git checkout master
  3. docker-compose up
  4. Open http://localhost:8088/

Environment

Docker as per instructions.

  • superset version: superset version - 3e374dab0 - commit
  • python version: python --version
  • node.js version: node -v
  • npm version: npm -v

Checklist

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

  • [x ] 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.
  • [x ] I have checked the issue tracker for the same issue and I haven’t found one similar.
  • There is one also about docker install. , but on an ubuntu environment with a different error.

Additional context

Windows 10 running WSL as a backend.

If merged this PR perhaps means it’s not a valid bug as windows: https://github.com/apache/incubator-superset/pull/10511

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:9
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

7reactions
TechplexEngineercommented, May 8, 2021

Something went wrong on my first init. I found that deleting the volumes and retrying made all the difference. Using docker-compose down -v turns out without the -v volumes persist.

5reactions
subhashbcommented, Sep 1, 2020

I can confirm the same error on Mac (OS Catalina - 10.15.6 (19G2021))

Read more comments on GitHub >

github_iconTop Results From Across the Web

sqlalchemy.exc.ProgrammingError when installing ... - GitHub
sqlalchemy.exc.ProgrammingError when installing via docker-compose up on Windows as of Commit 3e374dab0 #10711. Open. 1 task done.
Read more >
subject:"\[GitHub\] \[incubator\-superset\] brylie ... - The Mail Archive
... brylie commented on issue #10711: sqlalchemy.exc.ProgrammingError when installing via docker-compose up on Windows as of Commit 3e374dab0.
Read more >
`docker-compose up` : sqlalchemy.exc.ProgrammingError
I'm trying to launch airflow UI using docker for a data pipeline project using an AWS redshift cluster. I planning to use LocalExecutor...
Read more >
Issues · apache/superset · GitHub
sqlalchemy.exc.ProgrammingError when installing via docker-compose up on Windows as of Commit 3e374dab0 !deprecated-label:bug Deprecated label - Use #bug ...
Read more >
stac-fastapi
Install from pypi.org pip install stac-fastapi.api stac-fastapi.types ... experimental features on Docker for Windows in order to run the docker-compose, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found