9

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 pgadmin4@pgadmin.org was not found in the configuration database.
2016-11-01 01:14:42,004: ERROR	pgadmin:	The desktop user pgadmin4@pgadmin.org was not found in the configuration database.
2016-11-01 01:18:45,650: ERROR	pgadmin:	The desktop user pgadmin4@pgadmin.org was not found in the configuration database.
2016-11-01 01:18:45,664: ERROR	pgadmin:	The desktop user pgadmin4@pgadmin.org was not found in the configuration database.

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

  • Did you ever figure out how to fix this? If yes, please accept the answer that helped you. – Jeff G May 14 '18 at 18:31

10 Answers 10

11

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").

  • I additionally needed to kill all postgresql pgAdmin related processes/services (in TaskManager). Then it worked. – jannikb Aug 25 at 20:32
  • According to @koax26 answer, you can also white list the address instead of turning off the security stackoverflow.com/a/57265347/5122657 – Leonard AB Oct 8 at 4:16
9

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.

  • This is the correct answer IMO. – Mr. Concolato Aug 22 '17 at 16:34
  • It worked! This happens when you have pgadmin3 previously installed. pgadmin4 can't digest some of the old version configuration. To run both version 3 & 4 in parallel I created "~/.pgadmin4" directory instead and pointed ver 4 to it. – oᴉɹǝɥɔ Nov 1 '17 at 21:18
  • 3
    This didn't work for me. I killed the pgadmin4 runtime, deleted the entire ~/.pgadmin folder and relaunched and still same problem. I'm on Antergos and installed the pgadmin4 package, so I'm not familiar with manual desktop setup. – Peter L May 3 '18 at 21:15
6

in linux ubuntu 16.04 copy the adress in the file ~/.pgAdmin4.14570597673959349582.addr into your browser window. Looks like it contains the key.

  • 3
    this is craziness... why doesn't pgadmin4 just open this page... – Jayen Oct 15 '18 at 0:55
  • @Jayen, it is redirecting :) – Aram Paronikyan Mar 26 at 9:30
  • 2
    You can also use "Copy server URL" from the tray icon (pgAdmin 4) – Aram Paronikyan Mar 26 at 12:41
6

Following is working for me (using SolydK):

  • right click on "tray icon"
  • select "Configure"
  • set "Browser Command" (e.g. "/usr/bin/firefox" %URL%)
1

Not an answer but a workaround

I solved it installing the pgadmin4-apache2 package and visiting the http://localhost/pgAdmin4 URL

1

Web-based Pgadmin application uses cookies to store its information.pgAdmin mainly stores 3 cookies namely

  • PGADMIN_KEY
  • PGADMIN_LANGUAGE
  • pga4_session

So, to use the pgAdmin application you must have to enable your browser cookies so that these 3 cookies will stored in your browser.

In Chrome

  • On your computer, open Chrome.
  • At the top right, click More enter image description here and then Settings.
  • At the bottom, click Advanced.
  • Under "Privacy and security," click Site settings.
  • Click Cookies.
  • There click on "Block" toggle button then we will be switched to "Allow sites to save and read cookie data."

Change toggle from block to allow

Then try to open pdadmin4 and you will get your pgAdmin4 home screen.

0

In my case, just adding/setting the environment variable SERVER_MODE=True it worked well.

0

@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.

  • thanks. I linked this into the comment of my answer. – Leonard AB Oct 8 at 4:17
-1

For Windows, another option. Tray icon, right click and select "new pgAdmin window..." and in my case used Yandex.browser

-2

it's simple , just delete file pgadmin from C:\Program Files (x86)\pgAdmin 4 , and C:\Users\acer\AppData\Roaming\pgAdmin , delete the files , all of it , and install it again

  • Uninstalling all the software couldn't be consider as a solution. – olivejp Jun 12 at 22:47
  • yeah actually , but it works for me – akhmadfauzie Aug 19 at 2:44
  • you just have to re-install it once – akhmadfauzie Aug 19 at 2:45

protected by Community Jun 10 at 20:08

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.