Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Permission issues on '/tmp' in many docker containers

Featured Replies

Hi! 

 

Lately, a bunch of my docker containers started having trouble writing to their /tmp folders. They always mention permission denied. Dockers with this problem include but are not limited to Nextcloud, WordPress, MariaDB, Baikal, ...

I haven't been able to find a fix for this, neither have I been able to identify why this is happening. However, I need this fixed ASAP.

 

I am using unRAID version 9.6.2

 

Thanks!

Edited by maartenweyns

Hi,

 

I have the same issue - i have to change the permission using chmod 777 manually. 

 

I also ran the docker permission check\fix but still have the same issue.

 

Thanks

+1 to the issue. Reinstalled the flash drive again. Copied contents from the old /boot/config directory and I am seeing the same errors related to permission on the /tmp.

  • 4 weeks later...

Yes, I've been having the same problem since I started using Unraid. It isn't the end of the world, but it is very annoying to need to remember to change the permissions of my Nextcloud's folder in tmp after a reboot. Can anybody shine any light on this problem?

Edited by Hammy Havoc

Unless you map /tmp to host storage, each container has its own /tmp folder, and that would be inside that container's image within docker.img where it can't be easily affected by anything such as new perms or Unraid command line unless you go to a command line inside the container.

 

Does anybody on this thread have anything they can show such as error messages or screenshots?

Hello,

 

I have the issue too.

After a reboot of Unraid, the /tmp and /var/tmp folders are set with permissions 755 in every docker containers.

To correct this, I have to chmod 777 the folders and the permissions remain set to 777 even after a container restart.

 

I also tried to disable/enable the Docker service via Unraid GUI and the same issue occured. So it seems to come from either the service shutdown or start.

I did this test again but the issue didn't occured. I certainly did it wrong the first time, sorry for that 😅

 

I'm on Unraid 6.9.2 with Docker 20.10.5.

 

As example, I have a container running the image of linuxserver/mariadb, when this container launches, mariadb will log this error 
[ERROR] mariadbd: Can't create/write to file '/var/tmp/ibXXXXXX' (Errcode: 13 "Permission denied")

Edited by MewFortyTwo
Correct after having redone a test

6 minutes ago, MewFortyTwo said:

/tmp and /var/tmp folders are set with permissions 755 in every docker containers.

Do you mean you actually went to the command line within each container to see this? (click container icon, select >_ Console) 

13 hours ago, trurl said:

Unless you map /tmp to host storage, each container has its own /tmp folder, and that would be inside that container's image within docker.img where it can't be easily affected by anything such as new perms or Unraid command line unless you go to a command line inside the container.

 

Does anybody on this thread have anything they can show such as error messages or screenshots?

My container config for `/tmp` is set to `/tmp/nextcloud/`. Nextcloud is the only container I'm having problems with in regards to this (to my knowledge at least), everything else seems to work just fine, and I'm running a lot of containers. Sorry I can't be helpful, I'm not hugely familiar with Unraid's implementation of Docker.

 

Silly question of the day: as this folder is showing up in `/tmp/nextcloud/`, does this mean that it isn't actually within the docker.img itself? And is this thus not a recommended/advisable configuration? :- )

1 hour ago, Hammy Havoc said:

Silly question of the day: as this folder is showing up in `/tmp/nextcloud/`, does this mean that it isn't actually within the docker.img itself? And is this thus not a recommended/advisable configuration? :- )

/tmp on the host is in OS rootfs. OS rootfs is in RAM. The OS is unpacked fresh from the archives on flash at each reboot, and runs completely in RAM. Think of it as firmware.

 

So using /tmp on the host will not survive. Also if you fill up rootfs the OS will misbehave since it won't be able to work with its own files. Only mounted storage persists.

4 hours ago, MewFortyTwo said:

I also tried to disable/enable the Docker service via Unraid GUI and the same issue occured. So it seems to come from either the service shutdown or start.

 

 

I did this test again but the issue didn't occured. I certainly did it wrong the first time, sorry for that 😅

 

 

4 hours ago, trurl said:

Do you mean you actually went to the command line within each container to see this? (click container icon, select >_ Console) 

 

I did this test on command line within five differents container with differents images and for the five the permissions of /tmp and /var/tmp was reset to 755 after an Unraid full reboot.
There is the list of the image name :

  • 4 weeks later...

As I have the same problem, I "solved" if by creating the dirs on boot time with chmod 777 permissions through the Go file:

 

# -------------------------------------------------
# Correct wrong container path permissions on server reboot
# -------------------------------------------------
mkdir -m 777 -p /tmp/nginx-proxy-manager/var/log
mkdir -m 777 -p /tmp/pihole/var/log/lighttpd

 

It seems the permissions are set different if a container is created or started (and the dirs do not exist).

 

But I'm still testing...

  • 1 month later...
  • Author

So have there been any updates on this? This problem is still happening for me, especially after a server restart or anything similar.

Same goes for me. It's a real pain ...

After each restart I have to change the permissions of /tmp and /var/tmp for ~7 containers.

Edited by mcdax

18 minutes ago, mcdax said:

Same goes for me. It's a real pain ...

After each restart I have to change the permissions of /tmp and /var/tmp for ~7 containers.

 

On 12/15/2021 at 2:40 PM, mgutt said:

As I have the same problem, I "solved" if by creating the dirs on boot time with chmod 777 permissions through the Go file:

 

# -------------------------------------------------
# Correct wrong container path permissions on server reboot
# -------------------------------------------------
mkdir -m 777 -p /tmp/nginx-proxy-manager/var/log
mkdir -m 777 -p /tmp/pihole/var/log/lighttpd

 

It seems the permissions are set different if a container is created or started (and the dirs do not exist).

 

But I'm still testing...

 

For that you have to mount the container-tmp directory to your host-tmp directory. 

Sure, it helps, but it sounds like a nasty workaround to me.

 

Same as my solution:
docker container exec sabnzbd chmod 777 /tmp

docker container exec mariadb chmod 777 /tmp

...

 

If I run the same images on my workstation with docker(-compose), I don't have such problems.

Edited by mcdax

  • 3 years later...

Was a solution ever discovered for this issue? I'm experiencing it for several containers

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.