<p>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:</p>
<pre><code>    [2022-01-21 14:35:21 +0000] [93] [ERROR] Error handling request /authenticate/login
Traceback (most recent call last):
  File &quot;/venv/lib/python3.8/site-packages/gunicorn/workers/gthread.py&quot;, line 271, in handle
    keepalive = self.handle_request(req, conn)
  File &quot;/venv/lib/python3.8/site-packages/gunicorn/workers/gthread.py&quot;, line 323, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File &quot;/venv/lib/python3.8/site-packages/flask/app.py&quot;, line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File &quot;/pgadmin4/pgAdmin4.py&quot;, line 77, in __call__
    return self.app(environ, start_response)
  File &quot;/venv/lib/python3.8/site-packages/werkzeug/middleware/proxy_fix.py&quot;, line 169, in __call__
    return self.app(environ, start_response)
  File &quot;/venv/lib/python3.8/site-packages/flask_socketio/__init__.py&quot;, line 43, in __call__
    return super(_SocketIOMiddleware, self).__call__(environ,
  File &quot;/venv/lib/python3.8/site-packages/engineio/middleware.py&quot;, line 74, in __call__
    return self.wsgi_app(environ, start_response)
  File &quot;/venv/lib/python3.8/site-packages/flask/app.py&quot;, line 2450, in wsgi_app
    response = self.handle_exception(e)
  File &quot;/venv/lib/python3.8/site-packages/flask/app.py&quot;, line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File &quot;/venv/lib/python3.8/site-packages/flask/_compat.py&quot;, line 39, in reraise
    raise value
  File &quot;/venv/lib/python3.8/site-packages/flask/app.py&quot;, line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File &quot;/venv/lib/python3.8/site-packages/flask/app.py&quot;, line 1953, in full_dispatch_request
    return self.finalize_request(rv)
  File &quot;/venv/lib/python3.8/site-packages/flask/app.py&quot;, line 1970, in finalize_request
    response = self.process_response(response)
  File &quot;/venv/lib/python3.8/site-packages/flask/app.py&quot;, line 2269, in process_response
    self.session_interface.save_session(self, ctx.session, response)
  File &quot;/pgadmin4/pgadmin/utils/session.py&quot;, line 307, in save_session
    self.manager.put(session)
  File &quot;/pgadmin4/pgadmin/utils/session.py&quot;, line 166, in put
    self.parent.put(session)
  File &quot;/pgadmin4/pgadmin/utils/session.py&quot;, line 270, in put
    dump(
_pickle.PicklingError: Can't pickle &lt;class 'wtforms.form.Meta'&gt;: attribute lookup Meta on wtforms.form failed
</code></pre>
<p>The issue appeared after enabling Oauth2 authentication. I've tried using different version but no luck.</p>
<p>Pgadmin is running in Kubernetes.</p>

Vladimir Tarasov
<p>Please try setting
PGADMIN_CONFIG_ENHANCED_COOKIE_PROTECTION = False in configuration file according to your operating system as mentioned <a href="https://www.pgadmin.org/docs/pgadmin4/6.13/config_py.html" rel="nofollow noreferrer">here</a>.</p>
