Unable to start docker with Synology NAS mounted by CIFS

Steps to reproduce

  1. Follow Owncloud documentation to install with docker

  2. Modify docker-compose.yml file to point to mount location (/mnt/Owncloud2) defined in /etc/fstab

  3. Start docker with docker compose up

Expected behaviour

Container should start and service becomes available

Actual behaviour

Container fails to start with repeated failures after Fixing data perms… with the error message find: ‘/mnt/data/#recycle’: Permission denied

Server configuration

Operating system: Ubuntu 24.04

Web server: Apache2

Database: Mariadb

PHP version: 7.4?

ownCloud version: latest as of July 14th 2026

Updated from an older ownCloud or fresh install: fresh

Where did you install ownCloud from: docker pull

Signing status (ownCloud 9.0 and above): unknown

Are you using external storage, if yes which one: NAS with network drive mounted with cifs at /mnt/Owncloud2

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: Firefox

Operating system: Windows 11

Logs

ownCloud log (data/owncloud.log)

[+] Running 3/3
 ✔ Container owncloud_redis    Created                                                                                                                                0.0s
 ✔ Container owncloud_mariadb  Created                                                                                                                                0.0s
 ✔ Container owncloud_server   Created                                                                                                                                0.0s
Attaching to owncloud_mariadb, owncloud_redis, owncloud_server
owncloud_redis    | 1:C 14 Jul 2026 21:13:06.366 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
owncloud_redis    | 1:C 14 Jul 2026 21:13:06.366 # Redis version=6.2.22, bits=64, commit=00000000, modified=0, pid=1, just started
owncloud_redis    | 1:C 14 Jul 2026 21:13:06.366 # Configuration loaded
owncloud_redis    | 1:M 14 Jul 2026 21:13:06.366 * monotonic clock: POSIX clock_gettime
owncloud_redis    | 1:M 14 Jul 2026 21:13:06.366 * Running mode=standalone, port=6379.
owncloud_redis    | 1:M 14 Jul 2026 21:13:06.366 # Server initialized
owncloud_redis    | 1:M 14 Jul 2026 21:13:06.366 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
owncloud_redis    | 1:M 14 Jul 2026 21:13:06.367 * Loading RDB produced by version 6.2.22
owncloud_redis    | 1:M 14 Jul 2026 21:13:06.367 * RDB age 31 seconds
owncloud_redis    | 1:M 14 Jul 2026 21:13:06.367 * RDB memory usage when created 0.77 Mb
owncloud_redis    | 1:M 14 Jul 2026 21:13:06.367 # Done loading RDB, keys loaded: 0, keys expired: 0.
owncloud_redis    | 1:M 14 Jul 2026 21:13:06.367 * DB loaded from disk: 0.000 seconds
owncloud_redis    | 1:M 14 Jul 2026 21:13:06.367 * Ready to accept connections
owncloud_mariadb  | 2026-07-14 21:13:06+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.11.18+maria~ubu2204 started.
owncloud_server   | Creating volume folders...
owncloud_server   | Creating hook folders...
owncloud_server   | Waiting for MySQL...
owncloud_mariadb  | 2026-07-14 21:13:06+00:00 [Warn] [Entrypoint]: /sys/fs/cgroup///memory.pressure not writable, functionality unavailable to MariaDB
owncloud_mariadb  | 2026-07-14 21:13:06+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
owncloud_mariadb  | 2026-07-14 21:13:06+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.11.18+maria~ubu2204 started.
owncloud_mariadb  | 2026-07-14 21:13:06+00:00 [Note] [Entrypoint]: MariaDB upgrade not required
owncloud_mariadb  | 2026-07-14 21:13:06 0 [Note] Starting MariaDB 10.11.18-MariaDB-ubu2204 source revision 197f92bee02d8e836f529f37625be69b83e7acbd server_uid iAw6v/fHJmNL21HL+6eubV5RXCM= as process 1
owncloud_mariadb  | 2026-07-14 21:13:06 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
owncloud_mariadb  | 2026-07-14 21:13:06 0 [Note] InnoDB: Number of transaction pools: 1
owncloud_mariadb  | 2026-07-14 21:13:06 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
owncloud_mariadb  | 2026-07-14 21:13:06 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
owncloud_mariadb  | 2026-07-14 21:13:06 0 [Warning] mariadbd: io_uring_queue_init() failed with EPERM: sysctl kernel.io_uring_disabled has the value 2, or 1 and the user of the process is not a member of sysctl kernel.io_uring_group. (see man 2 io_uring_setup).
owncloud_mariadb  | create_uring failed: falling back to libaio
owncloud_mariadb  | 2026-07-14 21:13:06 0 [Note] InnoDB: Using Linux native AIO
owncloud_mariadb  | 2026-07-14 21:13:06 0 [Note] InnoDB: innodb_buffer_pool_size_max=8388608m, innodb_buffer_pool_size=128m
owncloud_mariadb  | 2026-07-14 21:13:06 0 [Note] InnoDB: Completed initialization of buffer pool
owncloud_mariadb  | 2026-07-14 21:13:06 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes)
owncloud_mariadb  | 2026-07-14 21:13:06 0 [Note] InnoDB: End of log at LSN=44894
owncloud_mariadb  | 2026-07-14 21:13:06 0 [Note] InnoDB: 128 rollback segments are active.
owncloud_mariadb  | 2026-07-14 21:13:06 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
owncloud_mariadb  | 2026-07-14 21:13:06 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
owncloud_mariadb  | 2026-07-14 21:13:06 0 [Note] InnoDB: log sequence number 44894; transaction id 14
owncloud_mariadb  | 2026-07-14 21:13:06 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
owncloud_mariadb  | 2026-07-14 21:13:06 0 [Note] Plugin 'FEEDBACK' is disabled.
owncloud_mariadb  | 2026-07-14 21:13:06 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
owncloud_mariadb  | 2026-07-14 21:13:06 0 [Note] InnoDB: Buffer pool(s) load completed at 260714 21:13:06
owncloud_mariadb  | 2026-07-14 21:13:06 0 [Note] Server socket created on IP: '0.0.0.0', port: '3306'.
owncloud_mariadb  | 2026-07-14 21:13:06 0 [Note] Server socket created on IP: '::', port: '3306'.
owncloud_mariadb  | 2026-07-14 21:13:06 0 [Note] mariadbd: ready for connections.
owncloud_mariadb  | Version: '10.11.18-MariaDB-ubu2204'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
owncloud_server   | services are ready!
owncloud_mariadb  | 2026-07-14 21:13:07 3 [Warning] Aborted connection 3 to db: 'unconnected' user: 'unauthenticated' host: '172.20.0.4' (This connection closed normally without authentication)
owncloud_server   | Waiting for Redis...
owncloud_server   | services are ready!
owncloud_server   | Writing config file...
owncloud_server   | Fixing base perms...
owncloud_server   | Fixing data perms...
owncloud_server   | find: '/mnt/data/#recycle': Permission denied
owncloud_server exited with code 0
owncloud_server   | Creating volume folders...
owncloud_server   | Creating hook folders...
owncloud_server   | Waiting for MySQL...
owncloud_server   | services are ready!
owncloud_mariadb  | 2026-07-14 21:13:07 4 [Warning] Aborted connection 4 to db: 'unconnected' user: 'unauthenticated' host: '172.20.0.4' (This connection closed normally without authentication)
owncloud_server   | Waiting for Redis...
owncloud_server   | services are ready!
owncloud_server   | Writing config file...
owncloud_server   | Fixing base perms...
owncloud_server   | Fixing data perms...
owncloud_server   | find: '/mnt/data/#recycle': Permission denied
owncloud_server exited with code 1
owncloud_server   | Creating volume folders...
owncloud_server   | Creating hook folders...
owncloud_server   | Waiting for MySQL...
owncloud_server   | services are ready!
owncloud_mariadb  | 2026-07-14 21:13:08 5 [Warning] Aborted connection 5 to db: 'unconnected' user: 'unauthenticated' host: '172.20.0.4' (This connection closed normally without authentication)

