Thread: Werkzeug >= 3.1.0 does not work

Werkzeug >= 3.1.0 does not work

From
Peter
Date:
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. 



Re: Werkzeug >= 3.1.0 does not work

From
Akshay Joshi
Date:
Hi Peter

We have already fixed the "AttributeError: module 'jinja2.ext' has no attribute 'autoescape'" issue and pin the Werkzeug to 2.0.3
Fixes will be available in the next release of pgAdmin 4 v6.8 on coming Thursday.

On Sun, Apr 3, 2022 at 3:24 AM Peter <pmc@citylink.dinoex.sub.org> wrote:
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.




--
Thanks & Regards
Akshay Joshi
pgAdmin Hacker | Principal Software Architect
EDB Postgres
Mobile: +91 976-788-8246