superset: docker bug: werkzeug/utils.py" in send_from_directory
Bug description
website img
docker log -f
werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
2024-09-07 08:36:18,303:INFO:werkzeug:192.168.2.100 - - [07/Sep/2024 08:36:18] "GET /static/assets/images/superset-logo-horiz.png HTTP/1.1" 404 -
2024-09-07 08:36:18,364:INFO:werkzeug:192.168.2.100 - - [07/Sep/2024 08:36:18] "GET /static/appbuilder/css/webfonts/fa-solid-900.woff2 HTTP/1.1" 200 -
2024-09-07 08:36:18,429:WARNING:superset.views.base:HTTPException
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 713, in <lambda>
view_func=lambda **kw: self_ref().send_static_file(**kw), # type: ignore # noqa: B950
File "/usr/local/lib/python3.10/site-packages/flask/scaffold.py", line 331, in send_static_file
return send_from_directory(
File "/usr/local/lib/python3.10/site-packages/flask/helpers.py", line 590, in send_from_directory
return werkzeug.utils.send_from_directory( # type: ignore[return-value]
File "/usr/local/lib/python3.10/site-packages/werkzeug/utils.py", line 574, in send_from_directory
raise NotFound()
werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
2024-09-07 08:36:18,430:INFO:werkzeug:192.168.2.100 - - [07/Sep/2024 08:36:18] "GET /static/assets/images/favicon.png HTTP/1.1" 404 -
2024-09-07 08:36:21,994:INFO:werkzeug:192.168.2.100 - - [07/Sep/2024 08:36:21] "POST /login/ HTTP/1.1" 302 -
2024-09-07 08:36:22,011:INFO:werkzeug:192.168.2.100 - - [07/Sep/2024 08:36:22] "GET / HTTP/1.1" 302 -
2024-09-07 08:36:22,065:DEBUG:superset.stats_logger:[stats_logger] (incr) welcome
2024-09-07 08:36:22,073:INFO:werkzeug:192.168.2.100 - - [07/Sep/2024 08:36:22] "GET /superset/welcome/ HTTP/1.1" 200 -
2024-09-07 08:36:22,157:WARNING:superset.views.base:HTTPException
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 713, in <lambda>
view_func=lambda **kw: self_ref().send_static_file(**kw), # type: ignore # noqa: B950
File "/usr/local/lib/python3.10/site-packages/flask/scaffold.py", line 331, in send_static_file
return send_from_directory(
File "/usr/local/lib/python3.10/site-packages/flask/helpers.py", line 590, in send_from_directory
return werkzeug.utils.send_from_directory( # type: ignore[return-value]
File "/usr/local/lib/python3.10/site-packages/werkzeug/utils.py", line 574, in send_from_directory
raise NotFound()
werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
2024-09-07 08:36:22,158:INFO:werkzeug:192.168.2.100 - - [07/Sep/2024 08:36:22] "GET /static/assets/images/loading.gif HTTP/1.1" 404 -
2024-09-07 08:36:22,167:WARNING:superset.views.base:HTTPException
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 713, in <lambda>
view_func=lambda **kw: self_ref().send_static_file(**kw), # type: ignore # noqa: B950
File "/usr/local/lib/python3.10/site-packages/flask/scaffold.py", line 331, in send_static_file
return send_from_directory(
File "/usr/local/lib/python3.10/site-packages/flask/helpers.py", line 590, in send_from_directory
return werkzeug.utils.send_from_directory( # type: ignore[return-value]
File "/usr/local/lib/python3.10/site-packages/werkzeug/utils.py", line 574, in send_from_directory
raise NotFound()
werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
2024-09-07 08:36:22,167:INFO:werkzeug:192.168.2.100 - - [07/Sep/2024 08:36:22] "GET /static/assets/images/favicon.png HTTP/1.1" 404 -
2024-09-07 08:36:43,056:DEBUG:superset.stats_logger:[stats_logger] (incr) health
2024-09-07 08:36:43,056:INFO:werkzeug:127.0.0.1 - - [07/Sep/2024 08:36:43] "GET /health HTTP/1.1" 200 -
2024-09-07 08:36:53,585:DEBUG:superset.stats_logger:[stats_logger] (incr) welcome
2024-09-07 08:36:53,593:INFO:werkzeug:192.168.2.100 - - [07/Sep/2024 08:36:53] "GET /superset/welcome/ HTTP/1.1" 200 -
2024-09-07 08:36:53,625:WARNING:superset.views.base:HTTPException
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 713, in <lambda>
view_func=lambda **kw: self_ref().send_static_file(**kw), # type: ignore # noqa: B950
File "/usr/local/lib/python3.10/site-packages/flask/scaffold.py", line 331, in send_static_file
return send_from_directory(
File "/usr/local/lib/python3.10/site-packages/flask/helpers.py", line 590, in send_from_directory
return werkzeug.utils.send_from_directory( # type: ignore[return-value]
File "/usr/local/lib/python3.10/site-packages/werkzeug/utils.py", line 574, in send_from_directory
raise NotFound()
werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
2024-09-07 08:36:53,626:INFO:werkzeug:192.168.2.100 - - [07/Sep/2024 08:36:53] "GET /static/assets/images/loading.gif HTTP/1.1" 404 -
2024-09-07 08:37:13,160:DEBUG:superset.stats_logger:[stats_logger] (incr) health
2024-09-07 08:37:13,160:INFO:werkzeug:127.0.0.1 - - [07/Sep/2024 08:37:13] "GET /health HTTP/1.1" 200 -
How to reproduce the bug
- superset-4.0.2
- sudo docker compose up -d
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.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 2
- Comments: 19 (9 by maintainers)
Not sure if/how it would matter, maybe local settings, but why not using
http://localhost:8088instead ofhttp://{ip}:8088I found some similar issues and discussions that might help you resolve the 404 Not Found errors for static assets in Superset when using Docker:
Closed Issue: GET /ws HTTP/1.1 werkzeug.exceptions.NotFound: 404 Not Found
Closed Issue: NotFound errors on 2.0.1rc2
docker-composeand ensure proper setup and configuration [2].Closed Issue: [Errno 99] Cannot assign requested address in superset_init for docker-compose
To resolve the 404 Not Found errors for static assets, follow these steps:
Verify the build process: Ensure that the
npm run buildcommand completes without errors and generates the necessary static assets.Check the asset paths: Ensure that the paths to the static assets are correct and that they are being copied to the expected location in the final Docker image.
Run the Docker build without skipping the build step: Make sure
DEV_MODEis set tofalseto ensure the assets are built and copied:Configure Nginx correctly: Ensure that your Nginx configuration is set up to serve the static assets properly. Here is a sample configuration snippet from
docker/nginx/nginx.conf:Additionally, ensure that you follow the steps outlined in the Superset Docker documentation for proper setup and configuration:
Prerequisites:
Configuration:
/app/pythonpathfolder is mounted from./docker/pythonpath_devwhich contains a base configuration./docker/pythonpath_dev/superset_config.pyintended for use with local development../docker/pythonpath_dev/superset_config_local.exampleto./docker/pythonpath_dev/superset_config_docker.pyand fill in your overrides.Initializing Database:
superset-init). This may take a minute.Normal Operation:
docker compose uphttp://localhost:8088.By following these steps, you should be able to resolve the 404 Not Found errors for static assets in Superset when using Docker [4][5][6].
To continue talking to Dosu, mention @dosu.