无法联系 pgAdmin 4 服务器:致命错误
The pgAdmin 4 server could not be contacted: Fatal error
我将 PostgreSQL 从 13.3 升级到 13.4,然后 pgAdmin 4 出现致命错误。我发现其他类似的问题试图解决删除文件夹的问题:“C:\Users\myusername\AppData\Roaming\pgadmin\sessions”和 运行 pgAdmin 作为管理员,但没有任何反应。我也完全删除了 postgres 并重新安装它,并且我用他的单独安装安装了 pgAdmin,但没有再发生任何事情。
这是错误:
pgAdmin Runtime Environment
--------------------------------------------------------
Python Path: "D:\Program Files\PostgreSQL\pgAdmin 4\python\python.exe"
Runtime Config File: "C:\Users\Alessandro\AppData\Roaming\pgadmin\runtime_config.json"
pgAdmin Config File: "D:\Program Files\PostgreSQL\pgAdmin 4\web\config.py"
Webapp Path: "D:\Program Files\PostgreSQL\pgAdmin 4\web\pgAdmin4.py"
pgAdmin Command: "D:\Program Files\PostgreSQL\pgAdmin 4\python\python.exe -s D:\Program Files\PostgreSQL\pgAdmin 4\web\pgAdmin4.py"
Environment:
- ALLUSERSPROFILE: C:\ProgramData
- APPDATA: C:\Users\Alessandro\AppData\Roaming
- CHROME_CRASHPAD_PIPE_NAME: \.\pipe\crashpad_6172_IWUHMIZQAVFZRPVX
- CHROME_RESTART: NW.js|Spiacenti, si è verificato un arresto anomalo di NW.js. Riavviarlo ora?|LEFT_TO_RIGHT
- CommonProgramFiles: C:\Program Files\Common Files
- CommonProgramFiles(x86): C:\Program Files (x86)\Common Files
- CommonProgramW6432: C:\Program Files\Common Files
- COMPUTERNAME: HP820G1-ALESSAN
- ComSpec: C:\WINDOWS\system32\cmd.exe
- DriverData: C:\Windows\System32\Drivers\DriverData
- FPS_BROWSER_APP_PROFILE_STRING: Internet Explorer
- FPS_BROWSER_USER_PROFILE_STRING: Default
- HOMEDRIVE: C:
- HOMEPATH: \Users\Alessandro
- JD2_HOME: D:\Program Files\JDownloader2
- JDK_HOME: D:\Program Files\Java\jdk-16.0.2
- LOCALAPPDATA: C:\Users\Alessandro\AppData\Local
- LOGONSERVER: \HP820G1-ALESSAN
- NUMBER_OF_PROCESSORS: 4
- OneDrive: D:\temp\OneDrive - Università di Salerno
- OneDriveCommercial: D:\temp\OneDrive - Università di Salerno
- OS: Windows_NT
- Path: D:\Program Files\Python39\Scripts\;D:\Program Files\Python39\;C:\Program Files\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;D:\Program Files\UltraEdit;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;D:\Program Files\MATLAB\R2021a\bin;D:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;D:\Program Files\Zerynth\ztc\windows64;D:\Program Files\PostgreSQL\bin;C:\Users\Alessandro\AppData\Local\Microsoft\WindowsApps;D:\Program Files\Java\jdk-16.0.2;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;D:\Program Files\Microsoft VS Code\bin;D:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;D:\Program Files\JetBrains\PyCharm Community Edition 2021.1.1\bin;C:\Users\Alessandro\zerynth3\dist\sys\cli;D:\Program Files\PostgreSQL\bin;
- PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW
- PGADMIN_INT_KEY: 89448562-228e-4522-bc29-54d857da3f2a
- PGADMIN_INT_PORT: 55190
- PGADMIN_SERVER_MODE: OFF
- PROCESSOR_ARCHITECTURE: AMD64
- PROCESSOR_IDENTIFIER: Intel64 Family 6 Model 69 Stepping 1, GenuineIntel
- PROCESSOR_LEVEL: 6
- PROCESSOR_REVISION: 4501
- ProgramData: C:\ProgramData
- ProgramFiles: C:\Program Files
- ProgramFiles(x86): C:\Program Files (x86)
- ProgramW6432: C:\Program Files
- PSModulePath: C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
- PUBLIC: C:\Users\Public
- PyCharm Community Edition: D:\Program Files\JetBrains\PyCharm Community Edition 2021.1.1\bin;
- SESSIONNAME: Console
- SystemDrive: C:
- SystemRoot: C:\WINDOWS
- TEMP: C:\Users\ALESSA~1\AppData\Local\Temp
- TMP: C:\Users\ALESSA~1\AppData\Local\Temp
- USERDOMAIN: HP820G1-ALESSAN
- USERDOMAIN_ROAMINGPROFILE: HP820G1-ALESSAN
- USERNAME: Alessandro
- USERPROFILE: C:\Users\Alessandro
- windir: C:\WINDOWS
--------------------------------------------------------
Traceback (most recent call last):
File "D:\Program Files\PostgreSQL\pgAdmin 4\web\pgAdmin4.py", line 39, in <module>
import config
File "D:\Program Files\PostgreSQL\pgAdmin 4\web\config.py", line 25, in <module>
from pgadmin.utils import env, IS_WIN, fs_short_path
File "D:\Program Files\PostgreSQL\pgAdmin 4\web\pgadmin\__init__.py", line 24, in <module>
from flask_socketio import SocketIO
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\flask_socketio\__init__.py", line 9, in <module>
from socketio import socketio_manage # noqa: F401
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\socketio\__init__.py", line 9, in <module>
from .zmq_manager import ZmqManager
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\socketio\zmq_manager.py", line 5, in <module>
import eventlet.green.zmq as zmq
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\eventlet\__init__.py", line 17, in <module>
from eventlet import convenience
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\eventlet\convenience.py", line 7, in <module>
from eventlet.green import socket
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\eventlet\green\socket.py", line 21, in <module>
from eventlet.support import greendns
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\eventlet\support\greendns.py", line 401, in <module>
resolver = ResolverProxy(hosts_resolver=HostsResolver())
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\eventlet\support\greendns.py", line 315, in __init__
self.clear()
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\eventlet\support\greendns.py", line 318, in clear
self._resolver = dns.resolver.Resolver(filename=self._filename)
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\dns\resolver.py", line 543, in __init__
self.read_registry()
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\dns\resolver.py", line 720, in read_registry
self._config_win32_fromkey(key, False)
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\dns\resolver.py", line 674, in _config_win32_fromkey
self._config_win32_domain(dom)
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\dns\resolver.py", line 639, in _config_win32_domain
self.domain = dns.name.from_text(str(domain))
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\dns\name.py", line 889, in from_text
return from_unicode(text, origin, idna_codec)
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\dns\name.py", line 852, in from_unicode
raise EmptyLabel
dns.name.EmptyLabel: A DNS label is empty.
我不明白为什么会出现 DNS 问题,有人有建议或解决方法吗?
谢谢
这似乎在 pgAdmin4 5.1 和 5.7 之间发生了变化。
我在连接到 WiFi 移动热点的机器上看到过这种情况(但在其他情况下也可能发生)。
这与 dns
库在 Windows 上的使用方式有关,因此其他以相同方式使用它的应用程序也可能会发生这种情况。
本质上,dns.Resolver
扫描 Windows 注册表以查找在 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\
下找到的所有网络接口
机器已连接的 WiFi 移动热点设置了一个值为“.home
”的 DhcpDomain
键。 dns.Resolver
找到了这个值并使用点将其拆分为多个标签,其中一个是空的。这导致了您提到的异常:dns.name.EmptyLabel: A DNS label is empty
.
即使关闭 WiFi 网络也会发生这种情况:这些是上次使用的设置,dns.Resolver
没有检查接口是否已启用。
最新版本的 pgAdmin 似乎是 dnspython (1.16.0) 的旧版本,所以我不确定这个问题是否已在更新的版本中修复。目前,似乎有两个选择:
删除或更改 DhcpDomain
子项,如果您在 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\
的一个子项中找到它(甚至可能有一种方法通过控制面板强制该值).
连接到未设置此值的其他网络。
我将 PostgreSQL 从 13.3 升级到 13.4,然后 pgAdmin 4 出现致命错误。我发现其他类似的问题试图解决删除文件夹的问题:“C:\Users\myusername\AppData\Roaming\pgadmin\sessions”和 运行 pgAdmin 作为管理员,但没有任何反应。我也完全删除了 postgres 并重新安装它,并且我用他的单独安装安装了 pgAdmin,但没有再发生任何事情。 这是错误:
pgAdmin Runtime Environment
--------------------------------------------------------
Python Path: "D:\Program Files\PostgreSQL\pgAdmin 4\python\python.exe"
Runtime Config File: "C:\Users\Alessandro\AppData\Roaming\pgadmin\runtime_config.json"
pgAdmin Config File: "D:\Program Files\PostgreSQL\pgAdmin 4\web\config.py"
Webapp Path: "D:\Program Files\PostgreSQL\pgAdmin 4\web\pgAdmin4.py"
pgAdmin Command: "D:\Program Files\PostgreSQL\pgAdmin 4\python\python.exe -s D:\Program Files\PostgreSQL\pgAdmin 4\web\pgAdmin4.py"
Environment:
- ALLUSERSPROFILE: C:\ProgramData
- APPDATA: C:\Users\Alessandro\AppData\Roaming
- CHROME_CRASHPAD_PIPE_NAME: \.\pipe\crashpad_6172_IWUHMIZQAVFZRPVX
- CHROME_RESTART: NW.js|Spiacenti, si è verificato un arresto anomalo di NW.js. Riavviarlo ora?|LEFT_TO_RIGHT
- CommonProgramFiles: C:\Program Files\Common Files
- CommonProgramFiles(x86): C:\Program Files (x86)\Common Files
- CommonProgramW6432: C:\Program Files\Common Files
- COMPUTERNAME: HP820G1-ALESSAN
- ComSpec: C:\WINDOWS\system32\cmd.exe
- DriverData: C:\Windows\System32\Drivers\DriverData
- FPS_BROWSER_APP_PROFILE_STRING: Internet Explorer
- FPS_BROWSER_USER_PROFILE_STRING: Default
- HOMEDRIVE: C:
- HOMEPATH: \Users\Alessandro
- JD2_HOME: D:\Program Files\JDownloader2
- JDK_HOME: D:\Program Files\Java\jdk-16.0.2
- LOCALAPPDATA: C:\Users\Alessandro\AppData\Local
- LOGONSERVER: \HP820G1-ALESSAN
- NUMBER_OF_PROCESSORS: 4
- OneDrive: D:\temp\OneDrive - Università di Salerno
- OneDriveCommercial: D:\temp\OneDrive - Università di Salerno
- OS: Windows_NT
- Path: D:\Program Files\Python39\Scripts\;D:\Program Files\Python39\;C:\Program Files\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;D:\Program Files\UltraEdit;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;D:\Program Files\MATLAB\R2021a\bin;D:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;D:\Program Files\Zerynth\ztc\windows64;D:\Program Files\PostgreSQL\bin;C:\Users\Alessandro\AppData\Local\Microsoft\WindowsApps;D:\Program Files\Java\jdk-16.0.2;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;D:\Program Files\Microsoft VS Code\bin;D:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;D:\Program Files\JetBrains\PyCharm Community Edition 2021.1.1\bin;C:\Users\Alessandro\zerynth3\dist\sys\cli;D:\Program Files\PostgreSQL\bin;
- PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW
- PGADMIN_INT_KEY: 89448562-228e-4522-bc29-54d857da3f2a
- PGADMIN_INT_PORT: 55190
- PGADMIN_SERVER_MODE: OFF
- PROCESSOR_ARCHITECTURE: AMD64
- PROCESSOR_IDENTIFIER: Intel64 Family 6 Model 69 Stepping 1, GenuineIntel
- PROCESSOR_LEVEL: 6
- PROCESSOR_REVISION: 4501
- ProgramData: C:\ProgramData
- ProgramFiles: C:\Program Files
- ProgramFiles(x86): C:\Program Files (x86)
- ProgramW6432: C:\Program Files
- PSModulePath: C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
- PUBLIC: C:\Users\Public
- PyCharm Community Edition: D:\Program Files\JetBrains\PyCharm Community Edition 2021.1.1\bin;
- SESSIONNAME: Console
- SystemDrive: C:
- SystemRoot: C:\WINDOWS
- TEMP: C:\Users\ALESSA~1\AppData\Local\Temp
- TMP: C:\Users\ALESSA~1\AppData\Local\Temp
- USERDOMAIN: HP820G1-ALESSAN
- USERDOMAIN_ROAMINGPROFILE: HP820G1-ALESSAN
- USERNAME: Alessandro
- USERPROFILE: C:\Users\Alessandro
- windir: C:\WINDOWS
--------------------------------------------------------
Traceback (most recent call last):
File "D:\Program Files\PostgreSQL\pgAdmin 4\web\pgAdmin4.py", line 39, in <module>
import config
File "D:\Program Files\PostgreSQL\pgAdmin 4\web\config.py", line 25, in <module>
from pgadmin.utils import env, IS_WIN, fs_short_path
File "D:\Program Files\PostgreSQL\pgAdmin 4\web\pgadmin\__init__.py", line 24, in <module>
from flask_socketio import SocketIO
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\flask_socketio\__init__.py", line 9, in <module>
from socketio import socketio_manage # noqa: F401
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\socketio\__init__.py", line 9, in <module>
from .zmq_manager import ZmqManager
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\socketio\zmq_manager.py", line 5, in <module>
import eventlet.green.zmq as zmq
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\eventlet\__init__.py", line 17, in <module>
from eventlet import convenience
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\eventlet\convenience.py", line 7, in <module>
from eventlet.green import socket
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\eventlet\green\socket.py", line 21, in <module>
from eventlet.support import greendns
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\eventlet\support\greendns.py", line 401, in <module>
resolver = ResolverProxy(hosts_resolver=HostsResolver())
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\eventlet\support\greendns.py", line 315, in __init__
self.clear()
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\eventlet\support\greendns.py", line 318, in clear
self._resolver = dns.resolver.Resolver(filename=self._filename)
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\dns\resolver.py", line 543, in __init__
self.read_registry()
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\dns\resolver.py", line 720, in read_registry
self._config_win32_fromkey(key, False)
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\dns\resolver.py", line 674, in _config_win32_fromkey
self._config_win32_domain(dom)
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\dns\resolver.py", line 639, in _config_win32_domain
self.domain = dns.name.from_text(str(domain))
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\dns\name.py", line 889, in from_text
return from_unicode(text, origin, idna_codec)
File "D:\Program Files\PostgreSQL\pgAdmin 4\python\lib\site-packages\dns\name.py", line 852, in from_unicode
raise EmptyLabel
dns.name.EmptyLabel: A DNS label is empty.
我不明白为什么会出现 DNS 问题,有人有建议或解决方法吗? 谢谢
这似乎在 pgAdmin4 5.1 和 5.7 之间发生了变化。 我在连接到 WiFi 移动热点的机器上看到过这种情况(但在其他情况下也可能发生)。
这与 dns
库在 Windows 上的使用方式有关,因此其他以相同方式使用它的应用程序也可能会发生这种情况。
本质上,dns.Resolver
扫描 Windows 注册表以查找在 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\
机器已连接的 WiFi 移动热点设置了一个值为“.home
”的 DhcpDomain
键。 dns.Resolver
找到了这个值并使用点将其拆分为多个标签,其中一个是空的。这导致了您提到的异常:dns.name.EmptyLabel: A DNS label is empty
.
即使关闭 WiFi 网络也会发生这种情况:这些是上次使用的设置,dns.Resolver
没有检查接口是否已启用。
最新版本的 pgAdmin 似乎是 dnspython (1.16.0) 的旧版本,所以我不确定这个问题是否已在更新的版本中修复。目前,似乎有两个选择:
删除或更改
DhcpDomain
子项,如果您在HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\
的一个子项中找到它(甚至可能有一种方法通过控制面板强制该值).连接到未设置此值的其他网络。