4

Occasionally, Pgadmin gives me the 500 error in a browser. After reloading the page, the issue disappears for a while and then comes back again. Here's the log I see while getting the error:

    [2022-01-21 14:35:21 +0000] [93] [ERROR] Error handling request /authenticate/login
Traceback (most recent call last):
  File "/venv/lib/python3.8/site-packages/gunicorn/workers/gthread.py", line 271, in handle
    keepalive = self.handle_request(req, conn)
  File "/venv/lib/python3.8/site-packages/gunicorn/workers/gthread.py", line 323, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/venv/lib/python3.8/site-packages/flask/app.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "/pgadmin4/pgAdmin4.py", line 77, in __call__
    return self.app(environ, start_response)
  File "/venv/lib/python3.8/site-packages/werkzeug/middleware/proxy_fix.py", line 169, in __call__
    return self.app(environ, start_response)
  File "/venv/lib/python3.8/site-packages/flask_socketio/__init__.py", line 43, in __call__
    return super(_SocketIOMiddleware, self).__call__(environ,
  File "/venv/lib/python3.8/site-packages/engineio/middleware.py", line 74, in __call__
    return self.wsgi_app(environ, start_response)
  File "/venv/lib/python3.8/site-packages/flask/app.py", line 2450, in wsgi_app
    response = self.handle_exception(e)
  File "/venv/lib/python3.8/site-packages/flask/app.py", line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/venv/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/venv/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/venv/lib/python3.8/site-packages/flask/app.py", line 1953, in full_dispatch_request
    return self.finalize_request(rv)
  File "/venv/lib/python3.8/site-packages/flask/app.py", line 1970, in finalize_request
    response = self.process_response(response)
  File "/venv/lib/python3.8/site-packages/flask/app.py", line 2269, in process_response
    self.session_interface.save_session(self, ctx.session, response)
  File "/pgadmin4/pgadmin/utils/session.py", line 307, in save_session
    self.manager.put(session)
  File "/pgadmin4/pgadmin/utils/session.py", line 166, in put
    self.parent.put(session)
  File "/pgadmin4/pgadmin/utils/session.py", line 270, in put
    dump(
_pickle.PicklingError: Can't pickle <class 'wtforms.form.Meta'>: attribute lookup Meta on wtforms.form failed

The issue appeared after enabling Oauth2 authentication. I've tried using different version but no luck.

Pgadmin is running in Kubernetes.

Ricla
  • 105
  • 1
  • 9
  • 2
    We're seeing the exact same behavior. Also running with oauth2 and in k8s. – John Mar 03 '22 at 16:53
  • i also had this error after enabling oauth. but the problem was persistent, because the domain i configured for pg-keycloak-client was an external url (keycloak.mydomain) and the url i used in the config.py of pgadmin was kubernetes internal (keycloak-service.mynamespace.svc.cluster.local), which does not match. i have added my private dns server to kubernetes coredns and used consistent keycloak.mydomain for both. this fixed the problem. in your case, maybe dns is not working properly or you have multiple coredns instances... did you try to rollout restart your deployments? regards – rome Mar 20 '22 at 18:06
  • I'm experiencing the same behaviour occasionally. Any advice how to solve the issue? – Ricla May 13 '22 at 13:51

1 Answers1

1

Please try setting PGADMIN_CONFIG_ENHANCED_COOKIE_PROTECTION = False in configuration file according to your operating system as mentioned here.

  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 24 '22 at 18:08