Permission troubles using RomM

  • Hello. Permissions have always been my weakest spot during my self hosting learning journey. I'm on OMV7 using docker compose (and portainer) to run RomM. I got the containers it needs up and running and they can see the files in the appropriate volumes, but whenever I try to download a file from my server the browser returns a 403 and the container returns an error 13 (Permission denied).


    I'm using mergerfs and snapRAID to combine my 4 data drives (1 drive is parity). My game library is on those drives, and RomM SHOULD BE able to write to those directories; I can upload new files via the RomM interface just fine. The app fetches and displays downloaded assets just fine as well.


    I have the container bound to a RomM user under a RomM group (via environment variables in the compose file) that has full ownership over the folders that the compose file exposes by default.


    I've tried various things in the RomM Discord, but it all comes back to permissions which they seem to be leaving my to figure out on my own (totally fair lol). Willing to repeat things I've already tried though. Unfortunately permissions have just been really hard to wrap my head around for as long as I've had my server running. Happy to provide any needed info as I'm sure I'm missing a lot here. Any help appreciated!

  • post your compose file in a code box and also an ls -la of the data directory holding your rom files in another code box. Please be sure to mask any information such as domains and logins for security purposes. No need to mask drive uuid paths or internal ip addresses (like 192.168.x.x)



    Also a screen shot of the RomM user or an id RomM would be helpful.


    These 3 items should give all the configuration and permissions information required to try to help you.

    Asrock B450M, AMD 5600G, 64GB RAM, 6 x 4TB RAID 5 array, 2 x 10TB RAID 1 array, 100GB SSD for OS, 1TB SSD for docker and VMs, 1TB external SSD for fsarchiver OS and docker data daily backups

  • post your compose file in a code box and also an ls -la of the data directory holding your rom files in another code box. Please be sure to mask any information such as domains and logins for security purposes. No need to mask drive uuid paths or internal ip addresses (like 192.168.x.x)


    Also a screen shot of the RomM user or an id RomM would be helpful.


    These 3 items should give all the configuration and permissions information required to try to help you.

    Alrighty, my compose;

    output of ls -la inside the roms folder and on a level up from there;

    and screenshots of the RomM user and group;

  • This shows the most common error with people using docker apps on mergerfs pools.


    Do not use config, database, caches or redis folders on split drives.

    You need those on single drive paths.


    Also, recheck your library path since is pointing to the root of the Pool and it needs to live on a subfolder.

  • So the library folder is totally fine as RomM looks for a roms folder within that mount point. It sees and scans my games as it should.


    I migrated those other volumes you mentioned to the partition of a drive that holds other docker data. This drive is not included in the mergerfs setup;

    Code
    volumes:
          - /srv/mergerfs/BigPool/romm/resources:/romm/resources # Resources fetched from IGDB (covers, screenshots, etc.)
          - /srv/dev-disk-by-uuid-7f7e4557-ee9e-414d-a548-3b5aea8162cb/appdata-docker/RomM/redis-data:/redis-data # Cached data for background tasks
          - /srv/mergerfs/BigPool:/romm/library # Your game library. Check https://github.com/rommapp/romm?tab=readme-ov-file#folder-structure for more details.
          - /srv/mergerfs/BigPool/romm/assets:/romm/assets # Uploaded saves, states, etc.
          - /srv/dev-disk-by-uuid-7f7e4557-ee9e-414d-a548-3b5aea8162cb/appdata-docker/RomM/config:/romm/config # Path where config.yml is stored

    Does this seem right? Either way, my browser still returns a 403 and the container returns error 13: permission denied when attempting a download.

  • Alrighty, my compose;

    output of ls -la inside the roms folder and on a level up from there;

    I see a potential issue here too. The roms directory and the contents are owned by root:users. The RomM user appears to belong to belong to the RomM and usesrs group, but the compose file is using PUID/PGID of 1004:1005 which is RomM:RomM, so the container is operating as RomM user and group nut the riles are root:users. There is not ownership and permissions overlap. It does look like your permissions are using r/w for others, so those permissions should work, but depending on the container/application design, the lack of user/group overlap can sometimes cause issues.


    You would be better off either using a PGID of 100 in the compose file, or if you want more isolation, use a user/group for the docker user that is used for all dockers, but is not part of the normal users group as is often suggested in docker guides.

    Asrock B450M, AMD 5600G, 64GB RAM, 6 x 4TB RAID 5 array, 2 x 10TB RAID 1 array, 100GB SSD for OS, 1TB SSD for docker and VMs, 1TB external SSD for fsarchiver OS and docker data daily backups

  • I see a potential issue here too. The roms directory and the contents are owned by root:users. The RomM user appears to belong to belong to the RomM and usesrs group, but the compose file is using PUID/PGID of 1004:1005 which is RomM:RomM, so the container is operating as RomM user and group nut the riles are root:users. There is not ownership and permissions overlap. It does look like your permissions are using r/w for others, so those permissions should work, but depending on the container/application design, the lack of user/group overlap can sometimes cause issues.

    I just tried giving the container to PUID 100 and got the same errors. Also tried completely deleting the PUID and PGID variables (they're not present in the example compose and their docs never mention adding them) to no avail.


    Quote

    if you want more isolation, use a user/group for the docker user that is used for all dockers, but is not part of the normal users group as is often suggested in docker guides.

    I tried setting this up initially with the steps on the omv docs but whenever I went in and changed anything about the user in the dashboard ui it would automatically get added back to group 100.

  • I just tried giving the container to PUID 100 and got the same errors. Also tried completely deleting the PUID and PGID variables (they're not present in the example compose and their docs never mention adding them) to no avail.

    If the PUID/PGID is not listed in the documentation then it likely is not supported. Those are features that have to be enabled in the container build, and are not universal docker features.


    Docker does support user directives, but they do not behave the same as the PUID/PGID in some containers. The PUID/PGID settings essentially tell the containers that support it to interact with the files that are out on the host OS as if they are that user, but inside the container the operations are done as whatever user the container was designed to run as. The docker user directive tries to change the container internals to that user and group to avoid permissions conflicts, but if the user and group are not defined in the container the container will not work correctly.


    If a container does not support PUIS/PGID, then it will function on the host as root but files owned by root are not typically accessible by non-root users.


    I am not running this container and I am not running mergerfs which adds a layer of complexity that not all containers can navigate.


    Looking a bit closer at that compose file, it looks like it is designed to use docker volumes for it'd viles and not bind mounts to normal directories.


    The compose file creates a romm_resources volume and the official compose file has the roms mtadata being stored in that volume, but you have instead used a bind mount to a host directory. While this is ok to do with most containers, I have encountered a few that will not work correctly with bind mounts.


    I would suggest that you test with the container using the docker volume for rom metadata storage to see if it behaves better. This could be the part that is actually causing your problems.

    Asrock B450M, AMD 5600G, 64GB RAM, 6 x 4TB RAID 5 array, 2 x 10TB RAID 1 array, 100GB SSD for OS, 1TB SSD for docker and VMs, 1TB external SSD for fsarchiver OS and docker data daily backups

  • I would suggest that you test with the container using the docker volume for rom metadata storage to see if it behaves better. This could be the part that is actually causing your problem.

    Forgive me for not totally following. Are you saying I should change the resources path to something else? And if so, where?

  • Forgive me for not totally following. Are you saying I should change the resources path to something else? And if so, where?

    Yes I am.


    Here is the offical example compose files:

    just like yours, it declares a rom_resources volume which is intended to be used for that metadata stuff (the first line under the volumes section), but you have changed the rom_resources to be a bind mount of - /srv/mergerfs/BigPool/romm/resources:/romm/resources # Resources fetched from IGDB (covers, screenshots, etc.)


    This change could be causing your problems.

    Asrock B450M, AMD 5600G, 64GB RAM, 6 x 4TB RAID 5 array, 2 x 10TB RAID 1 array, 100GB SSD for OS, 1TB SSD for docker and VMs, 1TB external SSD for fsarchiver OS and docker data daily backups

  • Ok I think I see what you mean now. The volumes section now looks like this;

    Code
    volumes:
          - romm_resources:/srv/mergerfs/BigPool/romm/resources # Resources fetched from IGDB (covers, screenshots, etc.)
          - romm_redis_data:/srv/dev-disk-by-uuid-7f7e4557-ee9e-414d-a548-3b5aea8162cb/appdata-docker/RomM/redis-data # Cached data for background tasks
          - /srv/mergerfs/BigPool:/romm/library # Your game library. Check https://github.com/rommapp/romm?tab=readme-ov-file#folder-structure for more details.
          - /srv/mergerfs/BigPool/romm/assets:/romm/assets # Uploaded saves, states, etc.
          - /srv/dev-disk-by-uuid-7f7e4557-ee9e-414d-a548-3b5aea8162cb/appdata-docker/RomM/config:/romm/config # Path where config.yml is stored

    Same error though unfortunately, even after clearing my browser cache.

  • - romm_resources:/srv/mergerfs/BigPool/romm/resources # Resources fetched from IGDB (covers, screenshots, etc.)

    This is not right.


    docker mappings are host on the left, container on the right, with a : in between. You never change the right side, only change the left.


    The official version is:

    - romm_resources:/romm/resources # Resources fetched from IGDB (covers, screenshots, etc.)


    Your original was not using the declared volume:

    - /srv/mergerfs/BigPool/romm/resources:/romm/resources # Resources fetched from IGDB (covers, screenshots, etc.)


    You changed it to this where you are mapping the docker volume into a path inside the container that is really outside the container and not where the application is looking:

    - romm_resources:/srv/mergerfs/BigPool/romm/resources # Resources fetched from IGDB (covers, screenshots, etc.)


    The right is never changed as that is inside the container and where application is looking in there. The left gets mapped into the right side in the container.


    You should have left it like the example compose file. The left is the docker volume, the right is the path inside the container.

    Asrock B450M, AMD 5600G, 64GB RAM, 6 x 4TB RAID 5 array, 2 x 10TB RAID 1 array, 100GB SSD for OS, 1TB SSD for docker and VMs, 1TB external SSD for fsarchiver OS and docker data daily backups

  • So evidently I did not follow, my bad. You're saying I shouldn't have changed it at all then? I tried that out just now (copying those first two volumes from the official example compose), same error as well.

  • Well as I said above, I don’t run the container and I don’t run mergerfs.


    I can try to spin a container up when I get a chance, to see if I can replicate the problem, but if I can’t I would then tend to think it may be related the mergerfs pool which as I mentioned can cause some dockers to not work right.

    Asrock B450M, AMD 5600G, 64GB RAM, 6 x 4TB RAID 5 array, 2 x 10TB RAID 1 array, 100GB SSD for OS, 1TB SSD for docker and VMs, 1TB external SSD for fsarchiver OS and docker data daily backups

  • Well as I said above, I don’t run the container and I don’t run mergerfs.


    I can try to spin a container up when I get a chance, to see if I can replicate the problem, but if I can’t I would then tend to think it may be related the mergerfs pool which as I mentioned can cause some dockers to not work right.

    Damn, if I'd known that going into this I wouldn't have set it up lol. Thank you for trying to help me out

  • Damn, if I'd known that going into this I wouldn't have set it up lol. Thank you for trying to help me out

    No worries. I don’t mind trying to help and figure out a problem. Unfortunately sometimes it’s easier when you can see what is happening and how a container behaves first hand. I’ll try to have a look later tonight or tomorrow after work.

    Asrock B450M, AMD 5600G, 64GB RAM, 6 x 4TB RAID 5 array, 2 x 10TB RAID 1 array, 100GB SSD for OS, 1TB SSD for docker and VMs, 1TB external SSD for fsarchiver OS and docker data daily backups

  • I was able to spin up a container and upload and download roms without a problem. I did not have the system use a pre-existing rom library, but instead allowed it to create it's own library structure and then uploaded to that and downloaded from it. It did not seem to work well if I didn't let it create it's expected folder structures, but I will concede that I am not familiar with the application and am not inclined to spend several hours or days figuring out exactly how it works.


    That said, the fact that I could upload and download without any errors tells me that it works on a normal filesystem (I run xfs on a mdadm raid5). Your problems are most likely either a configuration issue stemming from a pre-existing library, an error created by the compose files problems we already went over that are now persistent in the database and may be causing problems, or the mergerfs issue.


    I would suggest that you start again, by shutting it down and deleting the docker database volume, setting the library path on the left of the mappings to an empty directory, starting it up again letting the application create it's library structure in another directory and then try to upload and download to/from it. You may even need to delete the files in it's config directory and go completely fresh.


    If you still have problems I would repeat the reset proces I just mentioned, but this time try to change all the host paths to a single drive instead of the mergerfs pool. If it works then, you know it's a problem with mergerfs

    Asrock B450M, AMD 5600G, 64GB RAM, 6 x 4TB RAID 5 array, 2 x 10TB RAID 1 array, 100GB SSD for OS, 1TB SSD for docker and VMs, 1TB external SSD for fsarchiver OS and docker data daily backups

    Edited once, last by BernH ().

  • Sounds like a plan, thank you for experimenting with that. Will report back on whether everything works or not

  • That said, the fact that I could upload and download without any errors...


    ...starting it up again letting the application create it's library structure in another directory and then try to upload and download to/from it.

    I'm just now reading this again and seeing t mentions of uploading and it reminded me of something. I can actually upload from the RomM web interface with no issues, downloading is the only issue. Could that mean anything specific?


    Otherwise, I'm looking into switching over to RAID5 instead of snapraid + mergerfs; the other 2 solutions didn't solve the issue. I made a reddit post on the OMV sub and everyone is insistent on mergerfs not being the issue, but nobody seems to be able to narrow down what the issue may actually be. Guess RomM is too niche an app for right now, and I can't find any other page with anyone having the same issue. Super odd.

  • I'm just now reading this again and seeing t mentions of uploading and it reminded me of something. I can actually upload from the RomM web interface with no issues, downloading is the only issue. Could that mean anything specific?

    It doesn't mean anything to me aside from the issues I already mentioned and recommending the reset.

    Otherwise, I'm looking into switching over to RAID5 instead of snapraid + mergerfs; the other 2 solutions didn't solve the issue. I made a reddit post on the OMV sub and everyone is insistent on mergerfs not being the issue, but nobody seems to be able to narrow down what the issue may actually be. Guess RomM is too niche an app for right now, and I can't find any other page with anyone having the same issue. Super odd.

    You can attempt to direct the mappings to just a single drive first. It can even be a directory on your OS drive for a quick test. This will bypass the mergerfs/snapraid configuration. That would be the only way to rule out or confirm if it is the mergerfs/snapraid config or if there is something else going on.

    Asrock B450M, AMD 5600G, 64GB RAM, 6 x 4TB RAID 5 array, 2 x 10TB RAID 1 array, 100GB SSD for OS, 1TB SSD for docker and VMs, 1TB external SSD for fsarchiver OS and docker data daily backups

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!