gpt4 book ai didi

python - 无法联系 pgAdmin 4 服务器 : Fatal error

转载 作者:行者123 更新时间:2023-12-04 12:54:19 25 4
gpt4 key购买 nike

我将 PostgreSQL 从 13.3 升级到 13.4,并且 pgAdmin 4 遇到了 fatal error 。我发现了其他类似的问题,试图解决删除文件夹的问题:“C:\Users\myusername\AppData\Roaming\pgadmin\sessions”并运行 pgAdmin作为管理员,但什么也没有发生。此外,我完全删除了 postgres 并重新安装了它,并且我用他的单独安装安装了 pgAdmin,但没有再发生任何事情。
这是错误:

pgAdmin Runtime Environment
--------------------------------------------------------
Python Path: "D:\Program Files\PostgreSQL\13\pgAdmin 4\python\python.exe"
Runtime Config File: "C:\Users\Alessandro\AppData\Roaming\pgadmin\runtime_config.json"
pgAdmin Config File: "D:\Program Files\PostgreSQL\13\pgAdmin 4\web\config.py"
Webapp Path: "D:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgAdmin4.py"
pgAdmin Command: "D:\Program Files\PostgreSQL\13\pgAdmin 4\python\python.exe -s D:\Program Files\PostgreSQL\13\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\13\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\13\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\13\pgAdmin 4\web\pgAdmin4.py", line 39, in <module>
import config
File "D:\Program Files\PostgreSQL\13\pgAdmin 4\web\config.py", line 25, in <module>
from pgadmin.utils import env, IS_WIN, fs_short_path
File "D:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgadmin\__init__.py", line 24, in <module>
from flask_socketio import SocketIO
File "D:\Program Files\PostgreSQL\13\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\13\pgAdmin 4\python\lib\site-packages\socketio\__init__.py", line 9, in <module>
from .zmq_manager import ZmqManager
File "D:\Program Files\PostgreSQL\13\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\13\pgAdmin 4\python\lib\site-packages\eventlet\__init__.py", line 17, in <module>
from eventlet import convenience
File "D:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\eventlet\convenience.py", line 7, in <module>
from eventlet.green import socket
File "D:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\eventlet\green\socket.py", line 21, in <module>
from eventlet.support import greendns
File "D:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\eventlet\support\greendns.py", line 401, in <module>
resolver = ResolverProxy(hosts_resolver=HostsResolver())
File "D:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\eventlet\support\greendns.py", line 315, in __init__
self.clear()
File "D:\Program Files\PostgreSQL\13\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\13\pgAdmin 4\python\lib\site-packages\dns\resolver.py", line 543, in __init__
self.read_registry()
File "D:\Program Files\PostgreSQL\13\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\13\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\13\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\13\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\13\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\ 下找到的所有网络接口(interface)
Registry content example
机器连接的WiFi移动热点设置了DhcpDomain值为“.home”的键。 dns.Resolver找到此值并使用点将其拆分为多个标签,其中一个为空。这导致了您提到的异常:dns.name.EmptyLabel: A DNS label is empty .
即使关闭 WiFi 网络也会发生这种情况:这些是最后使用的设置和 dns.Resolver没有检查接口(interface)是否启用。
pgAdmin 的最新版本似乎是 dnspython (1.16.0) 的旧版本,所以我不确定这是否已在更新的版本中修复。目前,似乎有两种选择:

  • 删除或更改 DhcpDomain子键,如果您在 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\ 的子键中找到它(甚至可能有办法通过控制面板强制该值)。
  • 连接到未设置此值的其他网络。
  • 关于python - 无法联系 pgAdmin 4 服务器 : Fatal error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68862998/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com