Here is a patch (first contribution \o/) that solves the issue by importing the servers.json anonymously when running in DESKTOP mode. There may be a better way to check if we are running in DESKTOP mode or not but checking PGADMIN_CONFIG_SERVER_MODE should be enough when running pgadmin4 in docker.
Regards, Olivier Levitt
________________________________________ From: Ashesh Vashi [ashesh.vashi@enterprisedb.com] Sent: 14 December 2019 05:52 To: Levitt Olivier Cc: pgadmin-hackers@postgresql.org Subject: Re: [Pgadmin] [Docker] servers.json import fails when running in desktop mode
When running the docker image in desktop mode (PGADMIN_CONFIG_SERVER_MODE=False), no user is created. That is expected behaviour. But then the code that imports the servers.json pre-configuration fails as it ties the import to the default user.