0

when i open pgadmin4 in manjaro xfce this error message pops up saying

An error occurred initializing the pgadmin 4 server: Failed to launch application server, server thread exiting.

error message

i checked the logs

startup log

2021-08-26 09:35:29: Checking for system tray...
2021-08-26 09:35:29: Starting pgAdmin4 server...
2021-08-26 09:35:29: Creating server object, port:42505, key:fdcf6315-03b8-4a0c-a4cc-c8e6efc3f38e, logfile:/home/thenujan/.local/share/pgadmin4.d41d8cd98f00b204e9800998ecf8427e.log
2021-08-26 09:35:29: Python Path: /usr/lib/python3.9:/usr/lib/python3.9/lib-dynload:/usr/lib/python3.9/site-packages
2021-08-26 09:35:29: Python Home: /usr/lib/python3.9
2021-08-26 09:35:29: Initializing Python...
2021-08-26 09:35:29: Python initialized.
2021-08-26 09:35:29: Adding new additional path elements
2021-08-26 09:35:29: Redirecting stderr...
2021-08-26 09:35:29: stderr redirected successfully.
2021-08-26 09:35:29: Initializing server...
2021-08-26 09:35:29: Webapp Path: /usr/lib/pgadmin4/web/pgAdmin4.py
2021-08-26 09:35:29: Server initialized, starting server thread...
2021-08-26 09:35:29: Open the application code and run it.
2021-08-26 09:35:29: Set the port number, key and force SERVER_MODE off
2021-08-26 09:35:29: PyRun_SimpleFile launching application server...
2021-08-26 09:35:30: Failed to launch the application server, server thread exiting.

server log

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 15, in <module>
    from .core import Security, RoleMixin, UserMixin, AnonymousUser, current_user
  File "/usr/lib/python3.9/site-packages/flask_security/core.py", line 48, in <module>
    from .mail_util import MailUtil
  File "/usr/lib/python3.9/site-packages/flask_security/mail_util.py", line 14, in <module>
    import email_validator
ModuleNotFoundError: No module named 'email_validator'

i did try installing email_validator

by using pip pip install email_validator but its still showing me the same error

and pgadmin4 configurations seem right enter image description here

and sometimes it strangely says failed to open system default web browser and that error message stops after the restart and then it comes back again after several attempts to open pgadmin4

and this web browser error only pops up when pgadmin4 is running in the background if i kill pgadmin4 then failed to launch application server error pops up when i open it

1

Found solution here https://stackoverflow.com/questions/67610220/pgadmin4-error-modulenotfounderror-no-module-named-email-validator

solution is to downgrade python-flask and python-flask-security-too. They cannot be past 2.0 and 4.0 respectively.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.