Unable to backup AIO: The .ncdata or .ocdata file is missing

The Basics
  • Nextcloud Server version (e.g., 29.x.x):
    • 33.0.7
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 26.04
  • Web server and version (e.g, Apache 2.4.25):
    • Apache/2.4.68
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • Nginx 1.30.4
  • PHP version (e.g, 8.3):
    • php/8.3.32
  • Is this the first time you’ve seen this error? (Yes / No):
    • yes
  • When did this problem seem to first start?
    • since I wanted to use backups
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • AIO
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • no

Summary of the issue you are facing:

I wondered why my Nextcloud AIO instance would not update itself and according to this discussion the automatic updates are only scheduled when daily backups are configured. But so far I’ve been unable to enable those.

Steps to replicate it (hint: details matter!):

  1. Open the AIO interface and set the “Local backup location” to /mnt/backup. An encryption password is shown and I make a note of it.

  2. I click on “Create backup” and all containers (except nextcloud-aio-mastercontainer of course) are shutdown.

  3. The backup fails. The log from https://localhost:8080/log?id=nextcloud-aio-borgbackup can be seen below.

Changing the location to a remote location (e.g. ssh://nextcloud@host/backup) does not work either and a similar message is being shown, see below.

Logging in to the nextcloud-aio-mastercontainer gives the following picture:

$ docker exec --user www-data -it nextcloud-aio-mastercontainer /bin/sh

~/docker-aio $ df -h /mnt/backup/
Filesystem                Size      Used Available Use% Mounted on
/dev/xvdb                19.9G     10.9G      9.0G  55% /mnt/backup

~/docker-aio $ ls -la /mnt/backup/
total 0
drwxr-xr-x    2 root     root             6 Aug  5 20:08 .
drwxr-xr-x    1 root     root            46 Aug  5 21:23 ..

When I manually start the nextcloud-aio-nextcloud container:

$ docker exec --user www-data -it nextcloud-aio-nextcloud /bin/sh

/var/www/html $ df -h /mnt/ncdata/
Filesystem                      Size  Used Avail Use% Mounted on
nfs:/mnt/data/backup/nextcloud  3.7T  3.4T  314G  92% /mnt/ncdata


/var/www/html $ ls -la /mnt/ncdata/; cat /mnt/ncdata/.ncdata; echo
total 16
drwxr-x---  8 www-data www-data 4096 Aug 16 15:25 .
drwxr-xr-x  1 root     root       12 Aug 16 15:25 ..
-rw-r--r--  1 www-data www-data  542 Aug  5 20:44 .htaccess
-rw-r--r--  1 www-data www-data   52 Aug  5 20:44 .ncdata
dr-xr-x---  2     1008     1008   37 Aug  5 20:32 .ssh
drwxr-xr-x  4 www-data www-data   44 Jan 24  2026 admin
drwxr-xr-x 14 www-data www-data 4096 Jan 27  2026 appdata_ocnv3rg8ar1o
-rw-r--r--  1 www-data www-data    0 Jan 24  2026 audit.log
drwxr-x---  2 www-data www-data   33 Aug  5 21:27 backup
-rw-r--r--  1 www-data www-data    0 Aug  5 20:44 index.html
-rw-r--r--  1 www-data www-data    0 Jan 24  2026 nextcloud.log
drwxr-xr-x  6 www-data www-data   96 May 24 11:02 xenon

# Nextcloud data directory
# Do not change this file

But of course when the nextcloud-aio-mastercontainer starts its backup, it also stops the nextcloud-aio-nextcloud – and then the datadir is not available anymore. I really don’t know if this a bug or if I’m just holding it wrong. I came across a post AIO backup .ocdata missing? from 2024 which referenced a bug NC30: backup failes · Issue #5256 · nextcloud/all-in-one · GitHub , but that one has been resolved a long time ago and should not matter here.

Does anyone have an idea what’s going on?

Log entries

Nextcloud

=== local backup
2026-08-16T15:45:06.318202683Z The .ncdata or .ocdata file is missing in Nextcloud datadir which means it is invalid!
2026-08-16T15:45:06.318267408Z Is the drive where the datadir is located on still mounted?
2026-08-16T15:45:07.285882371Z touch: /nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/skip.update: Permission denied
2026-08-16T15:45:07.286399939Z chmod: /nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/skip.update: Permission denied

=== remote backup
2026-08-16T15:50:49.513632332Z Your public ssh key for borgbackup is: xxx
2026-08-16T15:50:49.521608655Z The .ncdata or .ocdata file is missing in Nextcloud datadir which means it is invalid!
2026-08-16T15:50:49.521683643Z Is the drive where the datadir is located on still mounted?
2026-08-16T15:50:50.365055428Z touch: /nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/skip.update: Permission denied
2026-08-16T15:50:50.367240304Z chmod: /nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/skip.update: Permission denied

Configuration

Nextcloud

The output of occ config:list system:

{
    "system": {
        "one-click-instance": true,
        "one-click-instance.user-limit": 100,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "check_data_directory_permissions": false,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 3,
            "read_timeout": 10
        },
        "overwritehost": "cloud.example.net",
        "overwriteprotocol": "https",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "cloud.example.net"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "33.0.7.1",
        "overwrite.cli.url": "https:\/\/cloud.example.net\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "updatechecker": false,
        "loglevel": 2,
        "log_type": "file",
        "logfile": "\/var\/www\/html\/data\/nextcloud.log",
        "log_rotate_size": 10485760,
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "preview_max_x": 2048,
        "preview_max_y": 2048,
        "jpeg_quality": 60,
        "enabledPreviewProviders": {
            "1": "OC\\Preview\\Image",
            "2": "OC\\Preview\\MarkDown",
            "3": "OC\\Preview\\MP3",
            "4": "OC\\Preview\\TXT",
            "5": "OC\\Preview\\OpenDocument",
            "6": "OC\\Preview\\Movie",
            "7": "OC\\Preview\\Krita",
            "0": "OC\\Preview\\Imaginary",
            "23": "OC\\Preview\\ImaginaryPDF",
            "24": "OCA\\Eurooffice\\Preview"
        },
        "enable_previews": true,
        "upgrade.disable-web": true,
        "mail_smtpmode": "smtp",
        "trashbin_retention_obligation": "auto, 30",
        "versions_retention_obligation": "auto, 30",
        "activity_expire_days": 30,
        "simpleSignUpLink.shown": false,
        "share_folder": "\/Shared",
        "one-click-instance.link": "https:\/\/nextcloud.com\/all-in-one\/",
        "upgrade.cli-upgrade-link": "https:\/\/github.com\/nextcloud\/all-in-one\/discussions\/2726",
        "updatedirectory": "\/nc-updater",
        "maintenance_window_start": 100,
        "allow_local_remote_servers": true,
        "davstorage.request_timeout": 3600,
        "documentation_url.server_logs": "https:\/\/github.com\/nextcloud\/all-in-one\/discussions\/5425",
        "htaccess.RewriteBase": "\/",
        "dbpersistent": false,
        "auth.bruteforce.protection.enabled": true,
        "ratelimit.protection.enabled": true,
        "files_external_allow_create_new_local": false,
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "onlyoffice": {
            "editors_check_interval": 0,
            "jwt_secret": "***REMOVED SENSITIVE VALUE***",
            "jwt_header": "AuthorizationJwt"
        },
        "preview_imaginary_url": "***REMOVED SENSITIVE VALUE***",
        "preview_imaginary_key": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "mail_smtpstreamoptions": {
            "ssl": {
                "allow_self_signed": true,
                "verify_peer": false,
                "verify_peer_name": false
            }
        },
        "default_phone_region": "DE",
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": [],
        "memories.db.triggers.fcu": true,
        "memories.exiftool": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/exiftool-amd64-musl",
        "memories.vod.path": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/go-vod-amd64",
        "memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
        "serverid": 445,
        "log_type_audit": "file",
        "logfile_audit": "\/var\/www\/html\/data\/audit.log",
        "update_channel": "stable",
        "eurooffice": {
            "editors_check_interval": 0,
            "jwt_secret": "***REMOVED SENSITIVE VALUE***",
            "jwt_header": "AuthorizationJwt"
        },
        "DOMAIN": "cloud.example.net",
        "AIO_VERSION": "v13.4.1"
    }
}

