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

Problems with cifs volume #170

Open
RichardSchulz52 opened this issue Dec 11, 2024 · 5 comments
Open

Problems with cifs volume #170

RichardSchulz52 opened this issue Dec 11, 2024 · 5 comments
Labels
question Further information is requested

Comments

@RichardSchulz52
Copy link

I used the proposed compose file and just changed the volume to a cifs mounted folder.

The container start up and a repository folder and settings.cfg file are created in the volume.

Everything works fine when I use the default volume. I can rule out trouble with the cifs setup because i use it for every volume.

Log file:

2024-12-11 21:32:17,257 INFO Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
2024-12-11 21:32:17,257 INFO Set uid to user 0 succeeded
2024-12-11 21:32:17,259 INFO RPC interface 'supervisor' initialized
2024-12-11 21:32:17,259 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2024-12-11 21:32:17,259 INFO supervisord started with pid 1
2024-12-11 21:32:18,264 INFO spawned: 'quit_on_failure' with pid 9
2024-12-11 21:32:18,267 INFO spawned: 'nginx' with pid 10
2024-12-11 21:32:18,269 INFO spawned: 'uwsgi' with pid 11
[uwsgi] implicit plugin requested python3
[uWSGI] getting INI configuration from /app/uwsgi.ini
*** Starting uWSGI 2.0.21-debian (64bit) on [Wed Dec 11 21:32:18 2024] ***
compiled with version: 12.2.0 on 19 May 2023 13:59:29
os: Linux-6.8.0-49-generic #49-Ubuntu SMP PREEMPT_DYNAMIC Mon Nov  4 02:06:24 UTC 2024
nodename: ce7ce77c8a44
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 4
current working directory: /
writing pidfile to /tmp/uwsgi.pid
detected binary path: /usr/bin/uwsgi-core
chdir() to /app
your memory page size is 4096 bytes
detected max file descriptor number: 1048576
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to UNIX address /tmp/uwsgi.sock fd 3
setgid() to 33
setuid() to 33
Python version: 3.11.2 (main, Sep 14 2024, 03:00:30) [GCC 12.2.0]
PEP 405 virtualenv detected: /opt/venv
Set PythonHome to /opt/venv
Python main interpreter initialized at 0x74f08b70f018
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 5 seconds
mapped 145840 bytes (142 KB) for 1 cores
*** Operational MODE: single process ***
Traceback (most recent call last):
  File "/opt/venv/lib/python3.11/site-packages/otterwiki/server.py", line 108, in <module>
    storage.store(  # pyright: ignore
  File "/opt/venv/lib/python3.11/site-packages/otterwiki/gitstorage.py", line 255, in store
    with open(os.path.join(self.path, filename), mode) as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/app-data/repository/home.md'
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. GAME OVER ***
@redimp
Copy link
Owner

redimp commented Dec 11, 2024

Hey @RichardSchulz52, looks like the uid 33 is not allowed to write the volume.

Since your cifs volumes work with other images, can you check as which uid the images are running and with which uid they access/write the volume?

Can you please share your docker-compose.yaml?

@RichardSchulz52
Copy link
Author

RichardSchulz52 commented Dec 12, 2024

That was my first thought too, but i do not understand the user rights in a cifs context well enough.

This is the used compose file:

services:
  otterwiki:
    image: redimp/otterwiki:2
    restart: unless-stopped
    ports:
      - 8080:80
    volumes:
      - otterwiki:/app-data
      
volumes:
  otterwiki:
    driver_opts:
      type: cifs
      o: "username=XXX,password=XXX"
      device: "\\\\XXXX\\docker_persist\\otterwiki\\otterwiki"

My other containers do not have a special uid config so its 0:0 by default

@redimp redimp added the question Further information is requested label Dec 12, 2024
@redimp
Copy link
Owner

redimp commented Dec 12, 2024

The process trying to write the repository is running as uid=33. First try: Set the file_mode and dir_mode to 0777:

...
volumes:
  otterwiki:
    driver_opts:
      type: cifs
      o: "username=XXX,password=XXX,file_mode=0777,dir_mode=0777"
      device: "\\\\XXXX\\docker_persist\\otterwiki\\otterwiki"

@RichardSchulz52
Copy link
Author

The same error occurs if I add file mode and dir mode. I don't know if the error is on the server side of the cifs. To mount the remote dir UI use login credentials of a privileged user. This works for every setup so far. It also works with Windows, Mac and Android. Thats why I belive the error to be on the mount dir.

@redimp
Copy link
Owner

redimp commented Dec 17, 2024

Sounds like an error in the mount. 🤔 Can you check if there was any file or directory created by a previous try? Maybe change the path to:

device: "\\\\XXXX\\docker_persist\\otterwiki\\otterwiki2"

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

No branches or pull requests

2 participants