aklein-1s opened a new issue, #37753:
URL: https://github.com/apache/superset/issues/37753

   ### Bug description
   
   Hello ! 
   
   I tried to use web socket configuration a few months ago but I had some 
problem to do this, I created a thread about my problems here for information 
[](https://github.com/apache/superset/issues/35340)
   
   I prefer to create new post because I had other problems in this topic.
   
   So I still have websocket connection when I configure it.
   
   I have the following errors in developer console : 
   <img width="1384" height="61" alt="Image" 
src="https://github.com/user-attachments/assets/d10c9fbf-8f3f-4815-bdf6-81e820f595c6";
 />
   And I don't see the cookie named "async-event" (see the configuration below) 
: 
   <img width="1273" height="118" alt="Image" 
src="https://github.com/user-attachments/assets/671ffed0-e4c5-4eab-907e-4816d323fc0e";
 />
   
   Inside the container superset-websocket I have the following error : 
   `{"level":"error","message":"JWT not present","stack":"Error: JWT not 
present\n    at readChannelId (/home/superset-websocket/dist/index.js:250:15)\n 
   at Server.httpUpgrade (/home/superset-websocket/dist/index.js:338:9)\n    at 
Server.emit (node:events:513:28)\n    at onParserExecuteCommon 
(node:_http_server:772:14)\n    at onParserExecute (node:_http_server:686:3)"}`
   
   I share my configuration : 
   
   /etc/nginx/sites-enabled/superset.conf (nginx) : 
   ```
   upstream superset_app {
       server localhost:8088;
       keepalive 100;
   }
   
   upstream superset_websocket {
       server localhost:8080;
       keepalive 100;
   }
   
   server {
       listen [::]:443 ssl;
       listen 443 ssl;
       server_name subdomain.domain.com;
   
       include conf.d/ssl.conf;
   
       location /ws {
           proxy_pass http://superset_websocket;
           proxy_http_version 1.1;
           proxy_set_header Upgrade $http_upgrade;
           proxy_set_header Connection "Upgrade";
           proxy_set_header Host $host;
           proxy_set_header Cookie $http_cookie;
       }
   
       location / { 
           proxy_pass http://superset_app;
           proxy_set_header Host $http_host;
           proxy_set_header X-Real-IP $remote_addr;
           proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
           proxy_set_header X-Forwarded-Proto $scheme;
           proxy_http_version 1.1;
           port_in_redirect off;
           proxy_connect_timeout 300;
       }
   
       access_log /var/log/nginx/superset/access.log;
       error_log /var/log/nginx/superset/error.log;
   }
   ```
   
   docker compose.yml : 
   ```
   x-superset-user: &superset-user root
   x-superset-volumes: &superset-volumes
     # /app/pythonpath_docker will be appended to the PYTHONPATH in the final 
container
     - ./docker:/app/docker
     - ./superset:/app/superset
     - ./superset-core:/app/superset-core
     - ./superset-frontend:/app/superset-frontend
     - superset_home:/app/superset_home
     - ./tests:/app/tests
     - superset_data:/app/data
   x-common-build: &common-build
     context: .
     target: ${SUPERSET_BUILD_TARGET:-dev} # can use `dev` (default) or `lean`
     cache_from:
       - apache/superset-cache:3.10-slim-bookworm
     args:
       DEV_MODE: "true"
       INCLUDE_CHROMIUM: ${INCLUDE_CHROMIUM:-false}
       INCLUDE_FIREFOX: ${INCLUDE_FIREFOX:-false}
       BUILD_TRANSLATIONS: ${BUILD_TRANSLATIONS:-false}
       LOAD_EXAMPLES_DUCKDB: ${LOAD_EXAMPLES_DUCKDB:-true}
   
   services:
     redis:
       image: redis:7
       container_name: superset_cache
       restart: unless-stopped
       ports:
         - "127.0.0.1:6379:6379"
       volumes:
         - redis:/data
   
     db:
       env_file:
         - path: docker/.env # default
           required: true
         - path: docker/.env-local-websocket # optional override
           required: false
       image: postgres:16
       container_name: superset_db
       restart: unless-stopped
       ports:
         - "127.0.0.1:5432:5432"
       volumes:
         - db_home:/var/lib/postgresql/data
         - ./docker/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
   
     superset:
       env_file:
         - path: docker/.env # default
           required: true
         - path: docker/.env-local-websocket # optional override
           required: false
       build:
         <<: *common-build
       container_name: superset_app
       command: ["/app/docker/docker-bootstrap.sh", "app"]
       restart: unless-stopped
       ports:
         - 8088:8088
         # When in cypress-mode ->
         - 8081:8081
       extra_hosts:
         - "host.docker.internal:host-gateway"
       user: *superset-user
       depends_on:
         superset-init:
           condition: service_completed_successfully
       volumes: *superset-volumes
       environment:
         SUPERSET__SQLALCHEMY_EXAMPLES_URI: 
"duckdb:////app/data/examples.duckdb"
   
     superset-websocket:
       container_name: superset_websocket
       build: ./superset-websocket
       ports:
         - 8080:8080
       extra_hosts:
         - "host.docker.internal:host-gateway"
       depends_on:
         - redis
       # Mount everything in superset-websocket into container and
       # then exclude node_modules and dist with bogus volume mount.
       # This is necessary because host and container need to have
       # their own, separate versions of these files. .dockerignore
       # does not seem to work when starting the service through
       # docker compose.
       #
       # For example, node_modules may contain libs with native bindings.
       # Those bindings need to be compiled for each OS and the container
       # OS is not necessarily the same as host OS.
       volumes:
         - ./superset-websocket:/home/superset-websocket
         - /home/superset-websocket/node_modules
         - /home/superset-websocket/dist
   
         # Mounting a config file that contains a dummy secret required to boot 
up.
         # do not use this docker compose in production
         - 
./docker/superset-websocket/config.json:/home/superset-websocket/config.json
       environment:
         - PORT=8080
         - REDIS_HOST=redis
         - REDIS_PORT=6379
         - REDIS_SSL=false
   
     superset-init:
       build:
         <<: *common-build
       container_name: superset_init
       command: ["/app/docker/docker-init.sh"]
       env_file:
         - path: docker/.env # default
           required: true
         - path: docker/.env-local-websocket # optional override
           required: false
       depends_on:
         db:
           condition: service_started
         redis:
           condition: service_started
       user: *superset-user
       volumes: *superset-volumes
       environment:
         SUPERSET__SQLALCHEMY_EXAMPLES_URI: 
"duckdb:////app/data/examples.duckdb"
       healthcheck:
         disable: true
   
     superset-worker:
       build:
         <<: *common-build
       container_name: superset_worker
       command: ["/app/docker/docker-bootstrap.sh", "worker"]
       env_file:
         - path: docker/.env # default
           required: true
         - path: docker/.env-local-websocket # optional override
           required: false
       environment:
         CELERYD_CONCURRENCY: 2
       restart: unless-stopped
       depends_on:
         superset-init:
           condition: service_completed_successfully
       user: *superset-user
       volumes: *superset-volumes
       extra_hosts:
         - "host.docker.internal:host-gateway"
       healthcheck:
         test: ["CMD-SHELL", "celery -A superset.tasks.celery_app:app inspect 
ping -d celery@$$HOSTNAME"]
       # Bump memory limit if processing selenium / thumbnails on 
superset-worker
       # mem_limit: 2038m
       # mem_reservation: 128M
   
     superset-worker-beat:
       build:
         <<: *common-build
       container_name: superset_worker_beat
       command: ["/app/docker/docker-bootstrap.sh", "beat"]
       env_file:
         - path: docker/.env # default
           required: true
         - path: docker/.env-local-websocket # optional override
           required: false
       restart: unless-stopped
       depends_on:
         - superset-worker
       user: *superset-user
       volumes: *superset-volumes
       healthcheck:
         disable: true
   
     superset-tests-worker:
       build:
         <<: *common-build
       container_name: superset_tests_worker
       command: ["/app/docker/docker-bootstrap.sh", "worker"]
       env_file:
         - path: docker/.env # default
           required: true
         - path: docker/.env-local-websocket # optional override
           required: false
       profiles:
         - optional
       environment:
         DATABASE_HOST: localhost
         DATABASE_DB: test
         REDIS_CELERY_DB: 2
         REDIS_RESULTS_DB: 3
         REDIS_HOST: localhost
         CELERYD_CONCURRENCY: 8
       network_mode: host
       depends_on:
         superset-init:
           condition: service_completed_successfully
       user: *superset-user
       volumes: *superset-volumes
       healthcheck:
         test: ["CMD-SHELL", "celery inspect ping -A 
superset.tasks.celery_app:app -d celery@$$HOSTNAME"]
   
   volumes:
     superset_home:
       external: false
     db_home:
       external: false
     redis:
       external: false
     superset_data:
       external: false
   ```
   
   docker/pythonpath_dev/superset_config_docker.py
   ```
   GLOBAL_ASYNC_QUERIES = True
   GLOBAL_ASYNC_QUERIES_TRANSPORT = "ws"
   GLOBAL_ASYNC_QUERIES_JWT_COOKIE_NAME = "async-token"
   GLOBAL_ASYNC_QUERIES_JWT_SECRET = "453f8d0992c089699fb5d29c6f62098421356431"
   GLOBAL_ASYNC_QUERIES_WEBSOCKET_URL = "wss://subdomain.domain.com/ws" # use 
wss protocol (wss:) for SSL connection
   ```
   
   docker/.env-local
   ```
   JWT_SECRET = "453f8d0992c089699fb5d29c6f62098421356431"
   JWT_COOKIE_NAME = "async-token"
   ```
   
   docker/superset-websocket/config.json
   ```
   {
     "port": 8080,
     "logLevel": "info",
     "logToFile": false,
     "logFilename": "app.log",
     "statsd": {
       "host": "127.0.0.1",
       "port": 8125,
       "globalTags": []
     },
     "redis": {
       "port": 6379,
       "host": "127.0.0.1",
       "password": "",
       "db": 0,
       "ssl": false
     },
     "redisStreamPrefix": "async-events-",
     "jwtAlgorithms": ["HS256"],
     "jwtSecret": "453f8d0992c089699fb5d29c6f620984",
     "jwtCookieName": "async-token"
   }
   ```
   
   A question about that, is it possible to parameter all in .env-local, with 
no modification in superset_config_docker.py ?
   
   I don't understand what's wrong with my configuration...
   Is someone can help me to fix this ?
   
   Thanks
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   3.9
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [x] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [x] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [x] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to