Hi, is the configured target datadir a nfs directory?

In that case you need to disable the squashroot (or comparable) option in your nfs server config.

Yes, the datadir is an NFS mount:

$ grep NEXTCLOUD_DATADIR compose.yaml 
      NEXTCLOUD_DATADIR: /home/nextcloud/data

$ df -h /home/nextcloud/data/
Filesystem                      Size  Used Avail Use% Mounted on
nfs:/mnt/data/backup/nextcloud  3.7T  3.4T  314G  92% /home/nextcloud/data

And the server does indeed disable root squashing:

nfs$ exportfs -v | grep -A1 /mnt/data/backup/nextcloud
/mnt/data/backup/nextcloud myclient(async,wdelay,hide,no_subtree_check,sec=sys,rw,insecure,no_root_squash,no_all_squash)

And Nextcloud works well otherwise: files are being synchronized from an Android phone, and from a macOS host w/o problems. “Only” the backup is not working.

Also, would the datadir location even matter if “remote backup” is selected? Then again, I don’t understand how the nextcloud-aio-mastercontainer would be able to access the datadir in the first place, since the datadir is mounted in the nextcloud-aio-nextcloud container – which is being shutdown during backup. :thinking:

The datadir is also mounted inside the borgbackup container so that it can backup its data

Hm, when I hit the “Create backup” button, the pop-up says:

