Replies: 13 comments 28 replies
|
Link to an associated Reddit thread: https://www.reddit.com/r/FoundryVTT/comments/1kd41s1/anybody_else_struggling_to_get_version_13_up_and/ |
|
i was using this container in unraid but now since the update its broken how do i fix the permissions |
|
I am unable to run |
|
Really appreciate the log line. I would have spent a lot longer debugging if not for that! |
|
I am hosting Foundry off my Synology. Am I able to do this using environment variables at all? If not how can I fix this so I can run 13? |
|
@felddy I don't know how you (hard)coded those UIDs and GIDs, but on rootless Podman, the container utterly ignores all userns settings. For others also running rootless Podman: This works by assigning your user's intermediate uid 421 (your 421st subuid) on the host to uid 1000 in the container. @felddy I acknowledge, respect and appreciate that an explanation and a link to this issue were logged by the container. Because those of us who are using your container because they're running Foundry headless on a server will have spent quite some time confusedly debugging the server before they see your message. Not the least because you have consistently delivered a high quality product. It does mean that it's the last place I'm looking for a problem when the stack is failing, though. If your image has always worked fine, and I just altered the stack to add a new cached installer, pull a new container image, update the process manager config to account for a new release tag, and then the container doesn't start, what is more likely: That I did everything right and your image just chooses not to run...or that I fucked up along the way? There are so many things I could've done wrong accidentally, that "maybe I did everything right and Foundry just doesn't want to run" isn't going to be high on the debugging checklist. Sure, at some point, you get to the "this doesn't make sense...this should work...what does Podman say?" stage and see your message. But adding a release notes vhost to the webserver and redirecting visitors if something's wrong gets your message to the reader a lot quicker... Maybe something for the 13.345-version of the image? <_< |
|
A detail left out: the container cache directory (and the .zip file itself) must also have their ownership changed. Meaning Without it, you'll get an error saying: "CACHEDIR.TAG: permission denied". For me it was not enough to run |
|
OK, I cannot get the v13 container to start. I'm running it using rootless podman, and no matter what I do, I get this in my logs: I'm using a Kubernetes YAML file and running My yaml file is: For the The data directory has owner:group set to 1000:1000. I'm running the pod as myself, which has a uid=1000,gid=1000 |
|
Ok, I got it up! Here is what I did to fix it. This is the yaml I used: I ran Then I ran Please tell me if I did something wrong. |
|
Anyone else managed to get this latest image working on Unraid, I've tried setting terms etc. However it just starts and then immediately stops, nothing showing up in the logs. I also noitced a bunch of deprecated variables seem to still be set on the unraid install, maybe this just needs some love? |
|
I am also failing to get this up and running again I have changed permissions to 1000:1000 on the Data folder I don't know what else to do |
|
Folks, as I discussed in #1241, one of the problems of this design with a non-root user is how Docker implements bind mounts. A bind mount is what you're doing each time you use the volume or bind feature to map a folder from the host filesystem into your container. This form of sharing between host and container was only intended for a container operating as root. You will need a more complex solution like those used in virtual machines to handle mapping users between the host and container systems. Docker has a guide on how to set this up for advanced users, so that you can manually identify the mappings between host users and container users. It is not easy to do for the average user. Why?Docker bind is lightweight compared to fusefs or other programs that act as a translation layer between the real filesystem and the filesystem's representation in a virtual machine. It was designed under the assumption that the container is running as the root user with the standard uid and gid of 0. In this scenario, the Linux kernel is shared between the host and containers does not need any translation at all. The Docker engine only needs to intercept links that would enable you to break out of your container. However, when you change the user in the container to a non-root user, then this all breaks down because the container is interpreting the filesystem data like the uid and gid of file owners based on the container's configuration. So you get things like permission problems because a file belongs to a uid and gid that doesn't exist in the container. It also means that if you run a command to change owners, it will update the file with a uid and gid that may not be assigned to the correct user in the host filesystem. The Design Problem for this ContainerThis container assumes you can change the data folder to be owned by the user defined in the image. However, this doesn't work if you're substituting the data folder with a bind mount at run time (dockerr compose or docker run). When you create a container initially, any new bind mounts will overlay (hide) the folder previously at that mount point by replacing it with a new folder owned by the root user that acts as the entry point for that bind mount. This will break the scripts used in this image that are being run as the non-root user because they lack permissions. You must also be careful with changing permissions to your non-root user after startup, because it will change the owner in the host system by updating the owner uid or gid to a value that may be incorrect in the host system. Solutions for Non-Root Container UserThe safe solution that would consistently work for anyone would be to sync the user inside the container with a user in the host machine using the Docker method or another method. While other solutions do exist, they may have unwelcome and even dangerous side effects. Using this solution will limit the audience that can use this image securely. In most cases, people without sufficient knowledge would be encouraged to blindly follow any number of solutions that may work, potentially compromising their system security in the process. My RecommendationsI suggest that this image return to use the root user. The non-root user setup has not added any extra security and encourages users to take actions that may compromise their host system security. The CVEs that involve users breaking out of the container into the host system all require some action in the host system that allows the container to get around the Docker protections to make this possible. A non-root user is ideal in situations where your container uses only volumes (not bind mount volumes) and can operate independently of the host system using only its own container resources or those in related images tied together by a container network or shared volumes. Since this container requires the user to bind a data folder from the host machine for normal use, a non-root user doesn't make sense. The security of the container is now contingent on how the host system is configured, and that is beyond the control of a container designer. Even when it works, the level of security by adding a non-root user is at best the same as the root user. What you gain by attempting to create a hardened container, you lose with the extra complexity you have introduced. If at any point someone has access to the host machine, they can circumvent any container permissions just by how they create the container or through Docker engine commands that modify the image state without needing permission from the container operating system. About MeTake my advice as you will, because depending on your background, you may know more about some of these topics than me. For a bit of context, I work in the tech industry on secure operating systems. My role is integration with some R&D in nested virtualization and embedded system image building. This involves designing custom Linux and POSIX kernels and their related image filesystems. The virtualization research involves coordinating the resources of multiple layers of systems. One of my more recent solutions involved using Docker within my build process. |
|
Old thread, but I'm having the same issue now with trying to fresh-install v14 after a drive failure. I'm using Portainer + docker compose, and have set the /data mount to 1000:1000. Still getting Tried making a new user and assigning it all to them, tried rebinding the mount elsewhere, still nothing. |

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This thread will help you quickly make the changes needed to migrate from the
v12version of this container tov13. Specifically it will address the causes of the failure logged in the lines below:What Changed in v13?
root. The defaultuidandgidare now1000:1000.datavolume to match theuidandgidof the server process. TheCONTAINER_PRESERVE_OWNERenvironment variable that controlled this behavior is now deprecated.FOUNDRY_UIDandFOUNDRY_GIDenvironment variables have been deprecated in favor of the native controls for the container's runtime. See below for more information./home/foundryto/home/nodeTIMEZONEenvironment variable has been replaced by the standardTZenvironment variable.linux/arm/v6support has been dropped.See the release notes for
13.341.0for additional details and changes.Resolving Permission Errors
You can either:
Tip
Changing the ownership of the data is the easier of the two methods.
Changing the ownership of your
/datadirectoryNote
If you've moved the
CONTAINER_CACHEdirectory outside of yourdatadirectoryyou will need to reconcile the permissions of it as well.
Changing the user and group of the server process
Note
The container previously used
uid:gidof421:421.If you didn't set your own custom ownership with
v12you should use421below.If you previously set a custom
uidandgidthen use those same values with the new syntax.Replace environment variables with runtime configurations.
Podman, Containerd, Docker
Compose files
v12 syntax:
v13 syntax:
Command line
v12 syntax:
v13 syntax:
Kubernetes
v12 syntax:
v13 syntax:
Feel free to comment about your experience and any changes you think should be made to these instructions.
All reactions