Additional Discussion

I’m unsure what permissions need to be granted to my media mount as the install docs are light on information such as this. I’ve set the owner and group to www-data with 770 permissions, as this worked for my previous manual install of Owncloud.

Additionally, I believe there may be more going on here as the “#recycle” folder is native to the Synology shared folder structure - deleted items go to #recycle to be reviewed/deleted/restored from the NAS interface. There are some permissions that can be changed but they aren’t the familiar r/w/x presented in most operating systems.

My docker-compose.yml file has just 1 modification from the default config given in the docs:

services:
  owncloud:
    ...
    volumes:
      - /mnt/Owncloud2:/mnt/data
  ...

I’m not confident this is the correct way to point the container to external storage, but it’s how another user found success.

/etc/fstab Contents

//192.168.1.2/Owncloud2  /mnt/Owncloud2  cifs  credentials=/.credsfile,vers=2.0,uid=www-data,gid=www-data,dir_mode=770,file_mode=770,_netdev

Happy to run commands to help get to the bottom of whatever is going on here, thank you in advance!

1 Like

Well, I searched the GitHub repo for the docker image and found where the error message is coming from. I was able to add OWNCLOUD_SKIP_CHOWN=true to the environment variables in docker-compose.yml and the container started up!
However, this feels like cheating and I’m not letting the permissions be written/corrected as intended. Would be nice to know how to fix this for permanent running.

