Cannot get homarr v1.0.0-beta4 to start (permissions)

I have been unable to get appropriate permissions set up for /appdata. Tried setting perms to 777, subdirectories are created but container is unable to chown. Recently tried just using a volume instead of a bind and now getting mkdir: can't create directory '/appdata/db': Permission denied Is there a way to set the uid/gid that the container runs as? Passing them as env vars did not appear to work
Solution:
Okay I just setup portainer and took a look. It seems like you currently have somehow defined that it needs to run with the nextjs user see your inspection in Config > User above Volumes. For me this field is an empty string: "User": "" So I guess you have configured this somewhere in your portainer configuration...
Jump to solution
42 Replies
Cakey Bot
Cakey Bot2mo ago
Thank you for submitting a support request. Depending on the volume of requests, our team should get in contact with you shortly.
⚠️ Please include the following details in your post or we may reject your request without further comment: - Log (See https://homarr.dev/docs/community/faq#how-do-i-open-the-console--log) - Operating system (Unraid, TrueNAS, Ubuntu, ...) - Exact Homarr version (eg. 0.15.0, not latest) - Configuration (eg. docker-compose, screenshot or similar. Use ``your-text`` to format) - Other relevant information (eg. your devices, your browser, ...)
❓ Frequently Asked Questions | Homarr documentation
Can I install Homarr on a Raspberry Pi?
Meierschlumpf
Meierschlumpf2mo ago
Can you send your compose file?
Yossi
Yossi2mo ago
I had this issue too. After folder created i checked the permissions and it was read / write I add execute and it’s fix the problem
this_is_nate
this_is_nateOP2mo ago
Didn't use compose, just built it in portainer but here's the config inspection there with RW on the volume mounted to /appdata
this_is_nate
this_is_nateOP2mo ago
I've tried adding 777 to the db and redis folders it creates, but it still desperately wants to chown the folders and won't start unless its able to
Yossi
Yossi2mo ago
Did you use -r? sudo chmod -R 777 /homarr You need to run this command only on homarr folder
Serenaphic
Serenaphic2mo ago
-r stands for recursive so it applies to everything inside and not just the folder. you can do ls -lhs to check the permissions, owner and groups of a file or directory.
this_is_nate
this_is_nateOP2mo ago
its able to create the directories, and these are what I see from the host, but its failing all the chown operations in the container and restarting
No description
this_is_nate
this_is_nateOP2mo ago
I don't know what the 1001 and 65533 user / groups are, I haven't set those and I'm unable to tell the container to use different uid/gid
Serenaphic
Serenaphic2mo ago
1000 and 1001 are usually the first user made for the system. 65533 is the last group ID (there can't be a higher ID than this one). It's not really important though if you end up doing a chmod -R 777 anyway Here we can see your folders have 755 permissions, not 777. And I wouldn't be able to tell you for the nested files
this_is_nate
this_is_nateOP2mo ago
With the parent folder set to 777, these are the permissions the container creates the folders with. There are no items in the folders, and recursively marking everything in the parent folder 777 results in the same error with the chown operation not being permitted. Identical behavior when using a docker volume vs a bind
Serenaphic
Serenaphic2mo ago
Also, the owner being 1001 seems to mean you should already have the right owner. Try to keep everything and just manually chown the folders and the contents. sudo chown -R 1001:1001 /mnt/config/homarr-beta Then do the same with sudo chmod -R 777 /mnt/config/homarr-beta
this_is_nate
this_is_nateOP2mo ago
okay, got a different error now su-exec: setgroups(1001): Operation not permitted
this_is_nate
this_is_nateOP2mo ago
No description
Serenaphic
Serenaphic2mo ago
could you share the ls -lhsR instead? it would show us the persmissions and files that are in the directories too
this_is_nate
this_is_nateOP2mo ago
No description
Serenaphic
Serenaphic2mo ago
I'm out of ideas, permissions are a pain sometimes. @Meierschlumpf ?
Meierschlumpf
Meierschlumpf2mo ago
Do you have a user with id 1001 on your instance? If so maybe it's conflicting with the one in the container (probably not) Can we maybe start over, because with the current state I don't think we will get anywhere What user runs portainer, does it have access to create the directories and chown them? Also you don't specify a user in your portainer that should be used to run it I guess, right? If so thats good, if you specify one please try again with removing him
this_is_nate
this_is_nateOP2mo ago
ps -aux shows this for the portainer process: root 3072 0.3 0.4 1304280 75432 ? Ssl 09:23 0:02 /portainer so I assume root is running it, and should have access to create directories / chown. I've also tried setting the /appdata bind to a directory in my user's home directory, with the exact same errors
Meierschlumpf
Meierschlumpf2mo ago
What exactly is the error you get from chown?
this_is_nate
this_is_nateOP2mo ago
chown: /appdata/db: Operation not permitted
chown: /appdata/redis: Operation not permitted
chown: /appdata/db: Operation not permitted
chown: /appdata/redis: Operation not permitted
Meierschlumpf
Meierschlumpf2mo ago
Okay I would suggest that we in a first step find out why this is the case. I'll publish a specific image tag for you that will run the whoami command before the chown. Then we will know, why we are not allowed to change it. You don't have specified a User under Runtime & Resource in the Advanced container settings, right?
this_is_nate
this_is_nateOP2mo ago
No user set. Thank you for the help!
No description
Meierschlumpf
Meierschlumpf2mo ago
Okay good that there is no user Then it should use the container default in theory When I haven't screwed up with triggering the release pipeline, I'll let you know in about 25 minutes when the image tag portainer-operation-denied is ready I've added the following two lines btw:
echo $(whoami)
echo $(ls -la /appdata)
echo $(whoami)
echo $(ls -la /appdata)
this_is_nate
this_is_nateOP2mo ago
In my research I did see that whoami could be useful in this context but didn't want to mess with the start command
Meierschlumpf
Meierschlumpf2mo ago
Okay image tag is ready
this_is_nate
this_is_nateOP2mo ago
nextjs
total 16
drwxrwxrwx 4 nextjs nodejs 4096 Dec 19 15:27 .
drwxr-xr-x 1 root root 4096 Dec 19 17:35 ..
drwxrwxrwx 2 nextjs nodejs 4096 Dec 19 15:27 db
drwxrwxrwx 2 nextjs nodejs 4096 Dec 19 15:27 redis
su-exec: setgroups(1001): Operation not permitted
nextjs
total 16
drwxrwxrwx 4 nextjs nodejs 4096 Dec 19 15:27 .
drwxr-xr-x 1 root root 4096 Dec 19 17:35 ..
drwxrwxrwx 2 nextjs nodejs 4096 Dec 19 15:27 db
drwxrwxrwx 2 nextjs nodejs 4096 Dec 19 15:27 redis
su-exec: setgroups(1001): Operation not permitted
this_is_nate
this_is_nateOP2mo ago
same command from host system
No description
Meierschlumpf
Meierschlumpf2mo ago
Have you changed something with chown yourself or why now the su-exec failed and no longer the chown? Also it's pretty weird that it already has user nextjs before the su-exec. Because it should be root
this_is_nate
this_is_nateOP2mo ago
My apologies, that was after I chowned it on the host system. This is from a freshly created and chmod 777'd bind:
nextjs
total 16
drwxrwxrwx 4 node node 4096 Dec 19 17:44 .
drwxr-xr-x 1 root root 4096 Dec 19 17:39 ..
drwxr-xr-x 2 nextjs nogroup 4096 Dec 19 17:44 db
drwxr-xr-x 2 nextjs nogroup 4096 Dec 19 17:44 redis
nextjs
total 16
drwxrwxrwx 4 node node 4096 Dec 19 17:44 .
drwxr-xr-x 1 root root 4096 Dec 19 17:39 ..
drwxr-xr-x 2 nextjs nogroup 4096 Dec 19 17:44 db
drwxr-xr-x 2 nextjs nogroup 4096 Dec 19 17:44 redis
this_is_nate
this_is_nateOP2mo ago
with this being from host system
No description
Meierschlumpf
Meierschlumpf2mo ago
And one without any chmod?
this_is_nate
this_is_nateOP2mo ago
that one fails with mkdir: can't create directory '/appdata/db': Permission denied and no echo
Meierschlumpf
Meierschlumpf2mo ago
Okay I see, so I guess I should have placed the whoami before the mkdirs New image with newly positioned debug statements is up, you can try again
this_is_nate
this_is_nateOP2mo ago
nextjs

total 56
drwxr-xr-x 1 root root 4096 Dec 19 17:55 .
drwxr-xr-x 1 root root 4096 Dec 19 18:36 ..
drwxr-xr-x 1 nextjs nodejs 4096 Dec 19 17:54 apps
drwxr-xr-x 2 nextjs nodejs 4096 Dec 19 17:54 build
drwxr-xr-x 3 nextjs nodejs 4096 Dec 19 17:54 db
-rwxr-xr-x 1 root root 203 Dec 19 17:50 entrypoint.sh
-rw-r--r-- 1 nextjs nodejs 402 Dec 19 17:50 generateRandomSecureKey.js
-rw-r--r-- 1 root root 1362 Dec 19 17:50 next.config.mjs
drwxr-xr-x 116 nextjs nodejs 4096 Dec 19 17:54 node_modules
-rw-r--r-- 1 nextjs nodejs 2731 Dec 19 17:54 package.json
drwxr-xr-x 25 nextjs nodejs 4096 Dec 19 17:54 packages
-rw-r--r-- 1 nextjs nodejs 126 Dec 19 17:50 redis.conf
-rw-r--r-- 1 nextjs nodejs 1627 Dec 19 17:50 run.sh
drwxr-xr-x 2 nextjs nodejs 4096 Dec 19 17:54 static-data

total 8
drwxrwxr-x 2 node node 4096 Dec 19 18:36 .
drwxr-xr-x 1 root root 4096 Dec 19 18:36 ..

mkdir: can't create directory '/appdata/db': Permission denied
nextjs

total 56
drwxr-xr-x 1 root root 4096 Dec 19 17:55 .
drwxr-xr-x 1 root root 4096 Dec 19 18:36 ..
drwxr-xr-x 1 nextjs nodejs 4096 Dec 19 17:54 apps
drwxr-xr-x 2 nextjs nodejs 4096 Dec 19 17:54 build
drwxr-xr-x 3 nextjs nodejs 4096 Dec 19 17:54 db
-rwxr-xr-x 1 root root 203 Dec 19 17:50 entrypoint.sh
-rw-r--r-- 1 nextjs nodejs 402 Dec 19 17:50 generateRandomSecureKey.js
-rw-r--r-- 1 root root 1362 Dec 19 17:50 next.config.mjs
drwxr-xr-x 116 nextjs nodejs 4096 Dec 19 17:54 node_modules
-rw-r--r-- 1 nextjs nodejs 2731 Dec 19 17:54 package.json
drwxr-xr-x 25 nextjs nodejs 4096 Dec 19 17:54 packages
-rw-r--r-- 1 nextjs nodejs 126 Dec 19 17:50 redis.conf
-rw-r--r-- 1 nextjs nodejs 1627 Dec 19 17:50 run.sh
drwxr-xr-x 2 nextjs nodejs 4096 Dec 19 17:54 static-data

total 8
drwxrwxr-x 2 node node 4096 Dec 19 18:36 .
drwxr-xr-x 1 root root 4096 Dec 19 18:36 ..

mkdir: can't create directory '/appdata/db': Permission denied
Meierschlumpf
Meierschlumpf2mo ago
Okay it's weird that it still runs with nextjs user
this_is_nate
this_is_nateOP2mo ago
I had homarr-alpha running without issues on a NAS smb share with the nobody:share user/group, but that NAS is down today due to a bad power supply so I was trying to set up the mount directly on the host. Regular <1.0 homarr works without issues too
No description
Meierschlumpf
Meierschlumpf2mo ago
Yes as we previously had run the things as root (in regular < 1.0) You use portainer you said, right? I'll try to setup it on my machine and let you know if I can reproduce the issue
this_is_nate
this_is_nateOP2mo ago
yep, I'm on portainer 2.21.4
Solution
Meierschlumpf
Meierschlumpf5w ago
Okay I just setup portainer and took a look. It seems like you currently have somehow defined that it needs to run with the nextjs user see your inspection in Config > User above Volumes. For me this field is an empty string: "User": "" So I guess you have configured this somewhere in your portainer configuration
this_is_nate
this_is_nateOP5w ago
Hmm alright I'll take a look and see if I can remove that. Thanks! I tried just creating a new container in portainer with a new directory and it looks like that worked. In hindsight, I may have been duplicating my homarr-alpha container and maybe that's how the user got in somehow
Meierschlumpf
Meierschlumpf5w ago
Okay great that you were able to solve it!

Did you find this page helpful?