Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pgadmin 4 v4.28 keeps loading

Tags:

pgadmin-4

I installed pgadmin 4 v4.28 and it keeps loading but does not open, I tried opening it as administrator and it still does not open. I had the older version previously but I have deleted PostgreSQL DB and pg admin properly before I install the above version. can you guys help me out on this? the link I have the screenshot of the problem.

enter image description here

like image 601
Ashraf Yawar Avatar asked Nov 15 '20 03:11

Ashraf Yawar


People also ask

Why is pgAdmin not connecting to server?

If pgAdmin displays this message, there are two possible reasons for this: the database server isn't running - simply start it. the server isn't configured to accept TCP/IP requests on the address shown.

How do you force quit pgAdmin 4?

If you are using pgAdmin 4 on mac OS or Ubuntu, you can use system tool bar (at the top of the screen) icon for this. After you start pgAdmin server the icon with elephant head should appear. If you click it you will have an option Shut down server .

Why is pgAdmin 4 so slow?

Programming languages are not made equal. Python is four times slower than languages like C++ or Java. This could explain that pgAdmin 4 is slow.


2 Answers

Do the following steps to resolve this:

  • Open your registry editor.
  • Change the value of HKEY_CLASSES_ROOT\.js\Content Type from text/plain to text/javascript.
  • Restart the pgadmin server. You can do this by ending the pgadmin background task from the task manager.
like image 133
Harinarayanan K S Avatar answered Sep 24 '22 00:09

Harinarayanan K S


UPDATED ANSWER

PGAdmin has been tracking this as bug 5996. In it, they recommend the following solution:

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') 

The above workaround should work for you.

They also mention:

In the next release, we're looking to include that into the code, so users don't have to do it themselves.

But the answer to your question, the config_distro.py can be overwritten in the subsequent upgrades.

pgAdmin does provide another option to set the settings in the config_system.py file which is intended for system administrator to include settings and which is outside of the pgAdmin installation. Please refer https://www.pgadmin.org/docs/pgadmin4/4.28/config_py.html for more details.


PREVIOUS ANSWER

Another answer had comments asking what caused this/how the author figured it out.

For posterity, this is documented in the FAQ:

When I launch pgAdmin 4 v4.28 or later on Windows, the loading page never closes. Why?

pgAdmin 4 v4.28 includes additional security features, one of which is intended to prevent security issues caused by Content Sniffing.

Unfortunately some Windows systems are misconfigured such that this causes Javascripts used by pgAdmin to fail to load. Opening the developer tools on your browser will show an error similar to this:

> Refused to execute script from > 'http://127.0.0.1:57313/static/vendor/require/require.min.js?ver=42800' > because its MIME type ('text/plain') is not executable, and strict > MIME type checking is enabled. >  > (index):39 Uncaught ReferenceError: require is not defined at > (index):39 

This will occur when the value of the registry key at HKEY_CLASSES_ROOT\.js\Content Type is set to text/plain. To resolve the issue, use the Registry Editor and reset the value of HKEY_CLASSES_ROOT\.js\Content Type to:

text/javascript

Finally, restart the pgAdmin server.

Interestingly enough, GoLang, TensorBoard, Django, and many others have had issues filed regarding this same problem. Browsers are refusing to load content because the browser thinks it is being transferred as 'text/plain', based on the registry configuration.

like image 37
Lynn Crumbling Avatar answered Sep 24 '22 00:09

Lynn Crumbling