致命错误:无法联系 pgAdmin 4 服务器:Windows 10 专业版

问题描述

这是我的 PGAdmin4 中的错误

我已从 AppData(漫游)中删除数据,并尝试以 AdmisiTaror 身份运行它。但是我没有找到解决这个问题的方法

我试图解决这个问题 2 天,但无论我以哪种方式运行它都没有被我解决

我还在 Windows 中添加了环境变量的路径,但它仍然给我这个错误

pgAdmin Runtime Environment
--------------------------------------------------------
Python Path: "C:\Program Files\Postgresql\13\pgAdmin 4\python\python.exe"
Runtime Config File: "C:\Users\RAFI\AppData\Roaming\pgadmin\runtime_config.json"
pgAdmin Config File: "C:\Program Files\Postgresql\13\pgAdmin 4\web\config.py"
Webapp Path: "C:\Program Files\Postgresql\13\pgAdmin 4\web\pgAdmin4.py"
pgAdmin Command: "C:\Program Files\Postgresql\13\pgAdmin 4\python\python.exe -s C:\Program Files\Postgresql\13\pgAdmin 4\web\pgAdmin4.py"
Environment: 
  - ALLUSERSPROFILE: C:\ProgramData
  - APPDATA: C:\Users\RAFI\AppData\Roaming
  - ChocolateyInstall: C:\ProgramData\chocolatey
  - ChocolateyLastPathUpdate: 132568889893646513
  - CHROME_CRASHPAD_PIPE_NAME: \\.\pipe\crashpad_9944_NWJOXUOEYVOTZCKP
  - CHROME_RESTART: NW.js|Whoa! NW.js has crashed. relaunch Now?|LEFT_TO_RIGHT
  - CommonProgramFiles: C:\Program Files\Common Files
  - CommonProgramFiles(x86): C:\Program Files (x86)\Common Files
  - CommonProgramW6432: C:\Program Files\Common Files
  - COmpuTERNAME: NOBOROTNO-09-WP
  - ComSpec: C:\WINDOWS\system32\cmd.exe
  - DriverData: C:\Windows\System32\Drivers\DriverData
  - HOMEDRIVE: C:
  - HOMEPATH: \Users\RAFI
  - IntelliJ IDEA: C:\Program Files\JetBrains\IntelliJ IDEA 2020.2.1\bin;
  - INTEL_DEV_REdisT: C:\Program Files (x86)\Common Files\Intel\Shared Libraries\
  - LOCALAPPDATA: C:\Users\RAFI\AppData\Local
  - logoNSERVER: \\NOBOROTNO-09-WP
  - MIC_LD_LIBRARY_PATH: C:\Program Files (x86)\Common Files\Intel\Shared Libraries\compiler\lib\mic
  - NUMBER_OF_PROCESSORS: 8
  - OneDrive: C:\Users\RAFI\OneDrive
  - OS: Windows_NT
  - Path: C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\physx\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Android;%JAVA_HOME%\bin;C:\Program Files\Microsoft sql Server\130\Tools\Binn\;C:\Program Files\Git\cmd;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs\;C:\Users\RAFI\AppData\Local\Programs\Python\python39\Scripts\;C:\Users\RAFI\AppData\Local\Programs\Python\python39\;C:\Users\RAFI\AppData\Local\Microsoft\WindowsApps;%IntelliJ IDEA Community Edition%;C:\Program Files\JetBrains\IntelliJ IDEA 2019.3.3\bin;C:\Program Files\JetBrains\PyCharm 2019.3.3\bin;C:\Program Files\JetBrains\IntelliJ IDEA 2020.1.1\bin;C:\Users\RAFI\AppData\Local\Microsoft\WindowsApps;C:\Users\RAFI\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\JetBrains\IntelliJ IDEA 2020.2.1\bin;C:\Program Files\JetBrains\PyCharm 2021.1.1\bin;C:\Users\RAFI\Documents\Flutter;C:\src\Flutter\bin;C:\Users\RAFI\AppData\Roaming\npm
  - PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
  - PGADMIN_INT_KEY: b4165b61-33d2-4880-91a7-36803ac38c2d
  - PGADMIN_INT_PORT: 59802
  - PGADMIN_SERVER_MODE: OFF
  - Postgresql: C:\Program Files\Postgresql\13\bin\
  - PROCESSOR_ARCHITECTURE: AMD64
  - PROCESSOR_IDENTIFIER: Intel64 Family 6 Model 142 Stepping 10,GenuineIntel
  - PROCESSOR_LEVEL: 6
  - PROCESSOR_REVISION: 8e0a
  - ProgramData: C:\ProgramData
  - ProgramFiles: C:\Program Files
  - ProgramFiles(x86): C:\Program Files (x86)
  - ProgramW6432: C:\Program Files
  - PSModulePath: C:\Users\RAFI\Documents\WindowsPowerShell\Modules;
  - PT7HOME: C:\Program Files\Cisco Packet Tracer 7.3.1
  - PUBLIC: C:\Users\Public
  - PyCharm: C:\Program Files\JetBrains\PyCharm 2021.1.1\bin;
  - Python 3.9: C:\python39\Scripts
  - QT_DEVICE_PIXEL_RATIO: auto
  - SystemDrive: C:
  - SystemRoot: C:\WINDOWS
  - TEMP: C:\Users\RAFI\AppData\Local\Temp
  - TMP: C:\Users\RAFI\AppData\Local\Temp
  - USERDOMAIN: NOBOROTNO-09-WP
  - USERDOMAIN_ROAMINGPROFILE: NOBOROTNO-09-WP
  - USERNAME: RAFI
  - USERPROFILE: C:\Users\RAFI
  - windir: C:\WINDOWS
