dosubot[bot] commented on issue #20319:
URL: https://github.com/apache/superset/issues/20319#issuecomment-2168309989
<!-- Greeting -->
Hey @rusackas! 👋 I'm here to help you out while you wait for a human
maintainer. I can assist with bug fixes, answer questions, and guide you on
becoming a contributor. Let's tackle this together!
<!-- Answer -->
To resolve the persistent `werkzeug.exceptions.NotFound: 404 Not Found`
error in your Superset setup, which affects listing databases and login/logout
functionality, you can try the following steps:
1. **Check Route Definitions and Methods**:
Ensure that the routes for listing databases and login/logout are
correctly defined and accessible. For example, the `DatabaseRestApi` class
should have the necessary routes exposed.
2. **Verify Permissions**:
Ensure that the necessary permissions are set for accessing these routes.
The `protect()` decorator is used to enforce security.
3. **Static File Serving**:
Ensure that static files are correctly served. This involves setting the
correct paths and URLs in your configuration files. For example:
```python
UPLOAD_FOLDER = BASE_DIR + "/app/static/uploads/"
IMG_UPLOAD_FOLDER = BASE_DIR + "/app/static/uploads/"
IMG_UPLOAD_URL = "/static/uploads/"
```
4. **Nginx Configuration**:
If you are using Nginx as a reverse proxy, ensure that it is correctly
configured to serve static files and handle WebSocket connections. Here is an
example configuration snippet:
```conf
server {
listen 80 default_server;
server_name _;
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 $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
port_in_redirect off;
proxy_connect_timeout 300;
}
}
```
5. **Frontend Setup**:
Ensure that the frontend is correctly built and served. You can do this
by running the following commands:
```sh
cd superset/superset-frontend
npm install
npm run build
```
6. **Environment Variables**:
Set the `TALISMAN_ENABLED` environment variable to `False`:
```sh
export TALISMAN_ENABLED="False"
```
7. **Docker Configuration**:
If you are using Docker, try using the non-dev Docker Compose
configuration:
```sh
docker-compose -f docker-compose-non-dev.yml up
```
These steps should help resolve the `404 Not Found` error and ensure that
your Superset setup functions correctly
<sup>[[1]](https://github.com/apache/superset/blob/master/superset/databases/api.py)</sup><sup>[[2]](https://github.com/apache/superset/blob/master/superset/config.py)</sup><sup>[[3]](https://github.com/apache/superset/blob/master/docker/nginx/nginx.conf)</sup><sup>[[4]](https://github.com/apache/superset/issues/17076)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
--
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]