WebSocket connection to 'ws://localhost:5000/ws' failed: Error during WebSocket handshake: Unexpected response code: 404 #36089
Replies: 11 comments
-
|
Hi @septfish! I'm Dosu and I’m helping the superset team. The 404 WebSocket error happens because Flask (which Superset uses for its backend) does not natively support WebSockets, and the Also, your Python (3.9) and Node (16) versions are not supported with the latest Superset code. Superset now requires Python 3.10 or 3.11 and Node.js 20.x. Running unsupported versions can cause frontend/backend mismatches and asset build issues, which often result in errors like this one. The recommended fix is to use a stable Superset release (like 6.0) and upgrade your Python and Node versions to the supported ones. This should resolve the WebSocket errors and improve overall stability [source]. If you need async features (like live query updates), you must run the Node.js WebSocket server alongside Flask and configure Superset to use it. The WebSocket server runs on a different port and must be started separately. For most development and production setups, using Docker Compose is the easiest way to get all required services (Flask, Celery, Node, WebSocket, Redis, etc.) running together, even on Windows [source] [source]. In summary: Flask doesn't handle WebSockets for Superset; use supported Python/Node versions; use a stable Superset release; and if you need async features, make sure the Node.js WebSocket server is running and properly configured. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
To get superset-websocket working and avoid the 404 WebSocket errors, you need to:
If you still see 404 errors, double-check that the WebSocket server is running, the port matches in both configs, and that you’re not mixing up Let me know if you need a sample config or run into a specific error! To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
Maybe I miss some config, it is the same error after I set the config as below. pls tell me what I should do next. my config.js: my superset_config.py: |
Beta Was this translation helpful? Give feedback.
-
|
This is my browser url: http://localhost:5000/superset/welcome/ |
Beta Was this translation helpful? Give feedback.
-
|
Your browser URL (http://localhost:5000/superset/welcome/) is the normal Superset home page and is not related to the WebSocket 404 error. The WebSocket connection should use the URL you set in your config ( To troubleshoot:
Also, your Python (3.9) and Node (16) versions are not supported with the latest Superset code. Superset now requires Python 3.10/3.11 and Node.js 20.x. Using unsupported versions can cause asset and config issues that lead to errors like this. Upgrading to supported versions and using a stable Superset release is strongly recommended for reliable async features and WebSocket support (reference). Let me know what you see in the Network tab and if the WebSocket server is running on port 8080. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
I try to reboot all the server, but don't solve the 404 problems. I have below two questions: question two: |
Beta Was this translation helpful? Give feedback.
-
|
This issue is not related to the startup sequence—there’s no required order for starting Superset (Flask) and the superset-websocket server. What matters is that both are running at the same time and are properly configured to use the same host, port, JWT secret, and cookie name. If either service is down or misconfigured, you’ll get errors like 404 or failed WebSocket handshakes. So yes, both the Superset frontend (Flask server) and the superset-websocket server must be started and available for async features to work as expected. If you’re still seeing 404 errors, double-check that both services are running, configs match, and the frontend is using the correct WebSocket URL. Reference To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
Should I start server by "npm run dev" in superset-frontend too? |
Beta Was this translation helpful? Give feedback.
-
|
You only need to run npm run dev (or npm run dev-server) in superset-frontend if you are actively developing the frontend and want hot-reloading or live asset updates. For normal use—including async/WebSocket features—it's not required, as Flask serves the built frontend assets by default. Just make sure your backend (Flask), superset-websocket server, and Redis are running and properly configured. If you do run the frontend dev server, access Superset at http://localhost:9000 instead of the Flask port. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
It seems that you're using Windows (unsupported) and the bot might be right about this:
I think this is best moved to a Discussion, where you can continue working on this with Dosu, but I don't think(?) there's a Superset bug here. |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
Bug description
Why did I encounter the below problem. I don't know how to solve it. I want to use superset and celery in Windows system. Is it the flask don't support the web socket? pls tell me what should I do next?
VM20494 WebSocketClient.js:17 WebSocket connection to 'ws://localhost:5000/ws' failed: Error during WebSocket handshake: Unexpected response code: 404
vendors-node_modules…ba6aa.entry.js:3845 WebSocket connection to 'ws://localhost:5000/ws' failed: Error during WebSocket handshake: Unexpected response code: 404
VM20496 index.js:494 [webpack-dev-server]
Event {isTrusted: true, type: 'error', target: WebSocket, currentTarget: WebSocket, eventPhase: 2, …}
VM20496 index.js:486 [webpack-dev-server] Disconnected!
VM20496 index.js:486 [webpack-dev-server] Trying to reconnect...
index.js:494 [webpack-dev-server]
Event {isTrusted: true, type: 'error', target: WebSocket, currentTarget: WebSocket, eventPhase: 2, …}
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist
Beta Was this translation helpful? Give feedback.
All reactions