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

[Bug] Docker image permissions #812

Closed
BobGallardo opened this issue Apr 14, 2024 · 9 comments
Closed

[Bug] Docker image permissions #812

BobGallardo opened this issue Apr 14, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@BobGallardo
Copy link

BobGallardo commented Apr 14, 2024

RomM version
v3.0.3

Describe the bug
I was unable to index any ROMs, and I kept encountering problems with backend/handler/fixtures/MAME.xml.

To Reproduce

  • Install the docker template from community applications in UnRaid.
  • Configure config.yml using the example config.
exclude:
  # Exclude platforms to be scanned
  platforms:
    - 'romm'

  # Exclude roms or parts of roms to be scanned
  roms:

    ## Single file games section.
    # Will not apply to files that are in sub-folders (multi-disc roms, games with updates, DLC, patches, etc.)
    single_file:
      # Exclude all files with certain extensions to be scanned
      extensions:
        - 'xml'
        - 'nfo'
        - 'txt'
        
      # Exclude matched file names to be scanned
      names:
        - '._*' # Supports unix filename pattern matching
        - 'boot.rom'

    ## Multi files games section
    # Will apply to files that are in sub-folders (multi-disc roms, games with updates, DLC, patches, etc.)
    multi_file:
      # Exclude matched 'folder' names to be scanned (RomM identifies folders as multi file games) 
      names:
        - 'my_multi_file_game'
        - 'DLC'
      # Exclude files within sub-folders.
      parts:
        # Exclude matched file names to be scanned from multi file roms
        # Keep in mind that RomM doesn't scan folders inside multi files games,
        # so there is no need to exclude folders from inside of multi files games.
        names:
          - 'data.xml'
          - '._*' # Supports unix filename pattern matching
        # Exclude all files with certain extensions to be scanned from multi file roms
        extensions:
          - 'txt'

system:
  # Asociate different platform names to your current file system platform names
  platforms:
    # [your custom platform folder name]: [RomM platform name]
    megacd: 'segacd' # In this example if you have a 'gc' folder, RomM will treat it like the 'ngc' folder
    megadrive: 'genesis' # In this example if you have a 'psx' folder, RomM will treat it like the 'ps' folder
    neogeo: 'neogeoaes' # In this example if you have a 'psx' folder, RomM will treat it like the 'ps' folder
  # Asociate one platform to it's main version
  versions:
    naomi: 'arcade'

filesystem:
  # The folder name where your roms are located
  roms_folder: 'roms' # For example if your folder structure is /home/user/library/roms_folder

Additional context
I'm running RomM under Unraid, and I've configured my Docker to use the native filesystem for storing containers, rather than a Docker.img (virtual disk). I haven't had problems with other images, but RomM was experiencing permission issues. My docker-config is set with PUID:99 and PGID:100, as I usually use. To resolve the issue, I had to execute chown 1000 backend/ -R and chgrp 1000 backend/ -R within the container on the host filesystem to enable writing MAME.xml to the proper folder.

The arcade roms are indexing now.

The logfiles that were created by the image was sparse. They mostly looked like

INFO:	  [RomM][2024-04-13 20:41:15] Connecting to redis...
INFO:	  [RomM][2024-04-13 20:41:16] Starting scheduler

A more verbose log would be helpful. The live Docker logterminal logs were a big help, but those are quickly over written when restarting Docker containers.

Does the Docker image need some permissions tweaks or am I an edge case because of how I have my Docker container filesystem configured?

@BobGallardo BobGallardo added the bug Something isn't working label Apr 14, 2024
@BobGallardo BobGallardo changed the title [Bug] Bug title [Bug] Docker image permissions Apr 14, 2024
@WirtsLegs
Copy link

WirtsLegs commented Apr 14, 2024

I have the same issue on docker,
1152358:C 14 Apr 2024 16:59:41.023 # Failed opening the temp RDB file temp-1152358.rdb (in server root dir /redis-data) for saving: Permission denied
seems to be the root of it, that directory is misconfigured within the image