Create backup? Are you sure that you want to create a backup? This will stop all running containers and create the backup.

So, before I have:

$ docker ps --format "table {{.Image}}\t{{.Names}}" | grep -e NAMES -e nextcloud
 IMAGE                                             NAMES
ghcr.io/nextcloud-releases/aio-apache:latest       nextcloud-aio-apache
ghcr.io/nextcloud-releases/aio-imaginary:latest    nextcloud-aio-imaginary
ghcr.io/nextcloud-releases/aio-redis:latest        nextcloud-aio-redis
ghcr.io/nextcloud-releases/aio-postgresql:latest   nextcloud-aio-database
ghcr.io/nextcloud-releases/aio-whiteboard:latest   nextcloud-aio-whiteboard
ghcr.io/nextcloud-releases/aio-notify-push:latest  nextcloud-aio-notify-push
ghcr.io/nextcloud-releases/aio-eurooffice:latest   nextcloud-aio-eurooffice
ghcr.io/nextcloud-releases/aio-nextcloud:latest    nextcloud-aio-nextcloud
ghcr.io/nextcloud-releases/all-in-one:latest       nextcloud-aio-mastercontainer

There’s no borgbackup container in sight. And after the AIO interface shut down:

$ docker ps --format "table {{.Image}}\t{{.Names}}" | grep -e NAMES -e nextcloud
IMAGE                                           NAMES
ghcr.io/nextcloud-releases/all-in-one:latest    nextcloud-aio-mastercontainer

Oh, but I see it now – when I use --all:

$ docker container ls --all | grep borg
1f5c92697430   ghcr.io/nextcloud-releases/aio-borgbackup:latest                 "/start.sh"  2 minutes ago   Exited (1) 2 minutes ago                                                                                                nextcloud-aio-borgbackup

$ docker logs nextcloud-aio-borgbackup
Your public ssh key for borgbackup is: ssh-ed25519 [...]
The .ncdata or .ocdata file is missing in Nextcloud datadir which means it is invalid!
Is the drive where the datadir is located on still mounted?
touch: /nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/skip.update: Permission denied
chmod: /nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/skip.update: Permission denied

Oh, the plot thickens. The nextcloud-aio-borgbackup container exits quickly, but I can issue a few commands before it does:

$ docker start nextcloud-aio-borgbackup; docker exec nextcloud-aio-borgbackup \
 sh -c "id; df -h; ls -ld /nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/;
        find /nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/"
nextcloud-aio-borgbackup

uid=0(root) gid=0(root) groups=0(root),0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)

Filesystem                Size      Used Available Use% Mounted on
[...]
nfs:/mnt/data/backup/nextcloud 3.6T  3.3T    311.5G  92% /nextcloud_aio_volumes/nextcloud_aio_nextcloud_data

drwxr-x---    8 33       33            4096 Aug 16 16:03 /nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/
/nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/
find: /nextcloud_aio_volumes/nextcloud_aio_nextcloud_data/: Permission denied

So, apparently root inside the nextcloud-aio-borgbackup is not able to access the ncdata share; which belongs to uid=33 (which translates to www-data locally, or http on the NFS server). That still doesn’t solve the issue, but at least explains what’s happening here. Thanks!