pgadmin-org / pgadmin4

pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world.
https://www.pgadmin.org
Other
2.43k stars 636 forks source link

PGadmin4 login doesn't work after upgrade from 4.3 to 8.1 - Ubuntu #7092

Closed shrineanand closed 7 months ago

shrineanand commented 9 months ago

Running PGadmin4 in an Ubuntu machine which was 4.3 version. Upgraded using sudo apt upgrade pgadmin4 command and it was upgraded to 8.1

After upgrade I tried to login to the web application PGadmin4 and I couldn't login. It is not throwing any error in the console or Inspect element.

How to fix this issue

Ubuntu 20.04.1 Postgresql 12 PGadmin4

yogeshmahajan-1903 commented 8 months ago

@shrineanand Can you please share error screenshot? Also can you please share pgadmin logs located at '/var/logs/pgadmin/pgadmin4.log'?

shrineanand commented 8 months ago

@yogeshmahajan-1903 I tried to do an upgrade this morning. Reverted the upgrade change. so the Pgadmin was in the 4.3 version and the Postgres in 12. I have upgraded one of my AWS RDS DB server PostgreSQL engines from 11.19 to 15.2. Tried connecting to the server from PGadmin version 4.3 and got the error. 'ServerManager' object has no attribute 'user_info'****

I noticed the same from pgadmin4.log AttributeError: 'ServerManager' object has no attribute 'user_info' 2024-01-02 04:59:28,139: ERROR flask.app: 'ServerManager' object has no attribute 'user_info' Traceback (most recent call last): File "/usr/pgadmin4/venv/lib/python3.8/site-packages/flask/app.py", line 1813, in full_dispatch_request rv = self.dispatch_request() File "/usr/pgadmin4/venv/lib/python3.8/site-packages/flask/app.py", line 1799, in dispatch_request return self.view_functionsrule.endpoint File "/usr/pgadmin4/venv/lib/python3.8/site-packages/flask/views.py", line 88, in view return self.dispatch_request(*args, kwargs) File "/usr/pgadmin4/web/pgadmin/browser/utils.py", line 313, in dispatch_request return method(args, kwargs) File "/usr/pgadmin4/web/pgadmin/browser/server_groups/servers/init.py", line 1457, in connect 'user': manager.user_info, AttributeError: 'ServerManager' object has no attribute 'user_info' 2024-01-02 04:59:45,055: ERROR flask.app: 'ServerManager' object has no attribute 'user_info' Traceback (most recent call last): File "/usr/pgadmin4/venv/lib/python3.8/site-packages/flask/app.py", line 1813, in full_dispatch_request rv = self.dispatch_request() File "/usr/pgadmin4/venv/lib/python3.8/site-packages/flask/app.py", line 1799, in dispatch_request return self.view_functions[rule.endpoint](req.view_args) File "/usr/pgadmin4/venv/lib/python3.8/site-packages/flask/views.py", line 88, in view return self.dispatch_request(args, kwargs) File "/usr/pgadmin4/web/pgadmin/browser/utils.py", line 313, in dispatch_request return method(*args, **kwargs) File "/usr/pgadmin4/web/pgadmin/browser/server_groups/servers/init.py", line 1457, in connect 'user': manager.user_info, AttributeError: 'ServerManager' object has no attribute 'user_info'

Post that I ran the below command to update PGadmin sudo apt-get update sudo apt-get upgrade

Post that I couldn't log in and not getting any error generated in the console nor the CLI in /var/log/pgadmin/pgadmin4.log In Postgresql log I could see only this error

2024-01-02 05:16:47.355 UTC [22801] FATAL: could not load server certificate file "/etc/letsencrypt/live/xxxxxx/fullchain.pem": Permission denied 2024-01-02 05:16:47.355 UTC [22801] LOG: database system is shut down pg_ctl: could not start server Examine the log output. ~

But the above error seems normal to me as I have noticed this before upgrade as well.

yogeshmahajan-1903 commented 8 months ago

@shrineanand Can you please get output of commands below?

sudo apt list pgadmin4*
sudo systemctl status <apache2.service/httpd.service>

As you are using in web mode, can you please get screenshot of the error?

Also, PostgreSQL logs indicates, postgres server is not up and running.

shrineanand commented 8 months ago

@yogeshmahajan-1903 Please find the details below

ubuntu@XXXXX:~$ sudo apt list pgadmin4* Listing... Done pgadmin4-desktop/pgadmin4,now 8.1 amd64 [installed,automatic] pgadmin4-server/pgadmin4,now 8.1 amd64 [installed,automatic] pgadmin4-web/pgadmin4,now 8.1 all [installed,automatic] pgadmin4/pgadmin4,now 8.1 all [installed]

ubuntu@ip-xxxxxx~$ sudo systemctl status apache2.service ● apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2024-01-03 18:19:47 UTC; 4s ago Docs: https://httpd.apache.org/docs/2.4/ Process: 1263 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS) Main PID: 1267 (apache2) Tasks: 83 (limit: 4671) Memory: 16.8M CGroup: /system.slice/apache2.service ├─1267 /usr/sbin/apache2 -k start ├─1268 /usr/sbin/apache2 -k start ├─1269 /usr/sbin/apache2 -k start └─1270 /usr/sbin/apache2 -k start

Jan 03 18:19:47 ip-xxxxx systemd[1]: Starting The Apache HTTP Server... Jan 03 18:19:47 ip-xxxxx systemd[1]: Started The Apache HTTP Server.

image

Also I could see 302 error in the POST method

khushboovashi commented 8 months ago

Hi @shrineanand,

Can you please share the pgadmin logs located at /var/log/pgadmin/pgadmin4.log ? Also, try browsing the application in incognito mode.

yogeshmahajan-1903 commented 7 months ago

No response from author, hence closing the issue.