Touch: setting times of '...sync.lock': operation not permitted

I’m trying to run Nextcloud on my Raspberry Pi 4 using the official Docker image, which is Nexcloud 24.0.3.2, currently.

I am able to pull the image using the command “docker pull nextcloud”, and have verified that the image appears in the list of docker images from “docker image ls”
its_there

But when I attempt to actually start a container from the image, I get an error saying “touch: setting times of ‘/var/www/html/nextcloud-init-sync.lock’: Operation not permitted”

I get this same error message regardless of whether I try the nextcloud:latest or nextcloud:apache images(the nextcloud:none image is a previous version that has been partially deleted improperly, I think).

I don’t have a very thorough understanding of Docker, but the nextcloud image’s Github readme says that /var/www/html is an “unnamed Docker volume” used for data storage.

Do I need to give myself write permissions for this Docker volume, so I can touch it? How would I even set permissions for stuff inside a Docker volume?

1 Like

I have the same problem with nextcloud 25.0.3.2 on Raspberry Pi 4. Have you found a solution?

I did some research and found a workaround.

This causes the problem:

Unfortunately Raspbian uses some very old packages. There is nothing we can fix in our image. :confused:

Source: Raspberry Pi / Docker latest image not compatible due to timesync ¡ Issue #1589 ¡ nextcloud/docker ¡ GitHub

There is a workaround, by giving extended privileges to the nextcloud container:

I did another investigation and deleted the lock file many times. After some time I found out that if I run the nextcloud container as priviliged, the error touch: setting times of ‘/var/www/html/nextcloud-init-sync.lock’: Operation not permitted does not happen again and I could upgrade to 23.0.4.

Source: [Bug]: Upgrade 23.0.3 to 23.0.4 docker Server does not migrate ¡ Issue #1742 ¡ nextcloud/docker ¡ GitHub

But beware:

The --privileged flag gives all capabilities to the container. When the operator executes docker run --privileged, Docker will enable access to all devices on the host as well as set some configuration in AppArmor or SELinux to allow the container nearly all the same access to the host as processes running outside containers on the host. Additional information about running with --privileged is available on the Docker Blog.

Source: Docker run reference | Docker Docs


tl;dr: Give extended privileges to nextcloud container