mkdir: can't create directory '/data/Config': Permission denied #356
Replies: 5 comments 3 replies
-
I was having this same problem. I had the data folder in a separate shared folder from Docker. I managed to solve it by moving the data directory to inside the Docker shared folder. It seems to be a permissions issue with Docker manipulating a directory outside its own shared folder. |
Beta Was this translation helpful? Give feedback.
-
Would it be possible for you to expand on that, @Llisandur? I'm seeing the same error as @LawsonJohnson when starting up Foundry this morning, though all the directories are 777'd. I haven't moved my installation and so I'm confused as to why Docker is now having an issue. (current path for Foundry is |
Beta Was this translation helpful? Give feedback.
-
@ThePoetics Hello! I set this up so long ago that I have little idea what the process was. However, I'm going to post my current tweaked docker compose here (with secrets redacted, of course). For reference, I'm using Portainer to manage it, but that shouldn't matter here. ---
version: "3.8"
services:
foundry:
image: felddy/foundryvtt:10
hostname: foundry
init: true
# Prevents creation of additional network
network_mode: bridge
# Run an internal shell in the container (So I can hop in and debug as needed)
tty: true
# Run until it works (3 tries)
deploy:
restart_policy:
condition: unless-stopped
delay: 15s
# The bind mount I made is a share created by Synology, but I recall having to tweak the file permissions manually (see the directory permissions below).
volumes:
- type: bind
source: /volume1/FoundryVTT
target: /data
environment:
- CONTAINER_VERBOSE=true # I like my debug info, thanks!
- FOUNDRY_USERNAME=REDACTED
- FOUNDRY_PASSWORD=REDACTED
- FOUNDRY_ADMIN_KEY=REDACTED
# Both IDs exist already on the server and files are 660 (directories 770)
# Synology Admins ignore Linux file perms
# Due to this ownership, the FoundryVTT Share is
# innacessible from DSM and SMB, and presumably other "high-level" options
# Note: at some point I fixed the above issue; I definitely can do this now
- FOUNDRY_GID=65558 # Synology foundry group
- FOUNDRY_UID=1045 # Synology foundry user
- CONTAINER_PRESERVE_OWNER=/data/Data/assets
- FOUNDRY_HOSTNAME=REDACTED.com
- FOUNDRY_IP_DISCOVERY=false
- FOUNDRY_LANGUAGE=en.core # Default, but may use with patches later
- FOUNDRY_LOCAL_HOSTNAME=Whatever your local IP or hostname is
- FOUNDRY_MINIFY_STATIC_FILES=true
# - FOUNDRY_PROXY_PORT=
# - FOUNDRY_PROXY_SSL=false
# - FOUNDRY_ROUTE_PREFIX=
- FOUNDRY_SSL_CERT=/data/ssl/REDACTED.crt
- FOUNDRY_SSL_KEY=/data/ssl/REDACTED.key
- FOUNDRY_WORLD=redacted
- TIMEZONE=America/New_York
ports:
- target: 30000
published: 30000
protocol: tcp
mode: host SSH'ing into my Synology and looking at the directory permissions for d--x--s--- foundry foundry 22 B 2023-04-15 07:00:02 🗁 #recycle
drwxrwsr-x foundry foundry 144 B 2023-03-11 09:35:24 🗁 .
drwxr-xr-x root root 1.1 KB 2023-03-11 09:34:47 🗁 ..
drwxrws--- foundry foundry 58 B 2023-04-20 01:00:01 🗁 @eaDir
drwxrws--- foundry foundry 124 B 2023-03-15 22:06:03 🗁 Config
drwxrws--- foundry foundry 84 B 2022-12-06 14:32:27 🗁 container_cache
drwxrws--- foundry foundry 0 B 2022-10-25 09:22:50 🗁 container_patches
drwxrwsr-x foundry foundry 178 B 2023-04-03 01:09:13 🗁 Data
drwxrws--- foundry foundry 36 B 2022-09-05 21:47:49 🗁 Logs
dr-xr-s--- foundry foundry 64 B 2022-09-05 22:04:03 🗁 ssl
.rw-rwS--- foundry foundry 207 B 2022-09-16 16:48:28 🗋 .stignore I believe setting the setgid bit on the group permissions was relevant. In fact, after reviewing all this information I think that may have been what resolved the issue you're encountering. Now for the shameful hack I had to do to fix issues with users adding files to the share directly (not from the Foundry interface) if I remember correctly. I have a scheduled task on the Synology that runs every minute to fix the file permissions, just a custom bash script The actual script contents: #!/usr/bin/env sh
foundry_assets="/volume1/FoundryVTT/Data/assets/"
chown -R foundry:foundry-assets "$foundry_assets"
chmod -R o-rwx "$foundry_assets" Hopefully some of this info dump can help you with your issue or any future Synology permission fighting future readers have to commit; feel free to ask any follow-up clarifications if you'd like. |
Beta Was this translation helpful? Give feedback.
-
Thank you very much, both of you, for the replies! I ended up fixing the issue last night by creating a new Foundry directory (within the docker path of /volume1/docker/) and moving my data over. I'm assuming it's something unique to do with Synology's implementation; I set both UID and GID on the original install to no effect, but now things are happily chugging along and I'm back to running games. Thank you! |
Beta Was this translation helpful? Give feedback.
-
Update for DSM 7 : |
Beta Was this translation helpful? Give feedback.
-
So I'm using a bind volume on my Synology NAS (I'm managing Docker with Portainer):
I get the error that the directory
/data/Config
can't be created.The strange part is that not only is it created, it also contains the license file (whether I add it as an environment variable, or I let the login fetch it.
My compose (redacted) is below, any ideas? I tried adding a Volume and tmpfs just for the /data/Config directory but had no luck with that either.
Beta Was this translation helpful? Give feedback.
All reactions