superset icon indicating copy to clipboard operation
superset copied to clipboard

werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server

Open khanh78180 opened this issue 3 years ago • 40 comments

A clear and concise description of what the bug is.

How to reproduce the bug

  1. Go to '.Data ..'
  2. Click on '.Databases...'
  3. Scroll down to '....' Trying to list database
  4. See error perset_app | 81.220.237.14 - - [08/Jun/2022:20:04:52 +0000] "GET /static/assets/images/filter-results.svg HTTP/1.1" 404 0 "https://superset.kdinh.fr/databaseview/list/?pageIndex=0&sortColumn=expose_in_sqllab&sortOrder=desc" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0" superset_app | 81.220.237.14 - - [08/Jun/2022:20:04:54 +0000] "GET /api/v1/database/?q=(order_column:expose_in_sqllab,order_direction:asc,page:0,page_size:25) HTTP/1.1" 200 529 "https://superset.kdinh.fr/databaseview/list/?pageIndex=0&sortColumn=expose_in_sqllab&sortOrder=asc" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0" superset_app | HTTPException superset_app | Traceback (most recent call last): superset_app | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request superset_app | rv = self.dispatch_request() superset_app | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request superset_app | return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args) superset_app | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 515, in superset_app | view_func=lambda **kw: self_ref().send_static_file(**kw), # type: ignore # noqa: B950 superset_app | File "/usr/local/lib/python3.8/site-packages/flask/scaffold.py", line 332, in send_static_file superset_app | return send_from_directory( superset_app | File "/usr/local/lib/python3.8/site-packages/flask/helpers.py", line 700, in send_from_directory superset_app | return werkzeug.utils.send_from_directory( # type: ignore superset_app | File "/usr/local/lib/python3.8/site-packages/werkzeug/utils.py", line 847, in send_from_directory superset_app | raise NotFound() superset_app | 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. superset_app | 2022-06-08 20:04:54,173:WARNING:superset.views.base:HTTPException superset_app | Traceback (most recent call last): superset_app | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request superset_app | rv = self.dispatch_request() superset_app | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request superset_app | return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args) superset_app | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 515, in superset_app | view_func=lambda **kw: self_ref().send_static_file(**kw), # type: ignore # noqa: B950 superset_app | File "/usr/local/lib/python3.8/site-packages/flask/scaffold.py", line 332, in send_static_file superset_app | return send_from_directory( superset_app | File "/usr/local/lib/python3.8/site-packages/flask/helpers.py", line 700, in send_from_directory superset_app | return werkzeug.utils.send_from_directory( # type: ignore superset_app | File "/usr/local/lib/python3.8/site-packages/werkzeug/utils.py", line 847, in send_from_directory superset_app | raise NotFound() superset_app | 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.

Expected results

what you expected to happen. It should list database defined

Actual results

no databases listed what actually happens.

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

(please complete the following information):

  • browser type and version:
  • superset version: superset version
  • python version: python --version
  • node.js version: node -v
  • any feature flags active:

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • [ ] I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • [ ] I have reproduced the issue with at least the latest released version of superset.
  • [ ] I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

Add any other context about the problem here.

khanh78180 avatar Jun 08 '22 20:06 khanh78180

I have the same error. Every-single request raises that exception. Due to this exception I can't login, can't logout.

I have changed config.py and superset_config.py, and running my flask server at my local from docker-compose.yml/

image

UPDATE: I fixed my problem about login/logout. In config.py I wa set SESSION_COOKIE_SAMESITE to Lax, instead of None.

But, warnings from werkzeug I getting anyway.

Always-prog avatar Jul 15 '22 19:07 Always-prog

Hi,

Thank a lot I change the parameter SESSION_COOKIE_SAMESITE and it is OK now

khanh78180 avatar Jul 18 '22 13:07 khanh78180

i tried to change features SESSION_COOKIE_SAMESITE to Lax,but not work,it still cause error not found. GET /ws HTTP/1.1[/home/ryan/anaconda3/envs/superset/lib/python3.8/site-packages/werkzeug/routing.py>>>path_info:[/ws],>>>[None]]>>>[True]>>>[None]>>>[None] [/home/ryan/anaconda3/envs/superset/lib/python3.8/site-packages/werkzeug/routing.py>>>path:[|/ws]] 2022-07-22 09:28:35,152:WARNING:superset.views.base:HTTPException Traceback (most recent call last): File "/home/ryan/anaconda3/envs/superset/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request rv = self.dispatch_request() File "/home/ryan/anaconda3/envs/superset/lib/python3.8/site-packages/flask/app.py", line 1492, in dispatch_request self.raise_routing_exception(req) File "/home/ryan/anaconda3/envs/superset/lib/python3.8/site-packages/flask/app.py", line 1474, in raise_routing_exception raise request.routing_exception # type: ignore File "/home/ryan/anaconda3/envs/superset/lib/python3.8/site-packages/flask/ctx.py", line 376, in match_request result = self.url_adapter.match(return_rule=True) # type: ignore File "/home/ryan/anaconda3/envs/superset/lib/python3.8/site-packages/werkzeug/routing.py", line 2048, in match raise NotFound()

