Werkzeug >= 3.1.0 does not work

From: Peter <pmc(at)citylink(dot)dinoex(dot)sub(dot)org>
To: pgadmin-support(at)lists(dot)postgresql(dot)org
Subject: Werkzeug >= 3.1.0 does not work
Date: 2022-04-02 21:17:44
Message-ID: Yki9eG/CqBBtzlIH@gate.intra.daemon.contact
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Tried to install pgadmin4 6.7, did not work.

Issue #1: does not start, error is
AttributeError: module 'jinja2.ext' has no attribute 'autoescape'

This one is already known and discussed here:
https://github.com/sphinx-doc/sphinx/issues/10289
Reverting from Jinja 3.1.1 to 3.0.3 solves the issue.

Issue #2: Web connects are responded with "400 bad request".
The issue appears with Werkzeug 2.1.1 and 2.1.0. It is solved with
installing Werkzeug 2.0.3 or below.

This one is kerberos related; it does not seem to happen with no
kerberos login enabled.

I give You the backtrace:

pgadmin: 400 Bad Request: The browser (or proxy) sent a request
that this server could not understand. Traceback (most recent call
last):
File "/ext/py-virt/py38-pga64/lib/python3.8/site-packages/flask/wrappers.py",
line 128, in on_json_loading_failed
return super().on_json_loading_failed(e)
File "/ext/py-virt/py38-pga64/lib/python3.8/site-packages/werkzeug/wrappers/request.py",
line 611, in on_json_loading_failed
raise BadRequest( werkzeug.exceptions.BadRequest: 400 Bad
Request: Did not attempt to load JSON data because the
request Content-Type was not 'application/json'.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/ext/py-virt/py38-pga64/lib/python3.8/site-packages/flask/app.py",
line 1521, in full_dispatch_request
rv = self.preprocess_request()
File "/ext/py-virt/py38-pga64/lib/python3.8/site-packages/flask/app.py",
line 1861, in preprocess_request
rv = self.ensure_sync(before_func)()
File "/ext/py-virt/py38-pga64/lib/python3.8/site-packages/pgadmin4/pgadmin/__init__.py",
line 792, in before_request
return authenticate.login()
File "/ext/py-virt/py38-pga64/lib/python3.8/site-packages/pgadmin4/pgadmin/authenticate/__init__.py",
line 120, in login
status, msg = auth_obj.authenticate()
File "/ext/py-virt/py38-pga64/lib/python3.8/site-packages/pgadmin4/pgadmin/authenticate/__init__.py",
line 231, in authenticate
status, msg = source.authenticate(self.form)
File "/ext/py-virt/py38-pga64/lib/python3.8/site-packages/pgadmin4/pgadmin/authenticate/kerberos.py",
line 182, in authenticate
if request.json:
File "/ext/py-virt/py38-pga64/lib/python3.8/site-packages/werkzeug/wrappers/request.py",
line 540, in json
return self.get_json()
File "/ext/py-virt/py38-pga64/lib/python3.8/site-packages/werkzeug/wrappers/request.py",
line 571, in get_json
return self.on_json_loading_failed(None)
File "/ext/py-virt/py38-pga64/lib/python3.8/site-packages/flask/wrappers.py",
line 133, in on_json_loading_failed
raise BadRequest() from e werkzeug.exceptions.BadRequest: 400
Bad Request: The browser (or proxy) sent a request that
this server could not understand.

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Akshay Joshi 2022-04-03 06:55:47 Re: Werkzeug >= 3.1.0 does not work
Previous Message Henrique Becker 2022-04-01 17:13:55 Error with ssh on Windows 11