I have installed pgadmin4 from repo :
yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
following the below tutorial:
https://www.tecmint.com/install-pgadmin4-in-centos-7/
I get the ‘Application Initialization’ fine, however when I run http://localhost/pgadmin4 I get a ‘500 Internal Server Error’ in firefox.
My httpd error log gives:
[Tue Dec 31 11:32:59.214572 2019] [:error] [pid 6424] [remote ::1:80] mod_wsgi (pid=6424): Target WSGI script '/usr/lib/python2.7/site-packages/pgadmin4-web/pgAdmin4.wsgi' cannot be loaded as Python module.
[Tue Dec 31 11:32:59.214593 2019] [:error] [pid 6424] [remote ::1:80] mod_wsgi (pid=6424): Exception occurred processing WSGI script '/usr/lib/python2.7/site-packages/pgadmin4-web/pgAdmin4.wsgi'.
[Tue Dec 31 11:32:59.214609 2019] [:error] [pid 6424] [remote ::1:80] Traceback (most recent call last):
[Tue Dec 31 11:32:59.214625 2019] [:error] [pid 6424] [remote ::1:80] File "/usr/lib/python2.7/site-packages/pgadmin4-web/pgAdmin4.wsgi", line 36, in <module>
[Tue Dec 31 11:32:59.214660 2019] [:error] [pid 6424] [remote ::1:80] from pgAdmin4 import app as application
[Tue Dec 31 11:32:59.214681 2019] [:error] [pid 6424] [remote ::1:80] File "/usr/lib/python2.7/site-packages/pgadmin4-web/pgAdmin4.py", line 109, in <module>
[Tue Dec 31 11:32:59.214695 2019] [:error] [pid 6424] [remote ::1:80] app = create_app()
[Tue Dec 31 11:32:59.214711 2019] [:error] [pid 6424] [remote ::1:80] File "/usr/lib/python2.7/site-packages/pgadmin4-web/pgadmin/__init__.py", line 244, in create_app
[Tue Dec 31 11:32:59.214723 2019] [:error] [pid 6424] [remote ::1:80] create_app_data_directory(config)
[Tue Dec 31 11:32:59.214729 2019] [:error] [pid 6424] [remote ::1:80] File "/usr/lib/python2.7/site-packages/pgadmin4-web/pgadmin/setup/data_directory.py", line 42, in create_app_data_directory
[Tue Dec 31 11:32:59.214740 2019] [:error] [pid 6424] [remote ::1:80] os.chmod(config.SESSION_DB_PATH, 0o700)
[Tue Dec 31 11:32:59.214755 2019] [:error] [pid 6424] [remote ::1:80] OSError: [Errno 1] Operation not permitted: '/var/lib/pgadmin4/sessions'
I’ve tried ‘chmod’ on my log and lib directories, and I’ve tried to disable SELinux, but I can’t get it work !
Would you please be able to help me ?
Thanks
2
Answers
I followed the same tutorial and faced the same problem.
This is how you can fix it:
If you face any other problem from here, ask a new question and send me the link of the question, I will reply. I faced some other problems after installing pgAdmin4 and solved all of those.
I followed same step and after successfully install & setup; got the
500 internal server error
then I restart httpd, apache and postgres.service. This doesn’t help me after that I run two commands: