5

I had been running pgadmin4 v2.0 with no issues. This is happen when i upgraded my postgresql to 10.4 I have encountered a problem where pgadmin 4 v3.0 cannot initialize Query toolsQuery Tool Initialize Error I have uninstall and reinstall the postgresql multiple times but it didn't solve this problem yet. i also have downgraded the pgadmin4 to v2.0, unfortunately that the pgadmin4 v2.0 now cannot initialized anymore. I don't know what cause this problem.

I have searched the solution through internet but only find the solution for Ubuntu User

Has anyone ever encounter this problem also for windows 10 x64 user? Please help...

Iwan Tantoso
  • 63
  • 1
  • 6

5 Answers5

2

I get the same message when clicking "Query Tool" menu.

If you keep trying this action over and over you may eventually get to the query tool. Sometimes (rarely) it works. You will spawn may processes though in trying this approach. Check the dashboard to see/kill the processes spawned on each launch attempt of the query tool. I have found no other way to get to the query tool. I also cannot revert back to pgAdmin4 version 2. There is no info in the browser dev tools console and I see no info in the pgAdmin4 logs when I click the query tool menu. As stated in another forum using the File/Reset Layout menu may work to fix this issue. I have had limited success with this though.

I am using: pgAdmin4 version3. Windows 10 Pro. PostgreSQL 9.3, 9.6, and 10. FireFox 60.0.1, Microsoft Edge 41.16299.402.0, and Google Chrome (latest version).

user3613316
  • 106
  • 1
  • 4
1

As the answer from pgAdmin 4 v3.0 Query Tool Initialize Error suggests, you need to edit the config.py file from your Windows location. Mine looks like this "C:\Program Files (x86)\pgAdmin 4\v3\web" and there you have a line with:

DEFAULT_SERVER = '127.0.0.1'

it should be changed to

DEFAULT_SERVER = 'localhost'

Than don't forget to restart the pgAdmin from the tray. I think it is related to the fact that your postgres database when installed was installed as a 'localhost' instead of '127.0.0.1'.

Hope this helps

UPDATE: I also found out that this solution doesn't work when you're using a firewall.

Monomachus
  • 1,448
  • 2
  • 13
  • 22
0

Thank you for your suggestion user3613316 I have followed your instruction, it is indeed that i have to spawn the Query Tool over and over in order to enter the Query Tool menu.

It sometimes take over 15 or 20 times of this action in order to enter "Query Tool" menu. I am using keyboard shortcut Alt+Shift+Q in order to proceed faster.

Iwan Tantoso
  • 63
  • 1
  • 6
0

I found to get this working there are several things which need to be checked:

  1. web server logs
  2. postgresql logs
  3. browser console outputs

If your web server (unless you are accessing pgadmin4 port directly) is proxying the correct port with all correct options. I use nginx and this is working fine with:

server
  {
    server_name db.serv1;
    listen 443 ssl http2;

    ssl_certificate /etc/letsencrypt/live/myserver.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/myserver.com/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/myserver.com/fullchain.pem;

    location /
    {
      proxy_pass http://127.0.0.1:5050;
      proxy_http_version 1.1;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header Host $host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
    }
  }

Make sure that you X-Frame-Options are not set to "DENY". This is sometimes set on browsers as a click jacking prevention. Otherwise it will block the frame in which the Query Tools window opens in. You can check this with your web tools "inspection" or open up your console output for your browser.

The error message I got was somewhere along the lines of "X-Frame-Options set to 'DENY'" and the browser page displayed "FAILED TO CONNECT".

If you have differences in "localhost" versus "127.0.0.1" or similar types of differences between your permissions settings and connection options, this can create a conflict. Ensure that you server connection parameters you specify in pgadmin4 fit the connection settings in pga_hba.conf (localhost is not always the same as 127.0.0.1). They should be exact and that will eliminate the variable of permissions versus connection type.

I found that sometimes specifying localhost versus 127.0.0.1, that localhost in some instances connects through the Unix-domain socket connection rather than tcp.

0

Had similar hanging problems with the latest pgAdmin 4-4.13; tried all the suggestions but it didn't work. Rolled back to 4-4.6, and everything went back to normal. Wasted some time!

Nathan W
  • 471
  • 1
  • 7
  • 17