Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PermissionError when deploying HPX #254

Open
Olmarq opened this issue Apr 5, 2021 · 1 comment
Open

PermissionError when deploying HPX #254

Olmarq opened this issue Apr 5, 2021 · 1 comment

Comments

@Olmarq
Copy link

Olmarq commented Apr 5, 2021

I'm probably experiencing the same issue as in #218

TERM environment variable not set.  
[8] Failed to execute script run
Traceback (most recent call last):
  File "run.py", line 7, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "/home/travis/virtualenv/python3.7.9/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
  File "happypanda/main.py", line 25, in <module>
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "/home/travis/virtualenv/python3.7.9/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
  File "happypanda/common/clsutils.py", line 704, in <module>
  File "happypanda/common/clsutils.py", line 697, in setup_internal_db
  File "happypanda/common/clsutils.py", line 629, in __init__
  File "os.py", line 223, in makedirs
PermissionError: [Errno 13] Permission denied: '/data/data'

And this is my docker-compose.yaml

version: '3'

services:
  happypandax:
    image: twiddly/happypandax:latest
    # start this container automatically on boot
    restart: unless-stopped
    ports:
      - "7006:7006"
      - "7007:7007"
      - "7008:7008"
    volumes:
      - /srv/dev-disk-by-uuid-3bbf2658-8f62-48c2-a06a-a4398ef59eb1/docker/happypandax:/data
      - /srv/dev-disk-by-uuid-3bbf2658-8f62-48c2-a06a-a4398ef59eb1/Research/Gallery:/content
    links:
      - db

  db:
    image: postgres:latest
    restart: unless-stopped
    ports:
      - 7005:5432
    environment:
      POSTGRES_USER: 'happypandax'
      POSTGRES_PASSWORD: 'postgres'
    volumes:
      - database:/var/lib/postgresql/data
    logging:
      driver: none

volumes:
  database:
    driver: local

I'm running openmedavault and using portainer to deploy HPX. The folder dev-disk-by-uuid-3bbf2658-8f62-48c2-a06aa4398ef59eb1 is a shared folder on a raid I created in the omv webgui.
In #218 it is mentioned to create the happypandax user outside the docker, so I performed

$ sudo adduser --group --system happypandax
Adding system user `happypandax' (UID 113) ...
Adding new group `happypandax' (GID 118) ...
Adding new user `happypandax' (UID 113) with group `happypandax' ...
Creating home directory `/home/happypandax' ...
$  $ id happypandax
uid=113(happypandax) gid=118(happypandax) groups=118(happypandax)

I gave the new user and group r/w access to the shared folder through ACL.
In a ssh session I sued to the happypandax user to verify that it can r/w it, but the error persists.

Edit:
Ok so after reading a bit about docker I understand that it does not care for names, only for gids and uids so the newly created user obviously does nothing.
I would need to give the user/group with id 101 permissions, but that's not really a solution. Currently systemd stuff is using these ids and I really don't feel comfortable changing those around.
And even if I would reassign the id to the happypandax user, I would have the same problem all over again if I want to deploy another image that creates a new user that needs access to some other volume.

@Olmarq Olmarq closed this as completed Apr 6, 2021
@Olmarq Olmarq reopened this Apr 6, 2021
@twiddli
Copy link
Member

twiddli commented May 25, 2021

refer to #243

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants