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

unable to run Superset 3.0.0rc1 on Debian #24638

Closed
zufolo441 opened this issue Jul 10, 2023 · 17 comments
Closed

unable to run Superset 3.0.0rc1 on Debian #24638

zufolo441 opened this issue Jul 10, 2023 · 17 comments
Assignees
Labels
v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch

Comments

@zufolo441
Copy link

Hi, I'm trying to run Superset 3.0.0rc1 on debian, but it's impossibile because of an error of missing method in sqlparse.Lexer.
It seems requiring sqlparse 0.4.5, that is still not available.
root@covezio:~# pip index versions sqlparse
WARNING: pip index is currently an experimental command. It may be removed/changed in a future release without prior warning.
sqlparse (0.4.4)
Available versions: 0.4.4, 0.4.3, 0.4.2, 0.4.1, 0.4.0, 0.3.1, 0.3.0, 0.2.4, 0.2.3, 0.2.2, 0.2.1, 0.2.0, 0.1.19, 0.1.18, 0.1.17, 0.1.16, 0.1.15, 0.1.14, 0.1.13, 0.1.12, 0.1.11, 0.1.10, 0.1.9, 0.1.8, 0.1.7, 0.1.6, 0.1.5, 0.1.4, 0.1.3, 0.1.2, 0.1.1, 0.1.0

@lf-floriandin
Copy link

You gotta downgrade to sqlparse 0.4.3.

pip uninstall sqlparse
pip install sqlparse==0.4.3

@rusackas rusackas added the v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch label Jul 10, 2023
@michael-s-molina
Copy link
Member

@EugeneTorap as the author of #24045, could you check this issue?

@zufolo441
Copy link
Author

zufolo441 commented Jul 10, 2023

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
apache-superset 3.0.0 requires sqlparse<0.5,>=0.4.4, but you have sqlparse 0.4.3 which is incompatible.

if I run superset with sqlparse 0.4.4 I obtain:
AttributeError: type object 'Lexer' has no attribute 'get_default_instance'

@amulya-mishra
Copy link

I'm also facing a similar issue on centos linux 7. after resolving all the dependency conflicts, i'm not able to build the docker image with a custom docker file, getting the error that ascii codec failed to decode byte at 0xef in position 0. This comes right after it was attempting to install pyhton-geohash.

when i build the image using the dockerfile provided int the repo itself, it completed successfully but when i try to login from UI, it keeps redirecting me to the login page and no error is getting logged at the backend. After inspection from chrome, i saw that some scripts are getting blocked.

@michael-s-molina
Copy link
Member

I registered this issue in the 3.0.0rc1 discussion for tracking.

I'm also facing a similar issue on centos linux 7. after resolving all the dependency conflicts, i'm not able to build the docker image with a custom docker file, getting the error that ascii codec failed to decode byte at 0xef in position 0. This comes right after it was attempting to install pyhton-geohash.

@amulya-mishra Could you open an issue about this and provide more details about the error?

when i build the image using the dockerfile provided int the repo itself, it completed successfully but when i try to login from UI, it keeps redirecting me to the login page and no error is getting logged at the backend. After inspection from chrome, i saw that some scripts are getting blocked.

This was reported here and it's related to CSP.

@amulya-mishra
Copy link

I registered this issue in the 3.0.0rc1 discussion for tracking.

I'm also facing a similar issue on centos linux 7. after resolving all the dependency conflicts, i'm not able to build the docker image with a custom docker file, getting the error that ascii codec failed to decode byte at 0xef in position 0. This comes right after it was attempting to install pyhton-geohash.

@amulya-mishra Could you open an issue about this and provide more details about the error?

when i build the image using the dockerfile provided int the repo itself, it completed successfully but when i try to login from UI, it keeps redirecting me to the login page and no error is getting logged at the backend. After inspection from chrome, i saw that some scripts are getting blocked.

This was reported here and it's related to CSP.

for the CSP issue, setting TALISMAN_ENABLED=False resolved the issue for me and i was able to login.

for the custom docker image issue i'm facing, will create an issue with appropriate details.

thanks

@EugeneTorap
Copy link
Contributor

@zufolo441 Do you have the problem on current master branch?
Can you try to run git clone and pip install -e . ?

@zufolo441
Copy link
Author

I tried.
I had to upgrade nodejs to v19 and add row
"source-map": "^0.8.0-beta.0",

