title: The pgAdmin 4 server could not be contacted
body: <p>I've installed PostgreSQL 12, and pgAdmin 4. When I try to run pgAdmin 4 i get a fatal error &quot;The pgAdmin 4 server could not be contacted&quot;. I've tried running it as administrator, deleting files at &quot;C:\Users\User\AppData\Roaming\pgAdmin&quot; and adding &quot;C:\Program Files\PostgreSQL\12\bin&quot; to system environment variables. I don't know what else can I do. I'm sure that the PostgreSQL server is working since it's service at services.msc is running.</p>
  <p>Here are logs from running pgAdmin4. I can see that something is wrong here, but I don't know how to fix this:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;C:/Program Files/pgAdmin 4/v4/web/pgAdmin4.py&quot;, line 217, in &lt;module&gt;
      main()
    File &quot;C:/Program Files/pgAdmin 4/v4/web/pgAdmin4.py&quot;, line 199, in main
      app.run(
    File &quot;C:/Program Files/pgAdmin 4/v4/venv/Lib/site-packages\flask\app.py&quot;, line 943, in run
      run_simple(host, port, self, **options)
    File &quot;C:/Program Files/pgAdmin 4/v4/venv/Lib/site-packages\werkzeug\serving.py&quot;, line 1052, in run_simple
      inner()
    File &quot;C:/Program Files/pgAdmin 4/v4/venv/Lib/site-packages\werkzeug\serving.py&quot;, line 996, in inner
      srv = make_server(
    File &quot;C:/Program Files/pgAdmin 4/v4/venv/Lib/site-packages\werkzeug\serving.py&quot;, line 847, in make_server
      return ThreadedWSGIServer(
    File &quot;C:/Program Files/pgAdmin 4/v4/venv/Lib/site-packages\werkzeug\serving.py&quot;, line 740, in __init__
      HTTPServer.__init__(self, server_address, handler)
    File &quot;C:/Program Files/pgAdmin 4/v4/venv/Lib\socketserver.py&quot;, line 452, in __init__
      self.server_bind()
    File &quot;C:/Program Files/pgAdmin 4/v4/venv/Lib\http\server.py&quot;, line 140, in server_bind
      self.server_name = socket.getfqdn(host)
    File &quot;C:/Program Files/pgAdmin 4/v4/venv/Lib\socket.py&quot;, line 756, in getfqdn
      hostname, aliases, ipaddrs = gethostbyaddr(name)
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb3 in position 5: invalid start byte
  </code></pre>
  <p>Here is another .log file:</p>
  <pre><code>2020-08-31 17:15:12: Checking for system tray...
  2020-08-31 17:15:12: Starting pgAdmin4 server...
  2020-08-31 17:15:12: Creating server object, port:52967, key:459b0c86-b99e-46f0-9070-55554b9621d3, logfile:C:/Users/user/AppData/Local/pgadmin4.d41d8cd98f00b204e9800998ecf8427e.log
  2020-08-31 17:15:12: Python Path: C:/Program Files/pgAdmin 4/v4/venv/Lib/site-packages;C:/Program Files/pgAdmin 4/v4/venv/DLLs;C:/Program Files/pgAdmin 4/v4/venv/Lib
  2020-08-31 17:15:12: Python Home: C:/Program Files/pgAdmin 4/v4/venv
  2020-08-31 17:15:12: Initializing Python...
  2020-08-31 17:15:12: Python initialized.
  2020-08-31 17:15:12: Adding new additional path elements
  2020-08-31 17:15:12: Redirecting stderr...
  2020-08-31 17:15:12: stderr redirected successfully.
  2020-08-31 17:15:12: Initializing server...
  2020-08-31 17:15:12: Webapp Path: C:/Program Files/pgAdmin 4/v4/web/pgAdmin4.py
  2020-08-31 17:15:12: Server initialized, starting server thread...
  2020-08-31 17:15:12: Open the application code and run it.
  2020-08-31 17:15:12: Set the port number, key and force SERVER_MODE off
  2020-08-31 17:15:12: PyRun_SimpleFile launching application server...
  2020-08-31 17:15:13: Application Server URL: http://127.0.0.1:52967/?key=459b0c86-b99e-46f0-9070-55554b9621d3
  2020-08-31 17:15:13: The server should be up. Attempting to connect and get a response.
  2020-08-31 17:15:21: Failed to launch the application server, server thread exiting.
  </code></pre>
  <p>If you know what could I do, please help me.</p>