if you chmod the redis folder it should work for you, need to give write permissions to group i believe

@BobGallardo
Copy link
Author

That's what I did and it did seem to work. I needed to make that same change to the assets and resources folders in appdata on the host system. The owner and group in the image are now both set to romm. The permissions on the host system are now a bit goofy; the owner is me and the group is 1000.

The ID's of the romm user and group may need to be changed in the image to resolve this.
User ' romm' to 99
Group 'romm' to 100

@gantoine
Copy link
Member

gantoine commented Apr 14, 2024

Sorry for the slow reply ya'll, there's an issue with the 3.0.x images. You can try the 3.1.x release candidates 3.1.0-rc.2 which has a fix for this that requires no changes with chmod.

@ramonskie
Copy link

the 3.1.0-rc.2 fixed my issue as well

@lnlyssg
Copy link

lnlyssg commented May 6, 2024

I've just upgraded to 3.1.0 from 3.0.3 but I'm now having this issue, I had previously defined PUID and PGID variables during the 3.0.2 issues so I'm wondering if this has caused my problems...

Any ideas on what the correct owners and permissions should be please?

656b3f1872a9:/$ ls -al /
total 8
drwxr-xr-x    1 root     root           184 May  6 10:31 .
drwxr-xr-x    1 root     root           184 May  6 10:31 ..
-rwxr-xr-x    1 root     root             0 May  6 10:31 .dockerenv
drwxr-xr-x    1 root     root           352 Apr 20 20:58 backend
drwxr-xr-x    1 root     root           870 Apr 20 21:02 bin
drwxr-xr-x    5 root     root           340 May  6 10:33 dev
drwxr-xr-x    1 root     root           754 May  6 10:31 etc
drwxr-xr-x    1 root     root             8 Apr 20 21:02 home
-rwxr-xr-x    1 root     root          4978 Apr 20 20:58 init
drwxr-xr-x    1 root     root           282 Apr 20 21:02 lib
drwxr-xr-x    1 root     root            28 Jan 26 20:43 media
drwxr-xr-x    1 root     root             0 Jan 26 20:43 mnt
drwxr-xr-x    1 root     root             0 Jan 26 20:43 opt
dr-xr-xr-x  994 root     root             0 May  6 10:33 proc
drwxr-xr-x    1 romm     romm             0 Apr 20 21:02 redis-data
drwxr-xr-x    1 1026     users           82 Apr 17 10:07 romm
drwx------    1 root     root            38 Apr 20 20:59 root
drwxr-xr-x    1 root     root             0 Jan 26 20:43 run
drwxr-xr-x    1 root     root           790 Jan 26 20:43 sbin
drwxr-xr-x    1 root     root             0 Jan 26 20:43 srv
dr-xr-xr-x   12 root     root             0 May  6 10:33 sys
drwxrwxrwt    1 root     root            32 May  6 10:33 tmp
drwxr-xr-x    1 root     root            60 Apr 20 21:02 usr
drwxr-xr-x    1 root     root            92 Apr 20 21:02 var

@gantoine
Copy link
Member

gantoine commented May 6, 2024

First you'll want to remove PUID/PGID as we no longer use them. You can either a) set the user property in your compose to the uid:gid of the root user or b) change the owner of redis-data and romm to root/another user, as defined in your compose.

@lnlyssg
Copy link

lnlyssg commented May 6, 2024

I've already removed the PUID and PGID but what ID should redis-data be owned by? I've tried both romm and root but still get the same issue.

@gantoine
Copy link
Member

gantoine commented May 6, 2024

I've tried both romm and root but still get the same issue.

Interesting, my docker-compose specifies user: 1001:1001, and these are the permissions i have on those folders:

drwxr-xr-x    2 1001     1001        4.0K Mar 17 21:45 redis-data
drwxr-xr-x    1 romm     romm        4.0K Apr 28 09:26 romm

@lnlyssg
Copy link

lnlyssg commented May 7, 2024

I've managed to sort it - I removed the user: entry from my compose and then set redis-data to be owned by root

@gantoine gantoine closed this as completed May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants