FS#70855 - [pgadmin4] should depend python-email-validator

Attached to Project: Community Packages
Opened by Daniel Hahler (blueyed) - Friday, 14 May 2021, 12:23 GMT
Last edited by Jelle van der Waa (jelly) - Sunday, 03 October 2021, 15:59 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Levente Polyak (anthraxx)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 4
Private No

Details

Description:

Without python-email-validator `pgadmin4` fails to start:

> "An error occurred initialising the pgAdmin 4 server:\n\nFailed to launch the application server, server thread exiting."

Using `pgadmin4-server` directly shows:

```
% pgadmin4-server
Traceback (most recent call last):
File "/usr/lib/pgadmin4/web/pgAdmin4.py", line 35, in <module>
import config
File "/usr/lib/pgadmin4/web/config.py", line 25, in <module>
from pgadmin.utils import env, IS_WIN, fs_short_path
File "/usr/lib/pgadmin4/web/pgadmin/__init__.py", line 28, in <module>
from flask_security import Security, SQLAlchemyUserDatastore, current_user
File "/usr/lib/python3.9/site-packages/flask_security/__init__.py", line 16, in <module>
from .core import Security, RoleMixin, UserMixin, AnonymousUser, current_user
File "/usr/lib/python3.9/site-packages/flask_security/core.py", line 33, in <module>
from .forms import (
File "/usr/lib/python3.9/site-packages/flask_security/forms.py", line 114, in <module>
email_validator = Email(message="INVALID_EMAIL_ADDRESS")
File "/usr/lib/python3.9/site-packages/flask_security/forms.py", line 82, in __init__
super(ValidatorMixin, self).__init__(*args, **kwargs)
File "/usr/lib/python3.9/site-packages/wtforms/validators.py", line 332, in __init__
raise Exception("Install 'email_validator' for email validation support.")
Exception: Install 'email_validator' for email validation support.
```

Installing `python-email-validator` fixes this, but for some yet unknown reason the server still fails to come up for me.
(this used to work before, and might actually be a problem with a dependency of `pgadmin4` instead, since the current version was installed at the beginning of February here already (and worked before).

Note that pgadmin4 is flagged out of date, and upgrading it might also change/fix this already maybe.

Additional info:
* pgadmin4 4.30-1

Steps to reproduce:
This task depends upon

Closed by  Jelle van der Waa (jelly)
Sunday, 03 October 2021, 15:59 GMT
Reason for closing:  Fixed
Additional comments about closing:  python-flask-security-too now depends on python-email-validator.
Comment by Zesen Qian (riaqn) - Saturday, 15 May 2021, 11:17 GMT
Even after python-email-validator is installed, running `pgadmin4-server` still yields:

ERROR : Failed to create the directory /var/lib/pgadmin:
[Errno 13] Permission denied: '/var/lib/pgadmin'
HINT : Create the directory /var/lib/pgadmin, ensure it is writeable by
'riaqn', and try again, or, create a config_local.py file
and override the SQLITE_PATH setting per
https://www.pgadmin.org/docs/pgadmin4/4.30/config_py.html
Comment by Daniel Hahler (blueyed) - Sunday, 16 May 2021, 14:08 GMT
`pgadmin4-server` might not be meant to be used directly.
Does using `pgadmin4` work for you then?
(also: have you used the package previously?)
(for me the DB is in `/home/user/.pgadmin/pgadmin4.db` apparently)
Comment by Peter Hardman (shetland_breeder) - Sunday, 16 May 2021, 14:43 GMT
I also have this bug. The suggestions in the link above don't make any difference for me. Until the maintainer updates this package I've switched to using DBeaver which does everything I need.
Comment by Bastien Durel (bastiendurel) - Monday, 17 May 2021, 14:52 GMT
The culprit is the python-flask bump to 2.0. If you downgrade it to 1.1.2-4, you should be able to run pgadmin4 as usual. (but you may break any other package depending on flask which is using 2.0 API)
Comment by Bastien Durel (bastiendurel) - Monday, 31 May 2021, 15:45 GMT
BTW, python-flask-security-too shouldn't be upgraded to 4.0+ too (it was on may 17)

Loading...