JunTech avatar Jul 22 '22 01:07 JunTech

SESSION_COOKIE_SAMESITE was set to "Lax" for me, setting it to None worked for me.

akzarma avatar Oct 05 '22 06:10 akzarma

Hi We are facing same issue, these are the steps that we followed

  1. Clone Superset's GitHub repository git clone https://github.com/apache/superset.git
  2. Updated config.py # Uncomment to setup Public role name, no authentication needed AUTH_ROLE_PUBLIC = 'Public'
  3. Docker compose (tried it with dev) DEV docker compose build docker-compose up -d

I have tried to set SESSION_COOKIE_SAMESITE=None but issue is same. Please let me know if I am missing something, any help would be appreciated. Thanks

sagar-appperfect avatar Nov 15 '22 11:11 sagar-appperfect

Having the same issue here, regardless of the value of SESSION_COOKIE_SAMESITE, "Lax" or None, I'm still facing the same issue.

eghazal-b-yond-full avatar Jan 06 '23 18:01 eghazal-b-yond-full

Facing same as mentioned by @eghazal-b-yond-full

falgunifb avatar Jan 23 '23 10:01 falgunifb

Having the same issue here, regardless of the value of SESSION_COOKIE_SAMESITE, "Lax" or None, I'm still facing the same issue.

I too

kokiers avatar Mar 06 '23 07:03 kokiers

Login works but get this error and I am logged out immediately. These are logs on superset. Anyone found the fix?

image

This is my superset_config.py image

apole avatar Mar 13 '23 17:03 apole

Login works but get this error and I am logged out immediately. These are logs on superset. Anyone found the fix?

Change the SESSION_COOKIE_HTTPONLY value in your superset_config.py file to True. SESSION_COOKIE_HTTPONLY = True

It'll solve the login issue. But the main issue will still remain same.

mdmatin4 avatar Jun 09 '23 17:06 mdmatin4

Any process here?

zhengcan avatar Jun 15 '23 13:06 zhengcan

it is the same issue "There was an error loading the tables"

hsravidatta avatar Jun 25 '23 15:06 hsravidatta

I encountered the same issue. I deployed Superset on a server using Docker Compose. Accessing localhost on the server interface works fine, but when I try to access it via the IP address, it keeps showing the login page and the browser continuously redirects. The server console shows a 404 error and the same errors as before. I haven't found a solution yet. Later, I tried it on my Mac, and the result was the same. If I try to access it via the IP address on another computer, it stays on the login page indefinitely.

xddpool avatar Jul 06 '23 18:07 xddpool

If I try to access it via the IP address on another computer, it stays on the login page indefinitely.

I am having the same issue.

dmitry-novoselov avatar Jul 10 '23 16:07 dmitry-novoselov

i'm facing same issue.

File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1770, in raise_routing_exception superset_app | raise request.routing_exception # type: ignore superset_app | File "/usr/local/lib/python3.9/site-packages/flask/ctx.py", line 351, in match_request superset_app | result = self.url_adapter.match(return_rule=True) # type: ignore superset_app | File "/usr/local/lib/python3.9/site-packages/werkzeug/routing/map.py", line 652, in match superset_app | raise NotFound() from None superset_app | 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.

also in browser console i got:

Refused to load the script '<URL>' because it violates the following Content Security Policy directive: "script-src 'self' 'strict-dynamic' 'nonce-ikm_zo32ANd93_gYSIMQvGbEeCkSoVmQ'". Note that 'strict-dynamic' is present, so host-based allowlisting is disabled. Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

why is this? can anyone knows the trick. this issue cost me a lot. please, any urgent solution.

texnder avatar Jul 11 '23 07:07 texnder

Any resolution yet?. I'm facing the same issue

sherlock30 avatar Jul 14 '23 06:07 sherlock30

Solved. This problem occurs due to static files not getting loaded while loading the dashboard. Missed due to cluttered documentation

