32

i have recently installed pgadmin4 onto my laptop and when I launch the application, it just gets stuck on the loading. I had a look at the logs and this is what I see:

Screenshot of loading screen

The logs

2020-11-14 00:22:46: Checking for system tray...
2020-11-14 00:22:46: Starting pgAdmin4 server...
2020-11-14 00:22:46: Creating server object, port:64222, key:2a079549-63da-44d2-8931-efa9de3a847f, logfile:C:/Users/yonis/AppData/Local/pgadmin4.d41d8cd98f00b204e9800998ecf8427e.log
2020-11-14 00:22:46: Python Path: C:/Program Files/PostgreSQL/13/pgAdmin 4/venv/Lib/site-packages;C:/Program Files/PostgreSQL/13/pgAdmin 4/venv/DLLs;C:/Program Files/PostgreSQL/13/pgAdmin 4/venv/Lib
2020-11-14 00:22:46: Python Home: C:/Program Files/PostgreSQL/13/pgAdmin 4/venv
2020-11-14 00:22:46: Initializing Python...
2020-11-14 00:22:46: Python initialized.
2020-11-14 00:22:46: Adding new additional path elements
2020-11-14 00:22:46: Redirecting stderr...
2020-11-14 00:22:46: stderr redirected successfully.
2020-11-14 00:22:46: Initializing server...
2020-11-14 00:22:46: Webapp Path: C:/Program Files/PostgreSQL/13/pgAdmin 4/web/pgAdmin4.py
2020-11-14 00:22:46: Server initialized, starting server thread...
2020-11-14 00:22:46: Open the application code and run it.
2020-11-14 00:22:46: Set the port number, key and force SERVER_MODE off
2020-11-14 00:22:46: PyRun_SimpleFile launching application server...
2020-11-14 00:22:47: Application Server URL: http://127.0.0.1:64222/?key=2a079549-63da-44d2-8931-efa9de3a847f
2020-11-14 00:22:47: The server should be up. Attempting to connect and get a response.
2020-11-14 00:22:53: Attempt to connect one more time in case of a long network timeout while looping
2020-11-14 00:22:53: Everything works fine, successfully started pgAdmin4.
Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
Yonis Mohamoud
  • 321
  • 1
  • 3
  • 3
  • 1
    Where can this log file be found? I have the same problem and the registry change didn't fix it. **Edit:** The log is available by right-clicking the notification area icon and selecting "View log". – Medinoc Dec 01 '20 at 10:49
  • 1
    Duplicate of [pgadmin 4 v4.28 keeps loading](https://stackoverflow.com/questions/64840826/pgadmin-4-v4-28-keeps-loading) – Lynn Crumbling Dec 14 '20 at 20:04
  • @Medinoc I did not understand where this log file can be found? – Singh Nov 30 '21 at 09:09
  • 1
    @Singh On the machine where PgAdmin runs, there's a PgAdmin icon in the taskbar's notification area. Right-clicking this icon shows a menu, with an option "View log". – Medinoc Nov 30 '21 at 09:27
  • I see no such icon. Any other thoughts one where the log can be found? – J Brun Mar 01 '22 at 22:14

10 Answers10

29

Have a look at following link: https://www.postgresql-archive.org/pg-Admin-4-v4-28-Errors-on-launch-td6162407.html I think this is the fix you need

Hi All We were not able to reproduce this issue on any of our machines during pre-release testing for v4.28. Then after some R&D, we are able to reproduce this issue. Cause of the problem: if value of "HKEY_CLASSES_ROOT.js\Content Type" is set to "text/plain" then issue is reproducible. In any javascript file, the content type should be “text/javascript” in the response header but in the above registry setting it is "text/plain", so the browser won't allow it. Solution: Open the registry and changed the value of "HKEY_CLASSES_ROOT.js\Content Type" to "text/javascript".

Update:

PgAdmin4 5.0 is out now, you can check it out here. It seems this problem is no longer an issue. take a look at my screen shot below: enter image description here

My registry value is still "text/plain" and my PgAdmin works as below shows:

enter image description here

So, if you still have this problem, try upgrade to PgAdmin4 5.0.

Rusted Wizard
  • 435
  • 3
  • 8
  • 1
    I can confirm that this does solve the issue for me, but I'd love to understand why this is occurring in the first place, if anyone can offer a good explanation? Why does 4.27 work fine until 4.28 gets installed and then you've got issues all of a sudden with both these versions!? – André Engelbrecht Nov 16 '20 at 16:12
  • @AndréEngelbrecht, I think this link should help you: https://www.pgadmin.org/faq/#12. Quote directly from the website: "pgAdmin 4 v4.28 includes additional security features, one of which is intended to prevent security issues caused by Content Sniffing." This is something new to pgAdmin 4 v4.28 which is not in v4.27 and that's the part does not work in Windows 10 due to registry misconfiguration. – Rusted Wizard Nov 20 '20 at 00:10
  • Noted. Thanks @Rusted Wizard – André Engelbrecht Nov 23 '20 at 14:29
  • thanks for your help guys. I ended up downloading DBeaver and it works perfectly. – Yonis Mohamoud Nov 24 '20 at 22:38
  • For me this fixed the issue only for Mozilla Firefox. Unfortunately Microsoft Edge and Google Chrome still won't load pgAdmin. – Medinoc Dec 01 '20 at 10:52
  • 2
    "HKEY_CLASSES_ROOT.js\Content Type" to "text/javascript" fixed the issue for me. Thanks! – EMR Dec 01 '20 at 15:25
  • This should be the accepted answer. I am using Firefox 83.0 (64-bit) and this solved the issue. – Rafs Dec 09 '20 at 11:15
  • This is not good. Having to change registry settings for a (completely unnecessarily) web GUI to work is NOT OK. – Yanick Salzmann Feb 09 '21 at 17:25
17

with according with this fix explain here

If someone have this problem on windows, first the reason of that is the value of "HKEY_CLASSES_ROOT\.js\Content Type" is set to "text/plain" on registry manager and windows not accept it. Now change that value to "text/javascript" it all.

Shut down the pgAdmin server to see those changes.

Now all can work fine, you don't have to uninstall anything or downgrade anything.

Mbambadev
  • 729
  • 1
  • 7
  • 26
  • You saved me a lot of time. Thanks. – Orion Cygnus Dec 25 '20 at 18:04
  • 1
    To change this, go to the Start menu, search for and select `regedit`. This will open the Registry Editor. From there you can open HKEY_CLASSES_ROOT, scroll down and find `.js`, open Content Type and then change the value data field to say `text/javascript`. – Normajean May 29 '21 at 08:23
4

Same problem with v4.28 get stuck loading screen. and v4.27 cannot open, it crashes. now I downgrade to v4.26 it's ok

  • Happened to me too, left me confused, upgraded PostgreSQL to no avail. Good to know it's not only me. However, [this reply](https://stackoverflow.com/a/64837430/3429115) solves the issue. – Rafs Dec 09 '20 at 11:18
3

On the official FAQ a solution is outlined here (& why it happens): https://www.pgadmin.org/faq/#12

Jeff
  • 31
  • 2
3

TL; dr: (new solution recommended by PGAdmin maintainers)

You can add the following lines to the " config_distro.py " and restart the pgAdmin 4 server:

import mimetypes
mimetypes.add_type('text/javascript', '.js')

For the long version:

See this answer for the long explanation.

Lynn Crumbling
  • 12,985
  • 8
  • 57
  • 95
3

Version 4.29 is available. Install it instead of 4.28. It works.

https://www.postgresql.org/ftp/pgadmin/pgadmin4/v4.29/windows/

Adeptus
  • 79
  • 4
2

The previous answers mentioning config.py and config_distro.py are almost there but according to https://www.pgadmin.org/docs/pgadmin4/4.28/config_py.html perhaps the best file to use is config_local.py. This is applied after the config.py and config_distro.py settings are applied. As this file is not distributed with the installation, it won't be overwritten on an upgrade.

In Windows, depending on your version number and installation location, these can be located in the "%programfiles%\PostgreSQL\13\pgAdmin 4\web" folder for example.

So to fix this issue, create a file config_local.py in the same location as config.py and insert the following lines:

import mimetypes
mimetypes.add_type('text/javascript', '.js')

Finally, restart the postgresql server and you should be good as gold!

Wes
  • 420
  • 5
  • 6
0

I also had the same issue, it was working normally and suddenly stopped to work. I tried lots of different approaches, updating version, uninstall/install, and others, but nothing changed, just an HTML screen with 6 links not working and a message saying PGadmin was loading.... finally I tried to turn off my adblocker, and it worked. Probably it is some issue regarding an update from the adblocker or PGAdmin

0

None of the above suggestions works for me as our setup is like where Azure Application Gateway is in front of pgadmin deployed on AKS, and updating the following config resolves the issue for us, created extra file with the name config_distro.py

  X_CONTENT_TYPE_OPTIONS = ""    # default value is nosniff
  ENHANCED_COOKIE_PROTECTION = False
  X_XSS_PROTECTION = "0"  # default value is '1; mode=block'

For detailed description of these properties check below URL https://www.pgadmin.org/docs/pgadmin4/latest/config_py.html

ImranRazaKhan
  • 1,955
  • 5
  • 33
  • 74
0

If someone still facing the issue after trying everything, just follow these steps.

  1. Uninstall the pgAdmin that you installed with Postgresql package (You can uninstall just pgAdmin without uninstalling whole package).
  2. Download pgAdmin separately from here and install.
  3. restart the postgresql server

This worked for me.

Sahan
  • 176
  • 5