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

   ### Bug description
   
   Hello !
   
   I still have some trouble with my superset install.
   I opened a thread a few weeks ago about issues to configure root application 
here https://github.com/apache/superset/issues/34773 but I realized that my 
problems have not connection with that, So I create a new thread for that.
   
   I'm trying to use docker compose to deploy superset in production 
environment, but I have several issues when the app start.
   <img width="1904" height="270" alt="Image" 
src="https://github.com/user-attachments/assets/c77d71f6-ee94-4987-9f5b-7f71a895ad29";
 />
   
   <img width="1905" height="254" alt="Image" 
src="https://github.com/user-attachments/assets/5f118a72-0ed9-4f9d-81a7-859122cacd14";
 />
   
   <img width="1887" height="450" alt="Image" 
src="https://github.com/user-attachments/assets/29fa0547-31dd-48f6-a740-998d3e19d20b";
 />
   
   First, Can you tell me more about websocket, and the intereset to use it ? 
   I'm trying to configure a superset application using docker compose with 
websocket connexion, but my application can't connect to superset web socket.
   
   My docker/superset_config_docker.py : 
   ```python
   HTML_SANITIZATION = True
   HTML_SANITIZATION_SCHEMA_EXTENSIONS = {
     "attributes": {
       "*": ["style", "className", "class"],
     },
     "tagNames": ["style"],
   }
   
   GLOBAL_ASYNC_QUERIES = True
   GLOBAL_ASYNC_QUERIES_TRANSPORT = "ws"
   GLOBAL_ASYNC_QUERIES_WEBSOCKET_URL = "ws://127.0.0.1:8080/"
   GLOBAL_ASYNC_QUERIES_JWT_SECRET = "MY_CUSTOM_JWT_KEY"
   GLOBAL_ASYNC_QUERIES_JWT_COOKIE_NAME = "async-token"
   ``` 
   
   ```
   # Secret key to 
   SUPERSET_SECRET_KEY = "MY_CUSTOM_SUPERSET_KEY"
   
   # Set log level
   SUPERSET_LOG_LEVEL = debug
   
   # Disable examples
   #SUPERSET_LOAD_EXAMPLES = no
   
   # Disable frontend container
   BUILD_SUPERSET_FRONTEND_IN_DOCKER = false
   
   # Configuration for websocket connection
   JWT_SECRET = "MY_CUSTOM_JWT_KEY"
   JWT_COOKIE_NAME = "async-token"
   ``` 
   
   My nginx configuration : 
   ```
   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 my.domain.fr;
   
       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;
       }
   
       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;
   }
   
   server {
       listen 80;
       listen [::]:80;
   
       server_name my.domain.fr;
   
       return 301 https://$host$request_uri;
   
       access_log /var/log/nginx/superset/access.log;
       error_log /var/log/nginx/superset/error.log;
   }
   ``` 
   
   My docker compose file : 
   ```
   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-frontend:/app/superset-frontend
     - superset_home:/app/superset_home
     - ./tests:/app/tests
   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-trixie
     args:
       DEV_MODE: "true"
       INCLUDE_CHROMIUM: ${INCLUDE_CHROMIUM:-false}
       INCLUDE_FIREFOX: ${INCLUDE_FIREFOX:-false}
       BUILD_TRANSLATIONS: ${BUILD_TRANSLATIONS:-true}
       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 # 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 # 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 # 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 # 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 # 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 # 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
   ``` 
   
   Do you have any idea to resolve these errors ? Thanks
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   3.9
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [ ] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [ ] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [ ] 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