to superset-frontend/package.json in order to be able to compile it.
...but it still doesn't work:
Traceback (most recent call last):
File "/home/superset/python3.9/lib/python3.9/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
worker.init_process()
File "/home/superset/python3.9/lib/python3.9/site-packages/gunicorn/workers/ggevent.py", line 146, in init_process
super().init_process()
File "/home/superset/python3.9/lib/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process
self.load_wsgi()
File "/home/superset/python3.9/lib/python3.9/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
self.wsgi = self.app.wsgi()
File "/home/superset/python3.9/lib/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/home/superset/python3.9/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
return self.load_wsgiapp()
File "/home/superset/python3.9/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
return util.import_app(self.app_uri)
File "/home/superset/python3.9/lib/python3.9/site-packages/gunicorn/util.py", line 359, in import_app
mod = importlib.import_module(module)
File "/home/superset/python3.9/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 972, in _find_and_load_unlocked
File "", line 228, in _call_with_frames_removed
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/home/superset/sstest/superset/init.py", line 21, in
from superset.app import create_app
File "/home/superset/sstest/superset/app.py", line 23, in
from superset.initialization import SupersetAppInitializer
File "/home/superset/sstest/superset/initialization/init.py", line 33, in
from superset.extensions import (
File "/home/superset/sstest/superset/extensions/init.py", line 32, in
from superset.utils.async_query_manager import AsyncQueryManager
File "/home/superset/sstest/superset/utils/async_query_manager.py", line 26, in
from superset.utils.core import get_user_id
File "/home/superset/sstest/superset/utils/core.py", line 90, in
from superset.sql_parse import sanitize_clause
File "/home/superset/sstest/superset/sql_parse.py", line 68, in
lex = Lexer.get_default_instance()
AttributeError: type object 'Lexer' has no attribute 'get_default_instance'

@EugeneTorap
Copy link
Contributor

@zufolo441 I see you use AsyncQueryManager in your Traceback.
Have you enabled GLOBAL_ASYNC_QUERIES?
Can you reproduce the issue without the Async Queries?

@EugeneTorap
Copy link
Contributor

@zufolo441 @michael-s-molina Anyway if you see our docker image we use python:3.9-slim-bookworm. It's Debian distribution. We use the image in our CI and there's no such issue.
@zufolo441 Can you reproduce the issue using our docker image?

@zufolo441
Copy link
Author

zufolo441 commented Jul 13, 2023

Hi, thanks for support.
here it is my config regarding async queries:

GLOBAL_ASYNC_QUERIES_REDIS_CONFIG = {
"port": 6379,
"host": "127.0.0.1",
"password": "",
"db": 0,
"ssl": False,
}
GLOBAL_ASYNC_QUERIES_REDIS_STREAM_PREFIX = "async-events-"
GLOBAL_ASYNC_QUERIES_REDIS_STREAM_LIMIT = 1000
GLOBAL_ASYNC_QUERIES_REDIS_STREAM_LIMIT_FIREHOSE = 1000000
GLOBAL_ASYNC_QUERIES_JWT_COOKIE_NAME = "async-token"
GLOBAL_ASYNC_QUERIES_JWT_COOKIE_SECURE = False
GLOBAL_ASYNC_QUERIES_JWT_COOKIE_DOMAIN = None
GLOBAL_ASYNC_QUERIES_JWT_SECRET = "test-secret-change-me"
GLOBAL_ASYNC_QUERIES_TRANSPORT = "polling"
GLOBAL_ASYNC_QUERIES_POLLING_DELAY = int(
timedelta(milliseconds=500).total_seconds() * 1000
)
GLOBAL_ASYNC_QUERIES_WEBSOCKET_URL = "ws://127.0.0.1:8080/"

DEFAULT_FEATURE_FLAGS: Dict[str, bool] = {
...
"GLOBAL_ASYNC_QUERIES": False,
...
}

@zufolo441
Copy link
Author

@EugeneTorap , I'm sorry, I don't have Docker on that server....

@sebastianliebscher
Copy link
Contributor

sebastianliebscher commented Jul 13, 2023

Hi @zufolo441,

It seems requiring sqlparse 0.4.5, that is still not available.

Superset requires minimum (and currently latest) sqlparse 0.4.4 which should be installed by pip install -e .. Is this true for you?

if I run superset with sqlparse 0.4.4 I obtain:
AttributeError: type object 'Lexer' has no attribute 'get_default_instance'

This error is only valid for sqlparse versions prior to 0.4.4 as get_default_instance was introduced with 0.4.4. Are you sure you have sqlparse 0.4.4 installed? Please check with pip list | grep sqlparse and make sure you have the correct virtualenvironment activated. I assume you installed Superset from scratch?

Can you provide your exact steps to reproduce this issue?

@zufolo441
Copy link
Author

zufolo441 commented Jul 13, 2023

@sebastianliebscher ,thanks for the answer.
I keep Superset updated periodically with
git clone https://github.com/apache/incubator-superset/
etc.
the result of command is:
root@covezio:/home/superset/sstest# source venv/bin/activate
(venv) root@covezio:/home/superset/sstest# pip list | grep sqlparse
sqlparse 0.4.4

I currently have in production Superset 2.0.1

@sebastianliebscher
Copy link
Contributor

As your error message only applies to sqlparse 0.4.3 and below, I think your installation is causing this issue. Do you have an account in Superset Slack community?

@zufolo441
Copy link
Author

zufolo441 commented Jul 14, 2023

As your error message only applies to sqlparse 0.4.3 and below, I think your installation is causing this issue. Do you have an account in Superset Slack community?

you was right. after update sqlparse it's working. thanks!!

@michael-s-molina
Copy link
Member

Thank you all for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch
Projects
None yet
Development

No branches or pull requests

8 participants