Search code examples
dockerpgadmin-4

pgadmin4 6.19 'AnonymousUser' object has no attribute 'username'


Since the very last (at the time of writing) pgAdmin4 upgrade (from 6.18 to 6.19) in its Docker image, I'm facing an this issue when spinning up the container from scratch: 'AnonymousUser' object has no attribute 'username'

Here are the complete docker logs during startup between those two versions:

  • 6.18:
pgadmin4  | NOTE: Configuring authentication for SERVER mode.
pgadmin4  |
pgadmin4  | pgAdmin 4 - Application Initialisation
pgadmin4  | ======================================
pgadmin4  |
pgadmin4  | ----------
pgadmin4  | Loading servers with:
pgadmin4  | User: postgres@localhost
pgadmin4  | SQLite pgAdmin config: /var/lib/pgadmin/pgadmin4.db
pgadmin4  | ----------
pgadmin4  | Added 8 Server Group(s) and 31 Server(s).
pgadmin4  | [2023-01-17 14:05:01 +0000] [1] [INFO] Starting gunicorn 20.1.0
pgadmin4  | [2023-01-17 14:05:01 +0000] [1] [INFO] Listening at: http://[::]:5050 (1)
pgadmin4  | [2023-01-17 14:05:01 +0000] [1] [INFO] Using worker: gthread
pgadmin4  | [2023-01-17 14:05:01 +0000] [94] [INFO] Booting worker with pid: 94
  • 6.19:
pgadmin4  | NOTE: Configuring authentication for SERVER mode.
pgadmin4  |
pgadmin4  | pgAdmin 4 - Application Initialisation
pgadmin4  | ======================================
pgadmin4  |
pgadmin4  | ----------
pgadmin4  | Loading servers with:
pgadmin4  | User: postgres@localhost
pgadmin4  | SQLite pgAdmin config: /var/lib/pgadmin/pgadmin4.db
pgadmin4  | ----------
pgadmin4  | 'AnonymousUser' object has no attribute 'username'
pgadmin4  | [2023-01-17 14:08:45 +0000] [1] [INFO] Starting gunicorn 20.1.0
pgadmin4  | [2023-01-17 14:08:45 +0000] [1] [INFO] Listening at: http://[::]:5050 (1)
pgadmin4  | [2023-01-17 14:08:45 +0000] [1] [INFO] Using worker: gthread
pgadmin4  | [2023-01-17 14:08:45 +0000] [92] [INFO] Booting worker with pid: 92

The problem occurs both on Windows 10 and Ubuntu 22.04.1 LTS

Any hint on how to solve this?

Because now, the servers.json file with my 8 configured server groups doesn't seem to be taken into account anymore when I spin up the container, and I end up with an empty server list:

enter image description here


Solution

  • This is known issue in 6.19. Fix will be available in 6.20 release. Currently you use daily snapshot build.. Alternatively, you can import/export servers options from UI. Tools > Import/Export Servers. Refer to link.