Jump to content

[Support] FoxxMD - pgadmin4


Recommended Posts

Application Name: pgadmin4

Application Site: https://www.pgadmin.org/

Github Repo: https://github.com/postgres/pgadmin4

Docker Hub: https://hub.docker.com/r/dpage/pgadmin4/

Template Repo: https://github.com/FoxxMD/unraid-docker-templates

 

Overview

 

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. Some features:

 

  • Designed for PostgreSQL 9.5 and above
  • Access and manage multiple databases
  • CRUD for all the things and raw SQL execution
  • Wizards and graphic tools for many administrative tasks (ACL, backup/restore, etc.)
  • Monitoring dashboard

 

image.thumb.png.bda665507647e14612d35ffcfc7e58b9.png

 

How is this different than the existing CA template for pgAdmin4?

 

 

Initial Setup

 

Regardless of existing or new installation you MUST configure ownership for the directory mapped to appdata under the Config setting in the template. This is due to pgadmin using a non-root user inside the container for operations. Either create the directory manually (defaults to /mnt/user/appdata/pgadmin4) or wait for the container to create it on initial start. Then run this command from the unraid cli (terminal window) to configure ownership:

 

chown -R 5050:5050 /mnt/user/appdata/pgadmin4

 

Thanks @dreadu and @SOULV1CE for figuring this out

 

Usage

 

NOTE: On initial container build there may be a noticeable delay (10-20 seconds) between when the container starts and when the UI becomes available.

 

=== Migrating from fenglc or bringing your own data ===

 

Use the Config path (under "Show More Settings") in the template to map your working directory. If you are migrating from fenglc just use the same folder from appdata.

 

If you use this approach you can safely ignore or remove the Email/Password variables from the template.

 

=== New Installations ===

 

You must provide values for Default Email and Default Password in the template or the container will not start. The email is not actually used, it's just a username. After the container has been started for the first time these variables can be removed from the template.

 

Configuration

 

All other configuration for the container can be found in the pgAdmin docs.

Edited by FoxxMD
added ownership setup
Link to comment
  • 2 weeks later...
  • 3 months later...
13 hours ago, Mattyfaz said:

Is there any current issue with this? A completely fresh install the Username and Password don't work, just always says they are invalid.

I just tried a fresh install and am seeing this issue now...it seems the login attempt is redirecting and then not passing the form data correctly. I'm looking to see if there is any troubleshooting info on this...

 

EDIT: @Mattyfaz can you try setting the Config path to a new (non-existing) location? I was able to login after using a clean path.

Edited by FoxxMD
Link to comment
  • 1 month later...
  • 11 months later...

YOU MUST DO THE FOLLOWING IN ORDER TO RUN THIS DOCKER:

 

After installing the docker container, there should be a folder in appdata on the unraid host named pgadmin4.  You must change the permissions on this folder:

 

Here's how:

 

On the unraid host, click the terminal button at the top right:

image.png.ec6814d8ad88dde74facd05cb66937c1.png

 

When you get a terminal window, set the permissions on the pgadmin4 folder as follows

 

 image.png.fac4109bc747322a047ba23a5e8ddef9.png

  • Thanks 3
  • Upvote 2
Link to comment
  • 6 months later...
On 11/21/2021 at 6:34 PM, bwarlick said:

YOU MUST DO THE FOLLOWING IN ORDER TO RUN THIS DOCKER:

[...]

When you get a terminal window, set the permissions on the pgadmin4 folder as follows

 image.png.fac4109bc747322a047ba23a5e8ddef9.png

 

Thank you very much for that info!

I just updated unraid from 6.9.2 to 6.10.2 and could not figure out why at least one CPU core was stuck at 100%! Did check terminal -> top and could only see COMMAND "gunicorn"- which I could not find anything related to unraid with google. And the user was 5050 (and the only process using it, which baffled me).

 

Then I suspected docker (not runninv VMs currently). First test Plex was not successful, but luckily the second try with pgadmin4 did the trick. When stopping the docker the cpu dropped to ~2-7% instead of permanent 40-100% over all 4 cores.

Then I checked the community application and found your post- which I find interesting- because I did not have this problem before the update.

 

For anybody reading my post: here is the original pgadmin documentation https://www.pgadmin.org/docs/pgadmin4/latest/container_deployment.html#mapped-files-and-directories

 

After your suggestion with

sudo chown -R 5050:5050 pgadmin

and starting the docker again, the PID with COMMAND gunicorn and user 5050 did return, but dropped to 0% CPU after a couple of seconds. I assume it tried to access its appdata folder and gut stuck in a loop to try again. Why this did not happen before the unraid os update is beyond me, but not it's fixed. Thanks again 👍

  • Like 1
Link to comment
  • 1 month later...

Any hope of this docker template being updated/fixed??

 

On a clean new Unraid 6.10.3 install, this docker's webUI doesn't even open.

 

Or is there another way I can restore a backup I took in pdadmin before? File is without extension, not a mysql or dump, or maybe that is a dump, I have no idea what pgadmin saves in by default.

Link to comment
  • 5 months later...
On 8/3/2022 at 2:24 AM, profzelonka said:

Any hope of this docker template being updated/fixed??

 

On a clean new Unraid 6.10.3 install, this docker's webUI doesn't even open.

 

Or is there another way I can restore a backup I took in pdadmin before? File is without extension, not a mysql or dump, or maybe that is a dump, I have no idea what pgadmin saves in by default.

 

I just set this up right now and got the webUI to load.

 

After initial pull I noticed the container stopped so I went into the logs and saw the following error:

Quote

ERROR  : Failed to create the directory /var/lib/pgadmin/sessions:
           [Errno 13] Permission denied: '/var/lib/pgadmin/sessions'
HINT   : Create the directory /var/lib/pgadmin/sessions, ensure it is writeable by
         'pgadmin', and try again, or, create a config_local.py file
         and override the SESSION_DB_PATH setting per
        https://www.pgadmin.org/docs/pgadmin4/6.18/config_py.html

 

I then referenced this section of the pgAdmin docs and ran the following command in my Unraid terminal to set the needed permissions for the pgadmin user:

sudo chown -R 5050:5050 /mnt/user/appdata/pgadmin4

 

Now when I went to start up the pgadmin4 container again all was successful and the webUI launched successfully.

Hope this helps!

Also I just noticed that after I typed all of this out @dreadu posted the same solution before me back in June 2022 that I completely missed because scatter brain🤦‍♂️
Leaving this comment up in case others are like me who miss it as well!

Link to comment
  • 4 weeks later...

I think it's worth to mention that emails on special domains, e.g. [email protected], [email protected], [email protected], etc. may not be used.

What is more confusing is that the setup script will process them fine and create an appropriate user, but webUI won't let you in showing error that the email is not valid. In the container log the error will be more meaningful and say "The domain name ... is a special-use or reserved name that cannot be used with email."

Another concern is that, if such email was set, and pgadmin4 was initialized, it will not be enough to simply change PGADMIN_DEFAULT_EMAIL and PGADMIN_DEFAULT_PASSWORD variables and restart the container. Since setup process is executed only during the first container start, it will be necessary to remove the contents of the /mnt/user/appdata/pgadmin4 directory.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...