pgAdmin 4 v3.0 Query Tool Initialize Error

scook picture scook · May 15, 2018 · Viewed 10.7k times · Source

I recently got a new laptop and downloaded pgAdmin 4 v3.0. Before now, I had been running pgAdmin 4 v2.0 with no issues. However, now whenever I try to open the Query Tool (just by going through the drop down Tools menu), I receive the error message "Query Tool Initialize Error". The Query Tool worked for two or three queries after the initial error message, but has been returning the error message whenever selected in the days since then. I am able to create and edit tables and views, but only by right clicking the icons on the left-hand side of the screen. I tried uninstalling and reinstalling pgAdmin to no effect.

Has anyone encountered this issue before?

Query Tool Initialize Error

Answer

m2web picture m2web · May 24, 2018

In Ubuntu 16.04 I updated my pgAdmin 4 version 2.1 to 3.0 and saw the same thing when attempting to open the Query Tool through the drop down menus. While this is not a fix, instead of browsing to http://12.70.0.1:5050 I changed the URL to http://localhost:5050. Then I was able to use the Query Tool via the drop down menus.

Edit: What I did was edit the pgAdmin4/lib/python3.5/site-packages/pgadmin4/config.py file by updating the line:

DEFAULT_SERVER = '127.0.0.1'

to

DEFAULT_SERVER = 'localhost'

Now when I open pgAdmin, the Query Tool works accordingly.