Fatal Error: The pgAdmin 4 server could not be contacted: (Windows 10 Pro)

Viewed 1205

This the error in my PGAdmin4.

I have deleted data from AppData (Roaming) and also tried to run it as Admisitaror. But no solutions for this problem has been found by me.

I am trying to solve this issue for 2 days but no matter which way I run it is not being solved by me.

I have also added the path to environment variables in Windows but still, it is giving me this error:

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
3 Answers

previous answers and the related link to the problem mentioned in the comment are not the same as this one. the only similarity is a report of fatal error - but the log is different. I had that problem and none of the answers on that link helped.

I realized that the issue might be in working from Win Pro - as I installed the same versions of PostgresDB and pgadmin on both Windows Pro and Windows Home - with the same updated systems and same security - win home worked and win pro did not. after tracing problems through the log I solved them one by one by checking paths in config file (c:\Program Files\PostgreSQL\10\pgAdmin 4\web or c:\Program Files\pgAdmin 4\web ) wich solved a lot of underlying problems for me. I sometimes give it a temp hardcoded location instead of the constructed paths just to see if the hiccup is there. for example, the code is not registering win pro as a windows machine but a server and it's trying to get the file in a wrong place

About your specific problem, try to trace your errors from the bottom. your request is coming from the line before the error. your last line says that the definition in the given path (signer.py) at line 64 is giving a 'None' result and the script is expecting a non 'None' answer

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

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

  return [want_bytes(secret_key)]

return [want_bytes(s) for s in secret_key]

I would trace it back to the request and try to see why it's giving away none. Check your paths in config file.

  1. find "AppData" folder (default it is hidden)
  2. go to - C:\Users\asus_pc\AppData\Roaming
  3. find for "pgadmin" and delete - pgadmin folder
  4. search pgAdmin4 and run (if not working try with run as administator

Like you I tried deleting session data and running the program as administrator, as well as various other posted solutions.

The fix that worked for me was simply increasing the timeout duration to 240 seconds. This can be done from the window showing the error message. At the bottom of this window is a button that allows some config settings to be adjusted.

Related