Pgadmin4-500 内部服务器错误

Pgadmin4-500 内部服务器错误

我是 PostgreSQL 的新用户。我在 CentOS 8 服务器上安装了 PostgreSQL 13,并在 Web UI 和桌面 UI 模式下配置了 PGAdmin4。安装成功,桌面 UI 运行正常,但当我尝试访问 Web UI 时收到以下错误:

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)

这个错误是什么原因造成的?

相关内容