Fatal Error The pgAdmin 4 server could not be contacted (already tried solution in other thread)

Viewed 5167

I get the pgadmin 4 server could not be contacted. This is the first time I installed on my computer. I tried the run as admin solution, remove the app/roaming files, restart the posgresql services, tried to modify the config.py, config_distro.py. All of it did not help. Please help thank you.

Here is the error

pgAdmin Runtime Environment

Python Path: "C:\Program Files\PostgreSQL\12\pgAdmin 4\python\python.exe" Runtime Config File: "C:\Users\lco73\AppData\Roaming\pgadmin\runtime_config.json" pgAdmin Config File: "C:\Program Files\PostgreSQL\12\pgAdmin 4\web\config.py" Webapp Path: "C:\Program Files\PostgreSQL\12\pgAdmin 4\web\pgAdmin4.py" pgAdmin Command: "C:\Program Files\PostgreSQL\12\pgAdmin 4\python\python.exe -s C:\Program Files\PostgreSQL\12\pgAdmin 4\web\pgAdmin4.py" Environment:

  • ALLUSERSPROFILE: C:\ProgramData
  • APPDATA: C:\Users\lco73\AppData\Roaming
  • CHROME_CRASHPAD_PIPE_NAME: \.\pipe\crashpad_2976_GCSFUFUNDXSUIDKX
  • 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: CHENONN
  • ComSpec: C:\Windows\system32\cmd.exe
  • DriverData: C:\Windows\System32\Drivers\DriverData
  • HOMEDRIVE: C:
  • HOMEPATH: \Users\lco73
  • JAVA_HOME: C:\Users\lco73\AppData\Local\Programs\AdoptOpenJDK\jdk-11.0.10.9-hotspot\
  • LOCALAPPDATA: C:\Users\lco73\AppData\Local
  • LOGONSERVER: \CHEO
  • M2_HOME: C:\Program Files\apache-maven-3.6.3
  • MAVEN_HOME: C:\Program Files\apache-maven-3.6.3
  • NUMBER_OF_PROCESSORS: 16
  • OneDrive: C:\Users\lco73\OneDrive
  • OneDriveConsumer: C:\Users\lco73\OneDrive
  • OS: Windows_NT
  • Path: C:\Users\lco73\introcs\java\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\MATLAB\R2018a\runtime\win64;C:\Program Files\MATLAB\R2018a\bin;C:\Program Files\MATLAB\MATLAB Runtime\v96\runtime\win64;C:\Program Files\apache-maven-3.6.3\bin;C:\Program Files\apache-maven-3.6.3\bin;C:\Program Files\TMC-cli;C:\Program Files\MySQL\MySQL Shell 8.0\bin;C:\Users\lco73\anaconda3;C:\Users\lco73\anaconda3\Library\mingw-w64\bin;C:\Users\lco73\anaconda3\Library\usr\bin;C:\Users\lco73\anaconda3\Library\bin;C:\Users\lco73\anaconda3\Scripts;C:\Users\lco73\AppData\Local\Programs\AdoptOpenJDK\jdk-11.0.10.9-hotspot\bin;C:\Users\lco73\introcs\j3d\bin;C:\Users\lco73\introcs\bin;C:\Users\lco73\AppData\Local\Microsoft\WindowsApps;C:\Program Files\JetBrains\PyCharm Community Edition 2021.1.1\bin
  • PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
  • pgAdmin: C:\Program Files\PostgreSQL\12\pgAdmin 4\bin
  • PGADMIN_INT_KEY: de63dec9-3578-472a-af02-2786fce52e26
  • PGADMIN_INT_PORT: 63995
  • PGADMIN_SERVER_MODE: OFF
  • postgreSQL: C:\Program Files\PostgreSQL\12\bin
  • PROCESSOR_ARCHITECTURE: AMD64
  • PROCESSOR_IDENTIFIER: Intel64 Family 6 Model 165 Stepping 5, GenuineIntel
  • PROCESSOR_LEVEL: 6
  • PROCESSOR_REVISION: a505
  • 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: C:\Program Files\JetBrains\PyCharm Community Edition 2021.1.1\bin;
  • PYTHONPATH: C:\Users\lco73\Desktop\Python\Convolutional_neural_network-master
  • SystemDrive: C:
  • SystemRoot: C:\Windows
  • TEMP: C:\Users\lco73\AppData\Local\Temp
  • TMP: C:\Users\lco73\AppData\Local\Temp
  • USERDOMAIN: CHENONN
  • USERDOMAIN_ROAMINGPROFILE: CHENONN
  • USERNAME: lco73
  • USERPROFILE: C:\Users\lco73
  • windir: C:\Windows
  • ZES_ENABLE_SYSMAN: 1

