Skip to content

Instantly share code, notes, and snippets.

Revisions

  1. bugra455 renamed this gist Apr 6, 2025. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. bugra455 revised this gist Apr 6, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion .md
    Original file line number Diff line number Diff line change
    @@ -23,6 +23,6 @@ Mine looks like this, yours will too:

    Note the UID and GID values and

    ```sudo chown -R <UID that you should have noted>:<GID that you should have noted> <path of your storage folder.>
    ```sudo chown -R <UID that you should have noted>:<GID that you should have noted> <path of your storage folder.>```

    Reboot your containers and is should be solved!
  3. bugra455 revised this gist Apr 6, 2025. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions .md
    Original file line number Diff line number Diff line change
    @@ -18,6 +18,7 @@ To solve that, we just need to give our container users required reading and wri

    Firstly we have to open our containers shell by ```docker exec -it <container with pgadmins id> bash``` and exec ```id```
    Mine looks like this, yours will too:

    ![image](https://gist.github.com/user-attachments/assets/dd06beec-bdcc-40f2-a83a-e2ad71d7107b)

    Note the UID and GID values and
  4. bugra455 created this gist Apr 6, 2025.
    27 changes: 27 additions & 0 deletions .md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    Hello.

    Since you are here, you are having trouble accessing your PGAdmin container that you created with docker and one of the reasons is this writing error.

    Lets read the error first, if you came here by luck and dont know what causes you to cant access your pgadmin container lets try writing ```docker logs <container with pgadmins id>``` to our terminal first.

    ```bash
    [2025-04-06 11:17:23 +0000] [502] [INFO] Worker exiting (pid: 502)
    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/9.2/config.py.html
    [Errno 13] Permission denied: '/var/lib/pgadmin/sessions'
    [2025-04-06 11:17:23 +0000] [1] [ERROR] Worker (pid:502) exited with code 1 [ 2825-04-06 11:17:23 +0000] [1] [ERROR] Worker (pid:582) exited with code 1.
    [2025-04-06 11:17:23 +0000] [503] [ΙΝNFO] Booting worker with pid: 503
    ```
    this log means pgadmin cant write data to data directory of PgAdmin. In my case, i have a folder called ```~/docker-data``` and it stores my docker stuff that i just didnt want to install locally on my system to manage versions, easy uninstallation/reinstallation and stuff.
    Inside of that i have a directory called ```pgadmin-data``` that stores my pgadmin stuff.

    To solve that, we just need to give our container users required reading and writing access by using ```chown```

    Firstly we have to open our containers shell by ```docker exec -it <container with pgadmins id> bash``` and exec ```id```
    Mine looks like this, yours will too:
    ![image](https://gist.github.com/user-attachments/assets/dd06beec-bdcc-40f2-a83a-e2ad71d7107b)

    Note the UID and GID values and

    ```sudo chown -R <UID that you should have noted>:<GID that you should have noted> <path of your storage folder.>
    Reboot your containers and is should be solved!