--------------------------------------------------------

NOTE: Configuring authentication for DESKTOP mode.

Traceback (most recent call last):
  File "C:\Program Files\Postgresql\13\pgAdmin 4\web\pgAdmin4.py",line 91,in <module>
    exec(open(file_quote(setup_py),'r').read())
  File "<string>",line 506,in <module>
  File "<string>",line 378,in setup_db
  File "C:\Program Files\Postgresql\13\pgAdmin 4\web\pgadmin\__init__.py",line 351,in create_app
    db_upgrade(app)
  File "C:\Program Files\Postgresql\13\pgAdmin 4\web\pgadmin\setup\db_upgrade.py",line 25,in db_upgrade
    flask_migrate.upgrade(migration_folder)
  File "C:\Program Files\Postgresql\13\pgAdmin 4\python\lib\site-packages\flask_migrate\__init__.py",line 96,in wrapped
    f(*args,**kwargs)
  File "C:\Program Files\Postgresql\13\pgAdmin 4\python\lib\site-packages\flask_migrate\__init__.py",line 271,in upgrade
    command.upgrade(config,revision,sql=sql,tag=tag)
  File "C:\Program Files\Postgresql\13\pgAdmin 4\python\lib\site-packages\alembic\command.py",line 294,in upgrade
    script.run_env()
  File "C:\Program Files\Postgresql\13\pgAdmin 4\python\lib\site-packages\alembic\script\base.py",line 490,in run_env
    util.load_python_file(self.dir,"env.py")
  File "C:\Program Files\Postgresql\13\pgAdmin 4\python\lib\site-packages\alembic\util\pyfiles.py",line 97,in load_python_file
    module = load_module_py(module_id,path)
  File "C:\Program Files\Postgresql\13\pgAdmin 4\python\lib\site-packages\alembic\util\compat.py",line 182,in load_module_py
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>",line 783,in exec_module
  File "<frozen importlib._bootstrap>",line 219,in _call_with_frames_removed
  File "C:\Program Files\Postgresql\13\pgAdmin 4\web\pgadmin\setup\..\..\migrations\env.py",line 93,in <module>
    run_migrations_online()
  File "C:\Program Files\Postgresql\13\pgAdmin 4\web\pgadmin\setup\..\..\migrations\env.py",line 86,in run_migrations_online
    context.run_migrations()
  File "<string>",line 8,in run_migrations
  File "C:\Program Files\Postgresql\13\pgAdmin 4\python\lib\site-packages\alembic\runtime\environment.py",line 813,in run_migrations
    self.get_context().run_migrations(**kw)
  File "C:\Program Files\Postgresql\13\pgAdmin 4\python\lib\site-packages\alembic\runtime\migration.py",line 561,in run_migrations
    step.migration_fn(**kw)
  File "C:\Program Files\Postgresql\13\pgAdmin 4\web\migrations\versions\fdc58d9bd449_.py",line 122,in upgrade
    Security(current_app,user_datastore,register_blueprint=False)
  File "C:\Program Files\Postgresql\13\pgAdmin 4\python\lib\site-packages\flask_security\core.py",line 1062,in __init__
    self._state = self.init_app(
  File "C:\Program Files\Postgresql\13\pgAdmin 4\python\lib\site-packages\flask_security\core.py",line 1102,in init_app
    self._state = state = _get_state(app,datastore,**kwargs)
  File "C:\Program Files\Postgresql\13\pgAdmin 4\python\lib\site-packages\flask_security\core.py",line 608,in _get_state
    remember_token_serializer=_get_serializer(app,"remember"),File "C:\Program Files\Postgresql\13\pgAdmin 4\python\lib\site-packages\flask_security\core.py",line 593,in _get_serializer
    return URLSafeTimedSerializer(secret_key=secret_key,salt=salt)
  File "C:\Program Files\Postgresql\13\pgAdmin 4\python\lib\site-packages\itsdangerous\serializer.py",line 104,in __init__
    self.secret_keys: _t.List[bytes] = _make_keys_list(secret_key)
  File "C:\Program Files\Postgresql\13\pgAdmin 4\python\lib\site-packages\itsdangerous\signer.py",line 64,in _make_keys_list
    return [want_bytes(s) for s in secret_key]
TypeError: 'nonetype' object is not iterable

解决方法

以前的答案和评论中提到的问题的相关链接与此不同。唯一的相似之处是致命错误的报告 - 但日志不同。我遇到了这个问题,该链接上的所有答案都没有帮助。

我意识到问题可能出在 Win Pro 上 - 因为我在 Windows Pro 和 Windows Home 上安装了相同版本的 PostgresDB 和 pgadmin - 具有相同的更新系统和相同的安全性 - win home 工作,win pro 做了不是。通过日志跟踪问题后,我通过检查配置文件(c:\Program Files\PostgreSQL\10\pgAdmin 4\web 或 c:\Program Files\pgAdmin 4\web )中的路径一一解决了这些问题,解决了很多问题我的潜在问题。我有时会给它一个临时的硬编码位置而不是构建的路径,只是为了看看是否有打嗝。例如,代码没有将 win pro 注册为 Windows 计算机,而是将其注册为服务器,并且它试图将文件放在错误的位置

关于您的具体问题,请尝试从底部追踪您的错误。您的请求来自错误之前的行。您的最后一行表示第 64 行给定路径 (signer.py) 中的定义给出了“无”结果,而脚本期望得到非“无”答案

def _make_keys_list(secret_key: _t_secret_key) -> _t.List[bytes]:

if isinstance(secret_key,(str,bytes)):

  return [want_bytes(secret_key)]

返回 [want_bytes(s) for s in secret_key]

我会将其追溯到请求并尝试查看为什么它没有放弃任何内容。检查配置文件中的路径。

,
  1. 找到“AppData”文件夹(默认是隐藏的)
  2. 转到 - C:\Users\asus_pc\AppData\Roaming
  3. 找到“pgadmin”和 delete - pgadmin 文件夹
  4. 搜索 pgAdmin4 并运行(如果不起作用,请尝试使用 run as administator