Closed constantin-baciu closed 1 year ago
@constantin-baciu Looks like your SQLite pgAdmin config DB is corrupted. You can try to connect to the pgAdmin config DB and remove the columns - passexec_cmd, passexec_expiration
from server
table.
If nothing works, rename the old config DB file and restart pgAdmin.
@adityatoshniwal If the database is corrupted, how come it works on v6.14? The problem is that we have some configurations in there (this is a multi-user, SSO enabled environment). I'd hate for something to happen and lose all of those.
@constantin-baciu Your Config DB has columns which are not supposed to be there for your pgAdmin version. We're not sure how they were added. Now to make the upgrade go through, those column has to be removed to allow pgAdmin to add them back.
I can't find those tables:
[root@*** docker]# sqlite3 pgadmin4.db
SQLite version 3.7.17 2013-05-20 00:56:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .tables
alembic_version roles_users
database server
debugger_function_arguments servergroup
keys setting
macros sharedserver
module_preference user
preference_category user_macros
preferences user_mfa
process user_preferences
query_history version
role
sqlite>
@constantin-baciu passexec_cmd, passexec_expiration
are columns in server
table.
Thanks @adityatoshniwal . That seems to make it work. But, we're running into other issues now. All our logins are SSO (Azure AD OAuth2). After the upgrade to 6.20, nobody can login. And, this is what I'm seeing in the logs:
2023-03-20 12:51:30,925: ERROR pgadmin: Missing "jwks_uri" in metadata
Traceback (most recent call last):
File "/venv/lib/python3.10/site-packages/flask/app.py", line 1517, in full_dispatch_request
rv = self.dispatch_request()
File "/venv/lib/python3.10/site-packages/flask/app.py", line 1503, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/pgadmin4/pgadmin/authenticate/oauth2.py", line 55, in oauth_authorize
status, msg = auth_obj.login()
File "/pgadmin4/pgadmin/authenticate/__init__.py", line 274, in login
status, msg = self.source.login(self.form)
File "/pgadmin4/pgadmin/authenticate/oauth2.py", line 123, in login
profile = self.get_user_profile()
File "/pgadmin4/pgadmin/authenticate/oauth2.py", line 165, in get_user_profile
self.oauth2_current_client].authorize_access_token()
File "/venv/lib/python3.10/site-packages/authlib/integrations/flask_client/apps.py", line 108, in authorize_access_token
userinfo = self.parse_id_token(token, nonce=state_data['nonce'], claims_options=claims_options)
File "/venv/lib/python3.10/site-packages/authlib/integrations/base_client/sync_openid.py", line 66, in parse_id_token
claims = _jwt.decode(
File "/venv/lib/python3.10/site-packages/authlib/jose/rfc7519/jwt.py", line 96, in decode
data = self._jws.deserialize_compact(s, load_key, decode_payload)
File "/venv/lib/python3.10/site-packages/authlib/jose/rfc7515/jws.py", line 101, in deserialize_compact
algorithm, key = self._prepare_algorithm_key(jws_header, payload, key)
File "/venv/lib/python3.10/site-packages/authlib/jose/rfc7515/jws.py", line 254, in _prepare_algorithm_key
key = key(header, payload)
File "/venv/lib/python3.10/site-packages/authlib/integrations/base_client/sync_openid.py", line 38, in load_key
jwk_set = JsonWebKey.import_key_set(self.fetch_jwk_set())
File "/venv/lib/python3.10/site-packages/authlib/integrations/base_client/sync_openid.py", line 14, in fetch_jwk_set
raise RuntimeError('Missing "jwks_uri" in metadata')
@constantin-baciu This looks like - https://github.com/pgadmin-org/pgadmin4/issues/5666.
Please note that security bugs or issues should be reported to security@pgadmin.org.
Describe the bug
Currently running a docker PgAdmin 6.14 instance with a SQLite database. Trying to upgrade to 6.15 or anything beyond that results in errors and PgAdmin does not start.
On top of that, it seems that PgAdmin is asking for some configuration changes in the background, only visible if you browse the logs:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The specified version of PgAdmin should be running
Error message
Please see above.
Screenshots
N/A
Desktop (please complete the following information): OS is Linux (AmazonLinux).
Additional context
N/A