title: Fatal Error: The pgAdmin 4 server could not be contacted: (Windows 10 Pro)
body: <p><strong>This the error in my PGAdmin4.</strong></p>
  <p>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.</p>
  <p>I am trying to solve this issue for 2 days but no matter which way I run it is not being solved by me.</p>
  <p>I have also added the path to environment variables in Windows but still, it is giving me this error:</p>
  <pre><code>pgAdmin Runtime Environment
  --------------------------------------------------------
  Python Path: &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\python\python.exe&quot;
  Runtime Config File: &quot;C:\Users\RAFI\AppData\Roaming\pgadmin\runtime_config.json&quot;
  pgAdmin Config File: &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\web\config.py&quot;
  Webapp Path: &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgAdmin4.py&quot;
  pgAdmin Command: &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\python\python.exe -s C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgAdmin4.py&quot;
  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 &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgAdmin4.py&quot;, line 91, in &lt;module&gt;
      exec(open(file_quote(setup_py), 'r').read())
    File &quot;&lt;string&gt;&quot;, line 506, in &lt;module&gt;
    File &quot;&lt;string&gt;&quot;, line 378, in setup_db
    File &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgadmin\__init__.py&quot;, line 351, in create_app
      db_upgrade(app)
    File &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgadmin\setup\db_upgrade.py&quot;, line 25, in db_upgrade
      flask_migrate.upgrade(migration_folder)
    File &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\flask_migrate\__init__.py&quot;, line 96, in wrapped
      f(*args, **kwargs)
    File &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\flask_migrate\__init__.py&quot;, line 271, in upgrade
      command.upgrade(config, revision, sql=sql, tag=tag)
    File &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\alembic\command.py&quot;, line 294, in upgrade
      script.run_env()
    File &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\alembic\script\base.py&quot;, line 490, in run_env
      util.load_python_file(self.dir, &quot;env.py&quot;)
    File &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\alembic\util\pyfiles.py&quot;, line 97, in load_python_file
      module = load_module_py(module_id, path)
    File &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\alembic\util\compat.py&quot;, line 182, in load_module_py
      spec.loader.exec_module(module)
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 783, in exec_module
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 219, in _call_with_frames_removed
    File &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgadmin\setup\..\..\migrations\env.py&quot;, line 93, in &lt;module&gt;
      run_migrations_online()
    File &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\web\pgadmin\setup\..\..\migrations\env.py&quot;, line 86, in run_migrations_online
      context.run_migrations()
    File &quot;&lt;string&gt;&quot;, line 8, in run_migrations
    File &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\alembic\runtime\environment.py&quot;, line 813, in run_migrations
      self.get_context().run_migrations(**kw)
    File &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\alembic\runtime\migration.py&quot;, line 561, in run_migrations
      step.migration_fn(**kw)
    File &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\web\migrations\versions\fdc58d9bd449_.py&quot;, line 122, in upgrade
      Security(current_app, user_datastore, register_blueprint=False)
    File &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\flask_security\core.py&quot;, line 1062, in __init__
      self._state = self.init_app(
    File &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\flask_security\core.py&quot;, line 1102, in init_app
      self._state = state = _get_state(app, datastore, **kwargs)
    File &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\flask_security\core.py&quot;, line 608, in _get_state
      remember_token_serializer=_get_serializer(app, &quot;remember&quot;),
    File &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\flask_security\core.py&quot;, line 593, in _get_serializer
      return URLSafeTimedSerializer(secret_key=secret_key, salt=salt)
    File &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\itsdangerous\serializer.py&quot;, line 104, in __init__
      self.secret_keys: _t.List[bytes] = _make_keys_list(secret_key)
    File &quot;C:\Program Files\PostgreSQL\13\pgAdmin 4\python\lib\site-packages\itsdangerous\signer.py&quot;, line 64, in _make_keys_list
      return [want_bytes(s) for s in secret_key]
  TypeError: 'NoneType' object is not iterable
  </code></pre>