linuxserver / docker-rsnapshot

GNU General Public License v3.0
28 stars 3 forks source link

[BUG] root user in the container does not have permissions to any files or folders #18

Open ZeroOmar opened 1 week ago

ZeroOmar commented 1 week ago

Is there an existing issue for this?

Current Behavior

I had this container running periodic backup and kept UpToDate with watchtower on the latest tag

but I noticed backup failing with permission denined. after investigation I noticed that the root user in the container does not have permissions to any files or folders. not just mounted folders that permissions can be messed up but to the container root directory.

I tested releases and found that this happened after the recent update from 1.4.5-r0-ls109 to 1.4.5-r0-ls110

root@5a1c40d0ea8c:/# ls -l
ls: cannot access 'bin': Operation not permitted
ls: cannot access 'command': Operation not permitted
ls: cannot access 'dev': Operation not permitted
ls: cannot access 'etc': Operation not permitted
ls: cannot access 'home': Operation not permitted
ls: cannot access 'init': Operation not permitted
ls: cannot access 'lib': Operation not permitted
ls: cannot access 'media': Operation not permitted
ls: cannot access 'mnt': Operation not permitted
ls: cannot access 'opt': Operation not permitted
ls: cannot access 'package': Operation not permitted
ls: cannot access 'proc': Operation not permitted
ls: cannot access 'root': Operation not permitted
ls: cannot access 'run': Operation not permitted
ls: cannot access 'sbin': Operation not permitted
ls: cannot access 'srv': Operation not permitted
ls: cannot access 'sys': Operation not permitted
ls: cannot access 'tmp': Operation not permitted
ls: cannot access 'usr': Operation not permitted
ls: cannot access 'var': Operation not permitted
ls: cannot access 'docker-mods': Operation not permitted
ls: cannot access 'app': Operation not permitted
ls: cannot access 'config': Operation not permitted
ls: cannot access 'defaults': Operation not permitted
ls: cannot access 'lsiopy': Operation not permitted
ls: cannot access 'build_version': Operation not permitted
ls: cannot access 'boot': Operation not permitted
ls: cannot access 'data': Operation not permitted
total 0
d????????? ? ? ? ?            ? app
d????????? ? ? ? ?            ? bin
d????????? ? ? ? ?            ? boot
-????????? ? ? ? ?            ? build_version
d????????? ? ? ? ?            ? command
d????????? ? ? ? ?            ? config
d????????? ? ? ? ?            ? data
d????????? ? ? ? ?            ? defaults
d????????? ? ? ? ?            ? dev
-????????? ? ? ? ?            ? docker-mods
d????????? ? ? ? ?            ? etc
d????????? ? ? ? ?            ? home
-????????? ? ? ? ?            ? init
d????????? ? ? ? ?            ? lib
d????????? ? ? ? ?            ? lsiopy
d????????? ? ? ? ?            ? media
d????????? ? ? ? ?            ? mnt
d????????? ? ? ? ?            ? opt
d????????? ? ? ? ?            ? package
d????????? ? ? ? ?            ? proc
d????????? ? ? ? ?            ? root
d????????? ? ? ? ?            ? run
d????????? ? ? ? ?            ? sbin
d????????? ? ? ? ?            ? srv
d????????? ? ? ? ?            ? sys
d????????? ? ? ? ?            ? tmp
d????????? ? ? ? ?            ? usr
d????????? ? ? ? ?            ? var

This could be due to the rebase to alpine 3.20

Expected Behavior

on image tag 1.4.5-r0-ls109 and older

root can see files as expected

root@393f0d264e60:/# ls -l
total 32
drwxr-xr-x   1 abc  abc      0 May 14 15:27 app
drwxr-xr-x   1 root root   930 May 14 15:27 bin
drwxrwxrwx   9 root root  4096 Jan  1  1970 boot
drwxr-xr-x   1 root root  5224 May 14 15:27 command
drwxrwxrwx   1 abc  abc     18 Jun 29 14:22 config
drwxr-xr-x   1 root root     0 Jun 29 14:53 data
drwxr-xr-x   1 abc  abc     16 May 16 07:37 defaults
drwxr-xr-x   5 root root   340 Jun 29 14:53 dev
-rwxr--r--   1 root root 23629 Jan  1  1970 docker-mods
drwxr-xr-x   1 root root   986 Jun 29 14:53 etc
drwxr-xr-x   1 root root     0 May 14 15:27 home
-rwxr-xr-x   1 root root  1012 Nov 20  2023 init
drwxr-xr-x   1 root root   866 May 16 07:40 lib
drwxr-xr-x   1 root root     0 May 14 15:27 lsiopy
drwxr-xr-x   1 root root    28 May 14 15:27 media
drwxr-xr-x   1 root root     8 Jun 29 14:53 mnt
drwxr-xr-x   1 root root     0 May 14 15:27 opt
drwxr-xr-x   1 root root    30 May 14 15:27 package
dr-xr-xr-x 317 root root     0 Jun 29 14:53 proc
drwx------   1 root root    32 Jun 29 14:53 root
drwxr-xr-x   1 root root   178 Jun 29 14:53 run
drwxr-xr-x   1 root root   992 May 14 15:27 sbin
drwxr-xr-x   1 root root     0 May 14 15:27 srv
dr-xr-xr-x  13 root root     0 Jun 29 14:53 sys
drwxrwxrwt   1 root root     0 May 14 15:27 tmp
drwxr-xr-x   1 root root    54 May 14 15:27 usr
drwxr-xr-x   1 root root    86 May 14 15:27 var

Steps To Reproduce

  1. installing the container with docker using the bellow docker command
  2. exec into the container
  3. run ls -l /

Environment

- OS: unraid 6.6.4
- How docker service was installed: build into the OS 
- Docker version: 18.06.1-ce

CPU architecture

x86-64

Docker creation

docker run -d --name='rsnapshot' --net='bridge' -e HOST_OS="Unraid" -e 'PUID'='99' -e 'PGID'='100' -e 'TZ'='Africa/Cairo' -v '/mnt/user/appdata/rsnapshot/config/':'/config':'rw' -v '/mnt/user/':'/mnt/user/':'rw' -v '/mnt/user/appdata/rsnapshot/root/.ssh/':'/root/.ssh/':'rw' -v '/boot/':'/boot/':'ro' 'linuxserver/rsnapshot:1.4.5-r0-ls110'

Container logs

[migrations] started
[migrations] no migrations found
───────────────────────────────────────

██╗ ███████╗██╗ ██████╗
██║ ██╔════╝██║██╔═══██╗
██║ ███████╗██║██║ ██║
██║ ╚════██║██║██║ ██║
███████╗███████║██║╚██████╔╝
╚══════╝╚══════╝╚═╝ ╚═════╝

Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID: 99
User GID: 100
───────────────────────────────────────
Linuxserver.io version: 1.4.5-r0-ls112

Build-date: 2024-06-27T04:42:22+00:00
───────────────────────────────────────

***** Upgrading config file if required *****
/etc/rsnapshot.conf file is already up to date.
***** Validating config file *****

K
[custom-init] No custom files found, skipping...
[ls.io-init] done.
github-actions[bot] commented 1 week ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.