Skip to content

ImportError: cannot import name 'url_quote' from 'werkzeug.urls' #41

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
Roomba5 opened this issue Jan 27, 2024 · 1 comment
Open

ImportError: cannot import name 'url_quote' from 'werkzeug.urls' #41

Roomba5 opened this issue Jan 27, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Roomba5
Copy link

Roomba5 commented Jan 27, 2024

Issue with getting peers added to the wireguard server config

When adding new devices through Openwisp the configs get pushed to the devices properly; however the wireguard server does not get updated with the new peers.

When trying to run the python updater script from the venv directly I am seeing the following errors. These are also populating in the logs file (I'm guessing when the cron runs?).

File "/etc/wireguard-openwisp/env/lib/python3.10/site-packages/flask/__init__.py", line 7, in <module>
    from .app import Flask as Flask
  File "/etc/wireguard-openwisp/env/lib/python3.10/site-packages/flask/app.py", line 28, in <module>
    from . import cli
  File "/etc/wireguard-openwisp/env/lib/python3.10/site-packages/flask/cli.py", line 18, in <module>
    from .helpers import get_debug_flag
  File "/etc/wireguard-openwisp/env/lib/python3.10/site-packages/flask/helpers.py", line 16, in <module>
    from werkzeug.urls import url_quote
ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/etc/wireguard-openwisp/env/lib/python3.10/site-packages/werkzeug/urls.py)
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 72, in apport_excepthook

Potential Solution

It looks like the python dependency werkzeug from version 3.0 onwards removed some depreciated commands that are being called for the Flask portion of this project. Pinning werkzeug<3.0 should fix the issue.

@nemesifier
Copy link
Member

This was done: 89cc92f. But we should upgrade the code to the latest version of werkzeug and update the dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: To do (general)
Development

No branches or pull requests

2 participants