1 Like

OWNCLOUD_SKIP_CHOWN=true is not a workaround here — on a CIFS mount it’s the correct setting. Here’s why.

Why it fails: The container’s entrypoint runs a “Fixing data perms…” step that chowns the data directory to www-data and walks the tree with find. It dies on /mnt/data/#recycle — Synology’s built-in recycle-bin folder that exists on every shared folder and is owned by the NAS’s system account with locked-down permissions.

The deeper reason it can’t work: a CIFS/SMB mount is not a POSIX filesystem. Ownership and permissions are fixed at mount time by the uid=, gid=, file_mode=, dir_mode= options in your /etc/fstab line — the whole share shows up as owned by a single uid. You cannot chown individual files on a CIFS mount, so the entrypoint’s permission walk is doomed regardless.

OWNCLOUD_SKIP_CHOWN=true skips that walk entirely, so find never touches #recycle. There’s nothing to chown, because the mount itself decides ownership. Set the ownership in fstab instead:

//NAS/Owncloud2  /mnt/Owncloud2  cifs  credentials=/root/.smbcred,uid=33,gid=33,file_mode=0770,dir_mode=0770,nofail,_netdev,vers=3.0  0  0
  • uid=33,gid=33 = the container’s www-data, so the files already appear correctly owned.
  • _netdev,nofail = don’t hang/fail boot if the NAS is slow or offline.
  • vers=3.0 = pin the SMB version (avoids negotiation quirks with Synology).

Do not put ownCloud’s data directory on a CIFS/SMB share. ownCloud needs POSIX semantics — byte-range locking, atomic renames, reliable fsync/mtime — that CIFS doesn’t provide dependably. This shows up over time as file-locking errors, failed syncs, and filecache/DB inconsistency.

Supported options for the data directory:

  • Local disk — simplest and most reliable.
  • NFS — provides the POSIX semantics ownCloud relies on, and is a valid choice for network storage.

If the goal is to access the NAS content inside ownCloud, add the SMB share through Settings → Storage → External Storage (the SMB/CIFS backend) rather than as the primary data directory.


This reply was generated with AI assistance.

2 Likes

Thank you for the reply - it definitely explains everything I was seeing. Although I guess I’m a little confused what the “most correct” solution for external NAS storage is: NFS mount or setting up external storage through the UI. Does this just come down to administrative preference?

Follow up - I switched the mount to NFS, removed OWNCLOUD_SKIP_CHOWN=true and now have a running instance of Owncloud in docker again.

However!

The performance of uploads is incredibly slow compared to what it used to be with my manual install and CIFS mount. My NAS is showing somewhere around 3-6 MBps write speed where it used to be around 60 MBps. How can I find, and hopefully resolve, the bottleneck?