cd ~/superset/superset-frontend/ npm install npm run build

sherlock30 avatar Jul 14 '23 08:07 sherlock30

hello,I'm having the same problem too.How did you handle it?

bui-theanh avatar Jul 15 '23 09:07 bui-theanh

apache/superset:2.1.0 This version of the image is fine. Latest image has some problem that causes this issue intermittently.

ramrajneogrowth avatar Aug 01 '23 10:08 ramrajneogrowth

Any solutions around this? I tried everything and I have same issue

andreiaionitoaie avatar Sep 06 '23 09:09 andreiaionitoaie

facing same issue

HTTPException Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1788, in dispatch_request self.raise_routing_exception(req) File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1770, in raise_routing_exception raise request.routing_exception # type: ignore File "/usr/local/lib/python3.9/site-packages/flask/ctx.py", line 351, in match_request result = self.url_adapter.match(return_rule=True) # type: ignore File "/usr/local/lib/python3.9/site-packages/werkzeug/routing/map.py", line 652, in match raise NotFound() from None 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.

Python 3.9.17 Flask 2.2.5 Werkzeug 2.3.3

Superset 3.0.0

Ingmarman avatar Sep 07 '23 00:09 Ingmarman

on mac m1:

faced the same exception which was giving me a bad rendering:

2023-09-29 11:26:34,361:WARNING:superset.views.base:HTTPException
superset_app           | Traceback (most recent call last):
superset_app           |   File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1823, in full_dispatch_request
superset_app           |     rv = self.dispatch_request()
superset_app           |   File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1788, in dispatch_request
superset_app           |     self.raise_routing_exception(req)
superset_app           |   File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1770, in raise_routing_exception
superset_app           |     raise request.routing_exception  # type: ignore
superset_app           |   File "/usr/local/lib/python3.9/site-packages/flask/ctx.py", line 351, in match_request
superset_app           |     result = self.url_adapter.match(return_rule=True)  # type: ignore
superset_app           |   File "/usr/local/lib/python3.9/site-packages/werkzeug/routing/map.py", line 652, in match
superset_app           |     raise NotFound() from None
superset_app           | 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.


I did the following and it worked for me:

git clone https://github.com/apache/superset
#installed node npm with versions v18.16.0/ 9.5.1 respectively.
cd superset/superset-frontend
npm install cross-env
npm install -f --no-optional --global webpack webpack-cli; 
npm run build
cd -
#create virtual env of 3.9 and activate
mamba create -n superset python=3.9 ; mamba activate superset; 
pip install -r requirements/testing.txt;
pip install -e .;
superset db upgrade;
superset fab create-admin;
superset init;
superset load-examples;
export SUPERSET_SECRET_KEY=D1acauGDSStiNuu2O1ZmK9E59QUPkRfB_some_key
export TALISMAN_ENABLED="False"
FLASK_ENV=development superset run -p 8088 --with-threads --reload --debugger

hope this helps.

jaihind213 avatar Sep 30 '23 01:09 jaihind213

I'm facing the same issue. I installed it through the official Scratch method.

vndroid avatar Oct 17 '23 08:10 vndroid

Any help please

cbrianbet avatar Oct 22 '23 15:10 cbrianbet

As @jaihind213 said, set env TALISMAN_ENABLED to FALSE works fine for me.

cloudcheflabs avatar Oct 27 '23 17:10 cloudcheflabs

export TALISMAN_ENABLED="False" SESSION_COOKIE_SAMESITE, Lax/None/Strict

doesn't work for me

jiayouchongmingniao avatar Dec 17 '23 08:12 jiayouchongmingniao

sudo docker compose -f docker-compose-non-dev.yml up

problem solved

jiayouchongmingniao avatar Dec 17 '23 14:12 jiayouchongmingniao

1702824892472

jiayouchongmingniao avatar Dec 17 '23 14:12 jiayouchongmingniao

For thouse who still strugling with not found endpoint for /ws, prese check your setup.

If you deleted nginx for running at :80 (as I did) you will get this error message, since websocket endpoint is running from the service superset_websocker. So in order to make it working (If you are using this with in docker-compose)

  1. you must have nginx (:80) serving both superset_app (:8088) and superset_websocket (:8080)
  2. I have also changed SESSION_COOKIE_HTTPONLY to None (but, I am not sure if this effects setup at all)

cheers.

butuzov avatar Feb 14 '24 15:02 butuzov

Having the same issue...

tmnvanderberg avatar Mar 27 '24 12:03 tmnvanderberg