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

Missing dependency or permission issue? #56

Open
eq2kazial opened this issue Feb 20, 2025 · 3 comments
Open

Missing dependency or permission issue? #56

eq2kazial opened this issue Feb 20, 2025 · 3 comments

Comments

@eq2kazial
Copy link

eq2kazial commented Feb 20, 2025

Hi, I'm new-ish to docker and getting my feet wet with Linux again. I've been trying for days to get this to work and I'm not informed enough to recognize what the issue might be. Debian 12, docker install. My beets & beets-flask env is set to "/opt/docker" I've verified the permissions are correct for user/group 1000, tho I only have root access to the docker container in "/var/lib/..." as I've read I shouldn't alter those permissions. This is my current output from logs

Updating UID to 1000 and GID to 1000 usermod: no changes
Running as
uid=1000(beetle) gid=1000(beetle) groups=1000(beetle),1000(beetle)
16:C 20 Feb 2025 02:09:44.474 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
70 [INFO] beets-flask - Logging initialized logger.py:23
Traceback (most recent call last):
File "/repo/backend/./launch_redis_workers.py", line 3, in
from beets_flask.config.beets_config import config
File "/repo/backend/beets_flask/init.py", line 9, in
from .config.flask_config import ServerConfig, init_server_config
File "/repo/backend/beets_flask/config/init.py", line 1, in
from .beets_config import config
File "/repo/backend/beets_flask/config/beets_config.py", line 152, in
config = InteractiveBeetsConfig()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/repo/backend/beets_flask/config/beets_config.py", line 47, in call
cls._instances[cls] = super(Singleton, cls).call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/repo/backend/beets_flask/config/beets_config.py", line 64, in init
self.reset()
File "/repo/backend/beets_flask/config/beets_config.py", line 74, in reset
self.read()
File "/usr/local/lib/python3.11/site-packages/beets/init.py", line 30, in read
super().read(user, defaults)
File "/usr/local/lib/python3.11/site-packages/confuse/core.py", line 678, in read
super(LazyConfig, self).read(user, defaults)
File "/usr/local/lib/python3.11/site-packages/confuse/core.py", line 535, in read
self._add_user_source()
File "/usr/local/lib/python3.11/site-packages/confuse/core.py", line 514, in _add_user_source
filename = self.user_config_path()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/confuse/core.py", line 507, in user_config_path
return os.path.join(self.config_dir(), CONFIG_FILENAME)
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/confuse/core.py", line 572, in config_dir
os.makedirs(appdir)
File "", line 215, in makedirs
File "", line 225, in makedirs
PermissionError: [Errno 13] Permission denied: '/opt/docker'
OK
[2025-02-20 02:09:44 +0000] [23] [INFO] Starting gunicorn 23.0.0
[2025-02-20 02:09:44 +0000] [23] [INFO] Listening at: http://0.0.0.0:5001 (23)
[2025-02-20 02:09:44 +0000] [23] [INFO] Using worker: eventlet
[2025-02-20 02:09:44 +0000] [24] [INFO] Booting worker with pid: 24
210 [INFO] beets-flask - Logging initialized logger.py:23
[2025-02-20 02:09:44 +0000] [24] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/gunicorn/arbiter.py", line 608, in spawn_worker
worker.init_process()
File "/usr/local/lib/python3.11/site-packages/gunicorn/workers/geventlet.py", line 142, in init_process
super().init_process()
File "/usr/local/lib/python3.11/site-packages/gunicorn/workers/base.py", line 135, in init_process
self.load_wsgi()
File "/usr/local/lib/python3.11/site-packages/gunicorn/workers/base.py", line 147, in load_wsgi
self.wsgi = self.app.wsgi()
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/gunicorn/app/base.py", line 66, in wsgi
self.callable = self.load()
^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py", line 57, in load
return self.load_wsgiapp()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/gunicorn/app/wsgiapp.py", line 47, in load_wsgiapp
return util.import_app(self.app_uri)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/gunicorn/util.py", line 370, in import_app
mod = importlib.import_module(module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/repo/backend/main.py", line 2, in
from beets_flask import create_app
File "/repo/backend/beets_flask/init.py", line 9, in
from .config.flask_config import ServerConfig, init_server_config
File "/repo/backend/beets_flask/config/init.py", line 1, in
from .beets_config import config
File "/repo/backend/beets_flask/config/beets_config.py", line 152, in
config = InteractiveBeetsConfig()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/repo/backend/beets_flask/config/beets_config.py", line 47, in call
cls._instances[cls] = super(Singleton, cls).call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/repo/backend/beets_flask/config/beets_config.py", line 64, in init
self.reset()
File "/repo/backend/beets_flask/config/beets_config.py", line 74, in reset
self.read()
File "/usr/local/lib/python3.11/site-packages/beets/init.py", line 30, in read
super().read(user, defaults)
File "/usr/local/lib/python3.11/site-packages/confuse/core.py", line 678, in read
super(LazyConfig, self).read(user, defaults)
File "/usr/local/lib/python3.11/site-packages/confuse/core.py", line 535, in read
self._add_user_source()
File "/usr/local/lib/python3.11/site-packages/confuse/core.py", line 514, in _add_user_source
filename = self.user_config_path()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/confuse/core.py", line 507, in user_config_path
return os.path.join(self.config_dir(), CONFIG_FILENAME)
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/confuse/core.py", line 572, in config_dir
os.makedirs(appdir)
File "", line 215, in makedirs
File "", line 225, in makedirs
PermissionError: [Errno 13] Permission denied: '/opt/docker'
[2025-02-20 02:09:44 +0000] [24] [INFO] Worker exiting (pid: 24)
[2025-02-20 02:09:44 +0000] [23] [ERROR] Worker (pid:24) exited with code 3
[2025-02-20 02:09:44 +0000] [23] [ERROR] Shutting down: Master
[2025-02-20 02:09:44 +0000] [23] [ERROR] Reason: Worker failed to boot.

I know my lack of knowledge regarding this is the issue, thank you in advance for any help.

@eq2kazial
Copy link
Author

After more hours spent troubleshooting, this is what I've learned:

  • If I compose with complete default settings and remove the
-v /wherever/config/:/config

then the gui will be reachable. However it completely ignores the volumes of my host for my music folder for inbox & clean. Clicking on Inbox or Tags says Error, load failed.

I also edited the Env variable for BEETSDIR and BEETSFLASKDIR but this seems to be completely ignored, it will only use the config folders that it creates by default (which doesn't help me since I need my actual beets config to be used).

I did verify that my outside directory (in this case /opt ) had the correct permissions for user 1000:1000 but the worker still said permission denied (even if I did 777).

Therefore any actual customization options on my end to use my actual volume locations seems to cause errors and not work.

Gonna move on for now since I don't have the programming know-how to figure out how to fix these issues but if I can provide additional info to help troubleshoot I'd be happy to.

Thanks!

@nis
Copy link

nis commented Feb 20, 2025

Can you share your compose file?

I'll share mine. Maybe that can help you.

Be aware that I changed the port to 5555 as 5001 was already in use, and the music-inbox/archive/streaming directories are on a network share, so those parts might not be applicable to you.

services:
  beets-flask:
    image: pspitzner/beets-flask
    restart: unless-stopped
    ports:
      - 5555:5001
    environment:
      USER_ID: 1000
      GROUP_ID: 1000
    volumes:
      - /home/nis/.config/:/config/
      - /home/nis/music/raw/:/home/nis/music/raw/
      - music-inbox:/media/music/inbox/
      - music-archive:/media/music/clean/
      - music-streaming:/media/music/streaming/
volumes:
  music-inbox:
    driver: local
    driver_opts:
      type: cifs
      o: username=${SMB_USER},password=${SMB_PASS},uid=1000,gid=1000
      device: //${SMB_SERVER}/data/media/music-inbox
  music-archive:
    driver: local
    driver_opts:
      type: cifs
      o: username=${SMB_USER},password=${SMB_PASS},uid=1000,gid=1000
      device: //${SMB_SERVER}/data/media/music-clean
  music-streaming:
    driver: local
    driver_opts:
      type: cifs
      o: username=${SMB_USER},password=${SMB_PASS},uid=1000,gid=1000
      device: //${SMB_SERVER}/data/media/music-streaming
networks: {}

@pSpitzner
Copy link
Owner

hi @eq2kazial,

Im sorry you having a hard time getting this up and running.

I know our documentation is still quite limited - so far this is something we are building for our own needs, and the onboarding experience for non-techies isnt great yet. Having said that, issues like these help others who might have the same problems to solve them until we merge all that knowledge into a Getting-Started guide.

Anyway.
Could you help me understand your setup a bit better? It seemed a bit like you might be trying to run beets-flask as a container inside another (debian) container? I have never tried anything like that and would advise against it.

  • What are the absolute paths on your host machine?
  • Where should they go inside the container?
  • as nis suggested, please share your compose file (also beets and beets-flask configs might help)

best,
p

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

3 participants