Traceback (most recent call last): File "C:\Program Files\PostgreSQL\12\pgAdmin 4\web\pgAdmin4.py", line 98, in app = create_app() File "C:\Program Files\PostgreSQL\12\pgAdmin 4\web\pgadmin_init_.py", line 347, in create_app if not os.path.exists(SQLITE_PATH) or get_version() == -1: File "C:\Program Files\PostgreSQL\12\pgAdmin 4\web\pgadmin\setup\db_version.py", line 19, in get_version return version.value AttributeError: 'NoneType' object has no attribute 'value'

6 Answers

I've been struggling with this problem for quite sometime.

Here's the steps you have to follow for Windows:

  1. Go To Add or Remove programs, you can find this in search
  1. Search for postgreSQL
  1. Click on uninstall and when promoted click something like "individual components"
  1. Click on PgAdmin4 and uninstall it.
  1. Once step 4 is done then run pgAdmin as administrator. MAKE SURE TO RUN AS ADMINISTRATOR that's the only time it worked for me

I found the solution, if you are first time using PostgreSQL and new to SQL stuff, probably there is some python module not installed. Go to the folder C:(YourUserFolder)\PostgreSQL\pgAdmin 4\web and run setup.py using terminal. It will list down the module missing when you run. Install the modules and run again to see which other module is missing. Or you can use an IDE that can check which module that is not install in the _ init _.py files in the "PostgreSQL\pgAdmin 4\web\pgadmin" folder.

Another aspect:

  1. Just go to environment variables in windows cPanel.
  2. Open Path variable
  3. Check if there any C:\Program Files\PostgreSQL values
  4. Remove them, and restart pgAdmin.

I faced the issue "The pgAdmin 4 server could not be contacted" when re-installing PostgreSql on a Windows 7 machine that I need to keep using for certain reasons.

Obviously Windows 7 is not supported anymore in newer PostgreSQL 10-versions. Seems to be an issue with a missing flask-Module of the Python framework that is delivered with pgAdmin, perhaps the reason behind is the VPN I'm working in doesn't allow to download modules. Didn't get deeper into it.

First tried to run version 10.20-2 x64. Later it turned out that older version 10.12-2 x64 is working on Windows 7. Searched on the net for a download of older postgresql-10.12-2-windows-x64.exe, found it here https://soft.uclv.edu.cu/Postgres/

Also see https://www.pgadmin.org/download/pgadmin-4-windows/

"pgAdmin is available for 64 bit Windows™ 7 SP1 (desktop) or 2008R2 (server) and above, up to v4.30."

Solution:: "The pgAdmin 4 server could not be contacted:" error served to you if you are using Postgre SQL for the first time. Some Python libraries are missing from your system. Try to install those libraries first in the "C:\Program Files\PostgreSQL\14\pgAdmin 4\web" root folder using the window or any other terminal. And then restart the Postgre\PgAdmin4. The fatal error will be resolved.

Got a same error. After reinstalling the whole thing and trying the other solutions I basically on did the following:

  1. Installing Python
  2. Cleaning the %temp% file.
Related