Skip to content

Internal Server Error #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
andreaordonselli opened this issue May 16, 2025 · 3 comments
Open

Internal Server Error #34

andreaordonselli opened this issue May 16, 2025 · 3 comments

Comments

@andreaordonselli
Copy link

In this issue (qgis/qwc2#427), I explained an error caused by incorrect paths configured in the httpd_qwc-services.conf file from the OSGeo4W installation on Windows, and I reported this to OSGeo with this ticket (https://trac.osgeo.org/osgeo4w/ticket/880#ticket).

However, now when I call localhost:8001/qwc2, I still cannot access the graphical interface and receive an Internal Server Error. Can you help me figure out how to resolve this? Which logs should I check to understand what is happening?

Thank you.

@tpo
Copy link
Member

tpo commented May 16, 2025

I suggest this procedure:

  • first you empty all logs (fcgi, apache)
  • then you start all the daemons/services
  • then you look at all the logs and verfify that they do not contain any errors or warnings that seem to be relevant

When you do not see any problem there, then:

  • you run tail on all logs
  • after that you access localhost:8001/qwc2
  • then you have a look at the new log entries

@andreaordonselli
Copy link
Author

Using your system, I understood that the error comes from C:\Program Files\QGIS 3.42.0\apps\apache\logs\qgisserver-error.log

[Mon May 19 18:51:12.066270 2025] [wsgi:error] [pid 14452:tid 1276] [client 127.0.0.1:53887] mod_wsgi (pid=14452): Exception occurred processing WSGI script 'C:/Program Files/QGIS 3.42.0/apps/qwc-services/qwc-map-viewer/src/server.wsgi'.
[Mon May 19 18:51:12.067748 2025] [wsgi:error] [pid 14452:tid 1276] [client 127.0.0.1:53887] Traceback (most recent call last):\r
[Mon May 19 18:51:12.067748 2025] [wsgi:error] [pid 14452:tid 1276] [client 127.0.0.1:53887]   File "C:/Program Files/QGIS 3.42.0/apps/qwc-services/qwc-map-viewer/src/server.wsgi", line 9, in application\r
[Mon May 19 18:51:12.067748 2025] [wsgi:error] [pid 14452:tid 1276] [client 127.0.0.1:53887]     from server import app\r
[Mon May 19 18:51:12.067748 2025] [wsgi:error] [pid 14452:tid 1276] [client 127.0.0.1:53887]   File "C:\\Program Files\\QGIS 3.42.0\\apps\\qwc-services\\qwc-map-viewer\\src\\server.py", line 6, in <module>\r
[Mon May 19 18:51:12.067748 2025] [wsgi:error] [pid 14452:tid 1276] [client 127.0.0.1:53887]     from flask import json, Flask, request, jsonify, redirect\r
[Mon May 19 18:51:12.067748 2025] [wsgi:error] [pid 14452:tid 1276] [client 127.0.0.1:53887]   File "C:\\PROGRA~1\\QGIS34~2.0\\apps\\qwc-services\\venv\\Lib\\site-packages\\flask\\__init__.py", line 7, in <module>\r
[Mon May 19 18:51:12.067748 2025] [wsgi:error] [pid 14452:tid 1276] [client 127.0.0.1:53887]     from .app import Flask as Flask\r
[Mon May 19 18:51:12.067748 2025] [wsgi:error] [pid 14452:tid 1276] [client 127.0.0.1:53887]   File "C:\\PROGRA~1\\QGIS34~2.0\\apps\\qwc-services\\venv\\Lib\\site-packages\\flask\\app.py", line 28, in <module>\r
[Mon May 19 18:51:12.067748 2025] [wsgi:error] [pid 14452:tid 1276] [client 127.0.0.1:53887]     from . import cli\r
[Mon May 19 18:51:12.067748 2025] [wsgi:error] [pid 14452:tid 1276] [client 127.0.0.1:53887]   File "C:\\PROGRA~1\\QGIS34~2.0\\apps\\qwc-services\\venv\\Lib\\site-packages\\flask\\cli.py", line 18, in <module>\r
[Mon May 19 18:51:12.067748 2025] [wsgi:error] [pid 14452:tid 1276] [client 127.0.0.1:53887]     from .helpers import get_debug_flag\r
[Mon May 19 18:51:12.067748 2025] [wsgi:error] [pid 14452:tid 1276] [client 127.0.0.1:53887]   File "C:\\PROGRA~1\\QGIS34~2.0\\apps\\qwc-services\\venv\\Lib\\site-packages\\flask\\helpers.py", line 16, in <module>\r
[Mon May 19 18:51:12.067748 2025] [wsgi:error] [pid 14452:tid 1276] [client 127.0.0.1:53887]     from werkzeug.urls import url_quote\r
[Mon May 19 18:51:12.067748 2025] [wsgi:error] [pid 14452:tid 1276] [client 127.0.0.1:53887] ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (C:\\PROGRA~1\\QGIS34~2.0\\apps\\qwc-services\\venv\\Lib\\site-packages\\werkzeug\\urls.py)\r

Can you tell me how to overcome the error but, above all, how to read it so that next time I’ll be more capable? I’d also like to understand how the component cycle works, how they are triggered in sequence, and who does what. Sorry, I know I’m asking a lot, but I’m a very precise and curious user, which is why I’m embarking on this adventure with qwc.
Thank you.

@manisandro
Copy link
Member

It looks like the werkzeug version in your venv is too old. Make sure you are using werkzeug>=3.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants