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.43k stars 638 forks source link

Login to v5.4 impossible on Debian (RM #6560) #4409

Closed dpage closed 2 years ago

dpage commented 3 years ago

Issue migrated from Redmine: https://redmine.postgresql.org/issues/6560 Originally created by Jürgen Freitag at 2021-06-24 13:33:51 UTC.

Hello,

login to pgadmin4-web 5.4, installed on Debian 10 via repository, is impossible. Entering the correct username and password results in "Incorrect username or password."

Seems not to matter if 5.4 is newly installed or upgraded from 5.3.

Steps to reproduce:

Clean out everything:

apt -y purge apache pgadmin rm -r /var/lib/pgadmin /usr/pgadmin4/ /etc/apache2

What is available?

apt policy pgadmin4-web pgadmin4-web: Installed: (none) Candidate: 5.4 Version table: 5.4 500 500 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/buster pgadmin4/main all Packages 5.3 500 500 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/buster pgadmin4/main all Packages 5.2 500 500 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/buster pgadmin4/main all Packages 5.1 500 500 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/buster pgadmin4/main all Packages 5.0 500 500 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/buster pgadmin4/main all Packages 4.30 500 500 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/buster pgadmin4/main all Packages

Install pgadmin4-web

apt -y install pgadmin4-web

Configuration

/usr/pgadmin4/bin/setup-web.sh --yes

Setting up pgAdmin 4 in web mode on a Debian based platform... Running in non-interactive mode... Creating configuration database... NOTE: Configuring authentication for SERVER mode.

Enter the email address and password to use for the initial pgAdmin user account:

Email address: postgres@localhost Password: Retype password: pgAdmin 4 - Application Initialisation

Creating storage and log directories... Apache successfully restarted. You can now start using pgAdmin 4 in web mode at http://127.0.0.1/pgadmin4

Now trying to log in at http://localhost/pgadmin4 yields "Incorrect username or password." After downgrade to 5.3

apt -y --allow-downgrades install pgadmin4-web=5.3 pgadmin4-server=5.3 systemctl restart apache2.service

the logins are successful. Upgrading again to 5.4

apt install pgadmin4-web systemctl restart apache2.service

brings back "Incorrect username or password."

Is there any more information I could provide to resolve that issue?

Best regards,

Jürgen

dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6560#note-1 Originally created by Khushboo Vashi at 2021-06-25 05:08:32 UTC.

Hi,

As a work around please try with valid email address, like "user@localhost.com". Your email address is postgres@localhost which is causing the issue here.

Thanks, Khushboo

Redmine ticket header update:

Name Old Value New Value
Assigned To changed Jürgen Freitag
dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6560#note-2 Originally created by Khushboo Vashi at 2021-06-25 05:45:30 UTC.

This issue is reproducible in the server mode with an invalid/undeliverable email address.

Redmine ticket header update:

Name Old Value New Value
Sprint changed EDB Sprint 94
dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6560#note-3 Originally created by Dave Page at 2021-06-25 08:41:55 UTC.

Redmine ticket header update:

Name Old Value New Value
Relationship (relates) changed RM #6550
dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6560#note-4 Originally created by Aditya Toshniwal at 2021-06-25 10:24:37 UTC.

To the developer, Need to add - SECURITY_EMAIL_VALIDATOR_ARGS={"check_deliverability": False} and also use email validator used by Flask-Security-Too.

dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6560#note-5 Originally created by Martin Pernecky at 2021-06-25 10:55:08 UTC.

Confirmed in docker container "dpage/pgadmin4:5.4". If the PGADMIN_DEFAULT_EMAIL domain does not have an MX record, this user is disabled. Without any mention in the logs

dpage commented 3 years ago

Attachment migrated from Redmine: https://redmine.postgresql.org/attachments/download/5928 Originally created by Khushboo Vashi at 2021-06-28 08:57:20 UTC.

https://pgadmin-archive.postgresql.org/redmine/6560/5928-RM_6560.patch

dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6560#note-7 Originally created by Khushboo Vashi at 2021-06-28 08:57:31 UTC.

WIP patch attached. Test-cases are pending.

Redmine ticket header update:

Name Old Value New Value
Attachment added RM_6560.patch
dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6560#note-8 Originally created by Rahul Shirsat at 2021-06-28 11:44:39 UTC.

Redmine ticket header update:

Name Old Value New Value
Assigned To changed Jürgen Freitag Rahul Shirsat
dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6560#note-9 Originally created by Rahul Shirsat at 2021-06-28 11:59:33 UTC.

Redmine ticket header update:

Name Old Value New Value
Status changed New In Progress
dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6560#note-10 Originally created by Gevik Babakhani at 2021-06-28 23:24:20 UTC.

I have the same issue within the docker container after upgrading. Version 5.3 works. I use postgres@local.dev as username.

dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6560#note-11 Originally created by Khushboo Vashi at 2021-06-29 05:00:04 UTC.

Gevik Babakhani wrote:

I have the same issue within the docker container after upgrading. Version 5.3 works. I use postgres@local.dev as username.

See the work around here, https://redmine.postgresql.org/issues/6550#note-27

dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6560#note-12 Originally created by Gevik Babakhani at 2021-06-29 06:23:29 UTC.

Any idea how to set this value PGADMIN_CONFIG_SECURITY_EMAIL_VALIDATOR_ARGS in docker-compose?

dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6560#note-13 Originally created by Paul Maxfield at 2021-06-29 13:25:48 UTC.

I'm running an AKS deployment that was working fine under 5.3, now with 5.4 I'm getting "Incorrect username or password." as described above.

My user name is "paul.dmax@outlook.com" when I try to retrieve the password I'm getting an invalid e-mail. I've shell'd into the container and checked the variables they are what I would expect

PGADMIN_DEFAULT_PASSWORD= PGADMIN_DEFAULT_EMAIL=paul.dmax@sqlhorizons.com

I've had to set my image: docker.io/dpage/pgadmin4:5.3 to gat this working again.

So it is definitely something to do with your 5.4 release.

dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6560#note-14 Originally created by Paul Maxfield at 2021-06-29 13:27:35 UTC.

Paul Maxfield wrote:

I'm running an AKS deployment that was working fine under 5.3, now with 5.4 I'm getting "Incorrect username or password." as described above.

My user name is "paul.dmax@sqlhorizons.com" when I try to retrieve the password I'm getting an invalid e-mail. I've shell'd into the container and checked the variables they are what I would expect

PGADMIN_DEFAULT_PASSWORD= PGADMIN_DEFAULT_EMAIL=paul.dmax@sqlhorizons.com

I've had to set my image: docker.io/dpage/pgadmin4:5.3 to gat this working again.

So it is definitely something to do with your 5.4 release.

dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6560#note-15 Originally created by Dave Page at 2021-06-30 09:39:01 UTC.

Duplicate of #6550

Redmine ticket header update:

Name Old Value New Value
Priority changed High Normal
Assigned To changed Rahul Shirsat
Status changed In Progress Rejected
dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6560#note-16 Originally created by Dave Page at 2021-06-30 09:39:21 UTC.

Redmine ticket header update:

Name Old Value New Value
Relationship (duplicates) changed RM #6550
dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/6560#note-17 Originally created by Dave Page at 2021-06-30 09:39:27 UTC.

Redmine ticket header update:

Name Old Value New Value
Relationship (relates) changed RM #6550
dpage commented 2 years ago

Issue closed on Redmine.