Я новый пользователь PostgreSQL. Я установил PostgreSQL 13 на сервере CentOS 8 и настроил PGAdmin4 в режимах веб-интерфейса и рабочего стола. Установка прошла успешно, рабочий стол работает нормально, но при попытке доступа к веб-интерфейсу я получаю следующую ошибку:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Службы Apache и PostgreSQL работают нормально. Службы Apache и PostgreSQL, а также их порты разрешены в брандмауэре.
[root@XXXXXX-testing-server ~]# ss -tulpn | grep 5432
tcp LISTEN 0 128 0.0.0.0:5432 0.0.0.0:* users:(("postmaster",pid=1485,fd=6))
tcp LISTEN 0 128 [::]:5432 [::]:* users:(("postmaster",pid=1485,fd=7))
[root@XXXXXX-testing-server ~]#
Я проверил /var/log/httpd/error_log
. Я вижу следующие ошибки в журналах службы Apache.
[Fri Sep 08 15:31:38.438903 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] mod_wsgi (pid=2114): Failed to exec Python script file '/usr/pgadmin4/web/pgAdmin4.wsgi'.
[Fri Sep 08 15:31:38.439004 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] mod_wsgi (pid=2114): Exception occurred processing WSGI script '/usr/pgadmin4/web/pgAdmin4.wsgi'.
[Fri Sep 08 15:31:38.443337 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] Traceback (most recent call last):
[Fri Sep 08 15:31:38.443412 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] File "/usr/pgadmin4/web/pgAdmin4.wsgi", line 36, in <module>
[Fri Sep 08 15:31:38.443417 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] from pgAdmin4 import app as application
[Fri Sep 08 15:31:38.443424 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] File "/usr/pgadmin4/web/pgAdmin4.py", line 104, in <module>
[Fri Sep 08 15:31:38.443427 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] app = create_app()
[Fri Sep 08 15:31:38.443432 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] File "/usr/pgadmin4/web/pgadmin/__init__.py", line 550, in create_app
[Fri Sep 08 15:31:38.443435 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] driver.init_app(app)
[Fri Sep 08 15:31:38.443441 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] File "/usr/pgadmin4/web/pgadmin/utils/driver/__init__.py", line 27, in init_app
[Fri Sep 08 15:31:38.443444 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] DriverRegistry.load_modules(app)
[Fri Sep 08 15:31:38.443459 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] File "/usr/pgadmin4/web/pgadmin/utils/driver/registry.py", line 20, in load_modules
[Fri Sep 08 15:31:38.443461 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] from . import psycopg3 as module
[Fri Sep 08 15:31:38.443468 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] File "/usr/pgadmin4/web/pgadmin/utils/driver/psycopg3/__init__.py", line 21, in <module>
[Fri Sep 08 15:31:38.443471 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] import psycopg
[Fri Sep 08 15:31:38.443476 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] File "/usr/pgadmin4/venv/lib64/python3.9/site-packages/psycopg/__init__.py", line 9, in <module>
[Fri Sep 08 15:31:38.443479 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] from . import pq # noqa: F401 import early to stabilize side effects
[Fri Sep 08 15:31:38.443484 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] File "/usr/pgadmin4/venv/lib64/python3.9/site-packages/psycopg/pq/__init__.py", line 114, in <module>
[Fri Sep 08 15:31:38.443487 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] import_from_libpq()
[Fri Sep 08 15:31:38.443492 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] File "/usr/pgadmin4/venv/lib64/python3.9/site-packages/psycopg/pq/__init__.py", line 106, in import_from_libpq
[Fri Sep 08 15:31:38.443495 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] raise ImportError(
[Fri Sep 08 15:31:38.443509 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] ImportError: no pq wrapper available.
[Fri Sep 08 15:31:38.443511 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] Attempts made:
[Fri Sep 08 15:31:38.443515 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] - couldn't import psycopg 'c' implementation: /usr/pgadmin4/venv/lib64/python3.9/site-packages/psycopg_c/pq.cpython-39-x86_64-linux-gnu.so: undefined symbol: PQpipelineStatus
[Fri Sep 08 15:31:38.443518 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] - couldn't import psycopg 'binary' implementation: No module named 'psycopg_binary'
[Fri Sep 08 15:31:38.443520 2023] [wsgi:error] [pid 2114:tid 139876901840640] [remote 192.168.1.1:59963] - couldn't import psycopg 'python' implementation:
Но вышеупомянутая библиотека/пакет Python уже доступна на моем сервере.
[root@XXXXXXXX-testing-server ~]# pip3.6 install psycopg2-binary
Requirement already satisfied: psycopg2-binary in /usr/local/lib64/python3.6/site-packages (2.9.7)
К чему приводит эта ошибка?