pgadmin-org / pgadmin4

pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world.
https://www.pgadmin.org
Other
2.53k stars 658 forks source link

Saved Passwords on Shared Servers Broken for Non-Admins (RM #6680) #4502

Closed dpage closed 2 years ago

dpage commented 3 years ago

Issue migrated from Redmine: https://redmine.postgresql.org/issues/6680 Originally created by Jawala Birdi at 2021-08-12 18:43:19 UTC.

Clean install. Add a shared server as admin. Login as an unprivileged user, set server Username under Properties > Connection. Try to connect - works.

Disconnect Server (or logout) then (re)Connect Server, and encounter error :

not enough values to unpack (expected 3, got 2)

/var/log/pgadmin/pgadmin4.log says :

2021-08-12 18:29:47,801: ERROR  pgadmin:        'utf-8' codec can't decode byte 0xea in position 2: invalid continuation byte
Traceback (most recent call last):
  File "/usr/pgadmin4/web/pgadmin/utils/driver/psycopg2/connection.py", line 245, in _decode_password
    password = password.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xea in position 2: invalid continuation byte
2021-08-12 18:29:47,801: ERROR  pgadmin:        not enough values to unpack (expected 3, got 2)
Traceback (most recent call last):
  File "/usr/pgadmin4/web/pgadmin/browser/server_groups/servers/__init__.py", line 1404, in connect
    server_types=ServerType.types()
  File "/usr/pgadmin4/web/pgadmin/utils/driver/psycopg2/connection.py", line 298, in connect
    password, crypt_key)
ValueError: not enough values to unpack (expected 3, got 2)
Version
5.6

Application Mode
Server

Browser
Firefox 90.0

Operating System
Linux-4.19.0-9-amd64-x86_64-with-debian-10.10

NOTE that fetching saved passwords seem to work fine for the admin user (can disconnect, reconnect no problem).

dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6680#note-1 Originally created by Pradip Parkale at 2021-08-17 04:15:04 UTC.

I tried this and I was not able to reproduce this.

dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6680#note-2 Originally created by Akshay Joshi at 2021-08-17 11:35:25 UTC.

Redmine ticket header update:

Name Old Value New Value
Assigned To changed Jawala Birdi
dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6680#note-3 Originally created by Khushboo Vashi at 2021-08-20 11:37:24 UTC.

Hi,

Have you changed any config parameters into config_system.py file?

dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6680#note-4 Originally created by Jawala Birdi at 2021-08-20 13:04:42 UTC.

I have no "config_system.py", so no, probably not.

# find /usr/pgadmin4/web/ -iname '*config*py'
    /usr/pgadmin4/web/config.py
    /usr/pgadmin4/web/config_local.py
    /usr/pgadmin4/web/config_distro.py
# find / -iname 'config_system.py'
#

File "config_local.py" only sets : MAIL_SERVER, MAIL_PORT, SECURITY_EMAIL_SENDER.

Are you trying to reproduce the issue on Debian 10 ?

What's your SSH pubkey(s) ? I'll set you up with access to a demo environment that exhibits the issue. Will take a bit to setup though.

dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6680#note-5 Originally created by Pradip Parkale at 2021-09-03 11:13:33 UTC.

That would be very helpful,

Thanks

dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6680#note-6 Originally created by Akshay Joshi at 2021-09-29 08:42:11 UTC.

No response from the author, hence rejecting it.

Redmine ticket header update:

Name Old Value New Value
Status changed New Rejected
dpage commented 2 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6680#note-7 Originally created by Riccardo Mantini at 2022-06-07 09:08:08 UTC.

I have the same issue described here, I'm using official docker image version 6.10, and I have changed config_local.py file to configure oauth2 authentication with Azure AD. Can please someone help us?

Thanks

dpage commented 2 years ago

Issue closed on Redmine.