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?

1
  • Is there any further information in the event viewer? How are you trying to connect to the service, through a browser?
    – Burgi
    Jul 11, 2016 at 8:08

4 Answers 4

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.

2
  • the correct answer.. worked for me atleast.
    – sohaiby
    Nov 21, 2016 at 14:41
  • wow.. that saved me reinstall of pgadmin for second time.. thank you! Aug 2, 2018 at 14:21
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
2
  • You saved me a lot of time!
    – cybersoft
    Dec 17, 2016 at 16:10
  • You saved me days of work !!
    – Toren
    Jan 5, 2019 at 11:19
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.

2
  • This worked for me on Windows 10 Jul 19, 2017 at 0: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 2, 2017 at 7: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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.