Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pg4admin 401 Unauthorized Error

I just installed the desktop version of pg4admin after having difficulty running it using my prior install. I used the following installing documentation to pull this off.

However, when I run the pgadmin4 service, the page gives my the following error:

Unauthorized

The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required.

Also, on the terminal I'm getting the following exception:

Starting pgAdmin 4. Please navigate to http://localhost:5050 in your browser.
2016-11-01 01:14:41,981: ERROR	pgadmin:	The desktop user [email protected] was not found in the configuration database.
2016-11-01 01:14:42,004: ERROR	pgadmin:	The desktop user [email protected] was not found in the configuration database.
2016-11-01 01:18:45,650: ERROR	pgadmin:	The desktop user [email protected] was not found in the configuration database.
2016-11-01 01:18:45,664: ERROR	pgadmin:	The desktop user [email protected] was not found in the configuration database.

Did I miss anything in the install process? What can I do to fix this issue?

like image 493
Adam Steinberger Avatar asked Nov 01 '16 05:11

Adam Steinberger


3 Answers

In my case the problem is Internet Explorer Enhanced Security Configuration (IE ESC) (btw my OS is Windows Server 2012 R2)

Go to Server Manager, choose Local Server from the left pane. On the right pane, there is "IE Enhanced Security Configuration", the status is "on".
Click on that On, choose Off (I turned off for both the Administrators and Users, I guess one of them should be enough but I was not sure which one).
Click OK, then click the refresh button on top (or close the server manager). Refresh the pg admin4 page (or if that does not work, right click on pg Admin4 system tray icon, then choose "New PgAdmin4 window").

like image 158
Leonard AB Avatar answered Nov 13 '22 11:11

Leonard AB


@Leonard AB
Thanks for the solution. Worked for me. After confirming that was the issue rather than leave IE Enhanced Security Configuration off I white listed http://127.0.0.1.

Within IE:

  1. Click on the Cog and the top right of the browser or go to Internet Options via Control Panel
  2. Click on the Security tab and select Trusted sites in the zone box and then click on the Sites button
  3. Add http://127.0.0.1 to the list and hit close, finally hit ok and confirm it works

Apologies for not adding this as a comment to your post but I don't have a high enough rep.

like image 23
koax26 Avatar answered Nov 13 '22 13:11

koax26


Delete "pgadmin4.db" file & start pgAdmin4 again.

Linux:

~/.pgadmin/pgadmin4.db

Windows:

%appdata%\pgAdmin\pgadmin4.db

Note: You will lose all of your saved server listing from your previous install.

like image 10
Murtuza Z Avatar answered Nov 13 '22 11:11

Murtuza Z