13

I installed PostgreSQL on Windows 10 and the server appears to be in Task Manager. However, I get this error when opening pgAdmin4:

Failed to connect to the pgAdmin application server. Click here to try again.

Any ideas for what the problem is?

Ben Dent
  • 131
  • 1
  • 1
  • 5
  • Is there any further information in the event viewer? How are you trying to connect to the service, through a browser? – Burgi Jul 11 '16 at 08:08

4 Answers4

14

Did you try running the pgAdmin application as an administrator ? I was having the same issue, but ran the application as an administrator and was able to connect.

Ritz
  • 141
  • 1
  • 3
8

I installed pgAdmin 4 via the EnterpriseDB PostgreSQL installer as well as the stand-alone Windows installer and had the same problem both times. Then I came across this: https://www.pgadmin.org/docs4/dev/desktop_deployment.html

It seems the Windows installer configures pgAdmin for server mode, and we need to switch it to Desktop mode. Why the installer does not have an option for this I do not know.

You should be able to getting it working by doing the following:

  • Modify config_local.py file in web folder, adding SERVER_MODE = False
  • Install python for windows, checking the box to add it to your path
  • Install the python packages necessary to run setup.py (see below)
  • Delete C:\Users\%USERNAME%\AppData\Roaming\pgAdmin\pgadmin4.db since upgrade mode seems to not work.
  • Run python setup.py from any command prompt

Here are the python packages I think I installed to get setup.py to work

pip install flask
pip install flask_security
pip install flask_babel
pip install django-htmlmin
pip install python-dateutil
pip install flask_sqlalchemy
rougou
  • 181
  • 1
  • 2
7

I had the same problem with pgAdmin 4 1.6 on Windows 7. The solution was simply to delete %appdata%\pgAdmin which was created by an earlier version. On systems other than Windows, there probably is a pgAdmin directory in your user directory. Of course, all session settings etc. are gone after deleting this.

  • This worked for me on Windows 10 – Vincent McNabb Jul 19 '17 at 00:59
  • This also worked for me on Windows 10 after having installed pgAdmin 4 v2 RC. The v2 Release Candidate didn't work fine for me and when I wanted to use pgAdmin 4 1.6 it showed the message "application server could not be contacted". Deleting %appdata%\pgAdmin solved the problem. – equalium Oct 02 '17 at 07:56
0

I had the same problem with pgadmin 3.0 on windows server 2016. What I did is not actually a solution but solved my problem at, least. I switch to an older version 2.1 that worked like a charm.

WSK
  • 131
  • 2