Chown failed, operation not permitted errors on nextcloud startup

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 31.0.1
  • Operating system and version (e.g., Ubuntu 24.04):
    • Kubuntu 24.04
  • Web server and version (e.g, Apache 2.4.25):
    • didn’t know how to check
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • nginx 2.12.3
  • PHP version (e.g, 8.3):
    • 8.3.19
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • After I fixed some other issues with my installation
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Nextcloud docker image in a docker compose stack
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No
  • Filesystem?
    • ext4

Summary of the issue you are facing:

I’m running into an issue with the nextcloud docker image in my docker compose stack. The stack consists of nextcloud, mariadb, redis and nginx, and all of them seem to be running fine, except nextcloud. When i run docker compose up, nextcloud throws many versions of the same error:

rsync: [generator] chown "/var/www/html/dist/updatenotification-view-changelog-page.js.map.license" failed: Operation not permitted (1)

Keep in mind I’m new to linux. So if I understand correctly, chown is the command to change ownership of files. So those errors sound like permission problems to me, but I have no idea why they pop up.

Log entries

Nextcloud

2025-03-17 02:28:27 rsync: [generator] chown "/var/www/html/dist/core-legacy-unified-search.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:27 rsync: [generator] chown "/var/www/html/dist/core-login.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:27 rsync: [generator] chown "/var/www/html/dist/core-main.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:27 rsync: [generator] chown "/var/www/html/dist/core-maintenance.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/core-public-page-menu.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/core-public.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/core-recommendedapps.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/core-systemtags.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/core-unified-search.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/core-unsupported-browser-redirect.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/core-unsupported-browser.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/dashboard-main.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/dav-settings-admin-caldav.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/dav-settings-personal-availability.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/federatedfilesharing-external.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/federatedfilesharing-vue-settings-admin.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/federatedfilesharing-vue-settings-personal.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/files-init.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/files-main.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/files-reference-files.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/files-search.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/files-settings-personal.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/files-sidebar.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/files_external-init.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/files_external-settings.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/files_reminders-init.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/files_sharing-additionalScripts.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/files_sharing-collaboration.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/files_sharing-files_sharing_tab.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/files_sharing-init-public.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/files_sharing-init.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/files_sharing-main.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/files_sharing-personal-settings.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/files_sharing-public-file-request.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/files_trashbin-init.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/files_versions-files_versions.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/oauth2-oauth2.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/profile-main.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/settings-apps-view-4529.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/settings-apps.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/settings-declarative-settings-forms.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/settings-legacy-admin.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/settings-users-3239.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/settings-vue-settings-admin-ai.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/settings-vue-settings-admin-basic-settings.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/settings-vue-settings-admin-delegation.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/settings-vue-settings-admin-security.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/settings-vue-settings-admin-sharing.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/settings-vue-settings-apps-users-management.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/settings-vue-settings-nextcloud-pdf.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/settings-vue-settings-personal-info.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/settings-vue-settings-personal-password.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/settings-vue-settings-personal-security.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/settings-vue-settings-personal-webauthn.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/sharebymail-vue-settings-admin-sharebymail.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/systemtags-admin.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/systemtags-init.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/theming-admin-theming.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/theming-personal-theming.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/twofactor_backupcodes-settings.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/updatenotification-init.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/updatenotification-update-notification-legacy.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/updatenotification-updatenotification.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/updatenotification-view-changelog-page.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/user-status-modal-5133.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/user_status-menu.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/weather_status-weather-status.js.map.license" failed: Operation not permitted (1)
2025-03-17 02:28:28 rsync: [generator] chown "/var/www/html/dist/workflowengine-workflowengine.js.map.license" failed: Operation not permitted (1)

It’s all the same, same error every time, and all files this applies to are in /var/www/html.


(No config file, it wasn’t created it, this is literally immediately after running nextcloud the first time).

The error means that rsync, i.e. copying/synchronising files, is not working. Rsync cannot change the user rights accordingly on the target system.

One reason may be that the target system is not an EXT4 or other Linux file system. Perhaps you are trying to perform the backup on an NTFS system.

Give us more information about the configuration of your backup or where the problem occurs. Post as many details as possible.

Yes it is correct. But please improve your linux knowledge. You may need this if you make a mistake. Also test the backups of your Nextcloud from time to time, e.g. on test systems. Restore there your complete Nextcloud.

Thanks for your response! I’m unsure of what you mean by that, as I’m not backing up anything myself, this is just the output of nextcloud first start (and every following) without anything changed in the config.

I’ve looked at that as well, and it actually was NTFS in the beginning, but I reformatted the drive to EXT4 and completely wiped and reinstalled the entire nextcloud stack, that shouldn’t be the issue. I’ve btw also tried chmod -R 777 on the entire nextcloud directory, but that didn’t change anything unfortunately.

Btw, here is my compose.yaml:

---
version: '3'
name: DockerServer 
services:
  nextcloud:
    image: nextcloud
    container_name: nextcloud
    restart: unless-stopped
    networks: 
      - cloud
    depends_on:
      - nextclouddb
      - redis
    ports:
      - 8081:80
    volumes:
      - ./nextcloud/html:/var/www/html
      - ./nextcloud/custom_apps:/var/www/html/custom_apps
      - ./nextcloud/config:/var/www/html/config
      - ./nextcloud/data:/var/www/html/data
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Berlin
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_PASSWORD=---------
      - MYSQL_HOST=nextclouddb
      - REDIS_HOST=redis

  nextclouddb:
    image: mariadb
    container_name: nextcloud-db
    restart: unless-stopped
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    networks: 
      - cloud
    volumes:
      - ./nextclouddb:/var/lib/mysql
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Los_Angeles
      - MYSQL_RANDOM_ROOT_PASSWORD=true
      - MYSQL_PASSWORD=----------------
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  redis:
    image: redis:alpine
    container_name: redis
    volumes:
      - ./redis:/data/redis
    networks: 
      - cloud
  
  nginx-proxy:
    image: 'jc21/nginx-proxy-manager:latest'
    container_name: nginx-proxy
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Berlin
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - ./nginx/data:/data
      - ./nginx/letsencrypt:/etc/letsencrypt

networks:
  cloud:
    name: cloud
    driver: bridge

Are you running your Docker environment rootless perhaps?

It appears you may be trying to run your containers as a UID/GID combo other than the default. The above is not the standard way of doing so (though it is commonly used by some image builders such as LSIO) and is not supported by the official Nextcloud images. Instead, use the Docker/container standard method by using the user parameter.

See Running as an arbitrary user.

e.g.

  nextcloud:
    [...]
    user: 1000:1000

You may need to clean up the permissions and ownership manually one more time in your existing environment with your ./nextcloud host volumes.

Thanks for your response! I’m not well versed with the ownership and permission structure in linux, I’m currently learning that. The PUID and PGID setting was set because I followed this guide to set up a nextcloud docker compose stack.
Anyways, I tried your suggestion, unfortunately it didn’t work. After the containers had started, nextcloud spat out this (many times, always trying to configure redis as session handler):

/entrypoint.sh: 111: cannot create /usr/local/etc/php/conf.d/redis-session.ini: Permission denied

I also tried just not setting any user setting, letting it use whatever default user it wants, but that failed with the error described in my first post (chown not permitted).
Btw, I also checked, the directory in which my nextcloud, nginx, nextclouddb and redis volumes are located, is set to rwxrwxrwx, and the ownership to benjamin (my user).
I’m honestly pretty lost at this point.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.