How to get pgadmin4 working while waiting for a new update

I would like to share my experience with pgadmin4 on OpenSuse those last weeks, and the solution I finally opted for.

As I mentioned in a previous thread, last version (4.26) didn’t work, because it asked for credentials I could not give, having not defined any before. I saw no other post about that problem, so it could possibly be related to my own configuration.

So I fell back to 4.22… but a new update (to 4.26) went with a bug I filed to bugzilla (https://bugzilla.opensuse.org/show_bug.cgi?id=1176955).

I need a working pgadmin4 everyday, because I am working on a fairly large project (at least for me !), a part of it is already in production, and it is my favorite tool for handling postgresql databases. So I’ve been looking for a plan B, the time for an update to fix the issue on the repository package. I do not expect a rolling release distro to provide free-of-bugs packages all the time and for each one, and after all I could have chosen a stable release such as Leap 15.2. But I need rescue solutions, and if you are like me, here’s what you can do in the meanwhile. I have tested : it works.

The solution resides simply on the official site of pgadmin - https://www.pgadmin.org/download/pgadmin-4-python/ . It takes less than 10 minutes to get it installed. Briefly said, you install a virtual environment with python3, install pgadmin4 with pip, create directories in /var and give the current user access to them (I do not like to make the current user own directories outside of /home, but it is officially asked for, so…). You can locate the venv directory where you want under /home/<user>, for example in ~/bin.

I uninstalled all previous installations and cleaned up all pgadmin remnants on my system prior to this installation, by simply deleting related directories and files, especially in /var and /home/<user> (hidden directories).

Launch pgadmin4 on command-line as explained, and you will be prompted for an email as login and a password which will remain as your pgadmin4 account credentials. They will be requested at connection. Then pgadmin4 will open at 127.0.0.1:5050 in your browser.

Of course as usually, you’ll have to create a server. Be careful about the username you provide for it because the default is the first part of the email address you gave, and you could prefer another name (like your $USER for example ;)).

It is a good solution while you are waiting for the bug to be fixed on the official package of your distro, but it has somme drawbacks too : you must activate the virtual environment and then launch pgadmin 4 on command-line (except if you write a little script to handle it) and you have to update manually. And you mustn’t use this type of installation for production purposes.

Hope it can help someone.

Erik.

Hy Erik, I am more or less in your same situation (I can’t use pgAdmin4 anymore because it asks me for a username/password that I don’t have). Thanks for sharing your solution but it sounds to me little bit tricky because I don’t know much about python and pip and I wouldn’t want fall in a bigger problem tryng to fix the pgAdmin4 one :slight_smile:
Did you opened a bug for this on the Opensuse bugzilla?
I saw somewhere that pgAdmin4 can be set up in two modes; ‘server’ mode and ‘desktop’ mode. Server mode seems the default mode but it has the username/password problem, whereas desktop mode should start without asking for credentials. Did you explore this option?
Thanks in advance,
Marco

@mark_opensuse

I’m really sorry that I did’nt see your post in time, having been extremely busy since then and not at all on the forum. (BTW I’m surprised that I didn’t get any notification… I don’t remember whether it is possible or not, I’ll have a look).

If you found answers to your questions, you could share them with us anyway, it will let our common knowledge grow - not sure I could have brought answers myself anyway.

Cheers,
Erik.