Is this the first time you’ve seen this error? (Yes / No):
Yes
When did this problem seem to first start?
Attempted to update within the "local" Dashboard using "nc-update-nextcloud" under UPDATES.
Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
RaspberryPi 4b
Are you using CloudfIare, mod_security, or similar? (Yes / No)
replace me
Summary of the issue you are facing:
[…] I logged into the local Admin Dashboard backend on my NextCloudPi install and there was a message to update from v1.55.3 to v1.55.4; so I did without an issue. I then went down to UPDATES > “nc-update-nextcloud” and attempted to update the Web “Hub” interface (currently on v30.0.1). The message box said everything was being backup up, then it attempted to update (I think to v30.0.17?) but this failed and the message box said it rolled back to the backups. Now the “Files” second of the web Hub has been completely wiped out and so have all our “Notes”. The calendars and cellphones contacts are still intact. What happened to the backup it created and how can I access the Files and Notes it has since erased?
Steps to replicate it (hint: details matter!):
Log into Local Admin Dashboard
UPDATES > “nc-update-nextcloud”: Version “0”; APPLY
Update ran a backup; attempted to update; failed; rolled back; rebooted server.
You mean the browser page is not showing the symbols?
May be reloading browser page or log in/log out admin account may help.
Further examination couild be done logging in your server via ssh.
To clarify, after the failed update, all locally stored personal user files & folders (which could be browsed under the FILES icon in the web interface) are gone as well as all “note” files under NOTES. At the same time, this wiped out the same note files accessible via the Android “Nextcloud Notes” app! Apparently, these notes are not stored locally on the smartphone and are gone.
I am just a dumb Windows user who followed a tutorial to spin up NextCloudPi on a Raspberry Pi 4b. I’m at a complete loss as to understand what caused the failed update and why that would lead to all my data being erased.
Ok, I pulled this from the logs. This looks like the messages I got during the update:
[ nc-previews-auto ]
[ nc-update ] (Sun Nov 2 17:55:06 UTC 2025)
Downloading updates
Performing updates
Update DB row format …
Done.
NextcloudPi updated to version v1.55.4
[ nc-update-nextcloud ] (Sun Nov 2 18:29:52 UTC 2025)
Running as unit: ncp-update-nc.service
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
100 38239 0 38239 0 0 87767 0 --:–:-- --:–:-- --:–:-- 87704
100 618k 0 618k 0 0 1113k 0 --:–:-- --:–:-- --:–:-- 1112k
Current Nextcloud version 30.0.1
Requested Nextcloud version latest
Selected Nextcloud version 30.0.17
INFO: You have requested an update to the latest available version that can be performed directly, which is ‘30.0.17’. Updates can only performed to the next major version (or the latest minor version of the current major version). If you run ncp-update-nc again after this update completes, a new version might be available.
Download Nextcloud 30.0.17…
Back up current instance…
check free space…
Maintenance mode enabled
backup database…
backup files…
backup /var/www/nextcloud-bkp_20251102_1762108252.tar.gz generated
Maintenance mode disabled
Storing backup at ‘/var/www/nextcloud-bkp_20251102_1762108252-30.0.1.tar.gz’…
Install Nextcloud 30.0.17…
Fix permissions…
Upgrade…
{“reqId”:“Say3u1W3IP36RibEGEKr”,“level”:2,“time”:“2025-11-02T18:33:49+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“no app in context”,“method”:“”,“url”:“–”,“message”:“Temporary directory /var/www/nextcloud/data/data/tmp is not present or writable”,“userAgent”:“–”,“version”:“30.0.1.2”,“data”:}
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Cannot create “data” directory.
This can usually be fixed by giving the web server write access to the root directory. See Introduction — Nextcloud latest Administration Manual latest documentation
An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/nextcloud/lib/private/Console/Application.php:137
Stack trace: #0 /var/www/nextcloud/console.php(81): OC\Console\Application->loadCommands() #1 /var/www/nextcloud/occ(33): require_once(‘…’) #2 {main}Abort
Clean up…
Rolling back to backup /var/www/nextcloud-bkp_20251102_1762108252-30.0.1.tar.gz…
check free space…
extracting backup file /var/www/nextcloud-bkp_20251102_1762108252-30.0.1.tar.gz…
restore files…
restore database…
No datadir found in backup
Maintenance mode disabled
Starting scan for user 1 out of 3 (eclipse)
Starting scan for user 2 out of 3 (katze)
Starting scan for user 3 out of 3 (ncp)
±--------±------±----±--------±--------±-------±-------------+
| Folders | Files | New | Updated | Removed | Errors | Elapsed time |
±--------±------±----±--------±--------±-------±-------------+
| 1686 | 12492 | 0 | 1 | 94 | 0 | 00:00:19 |
±--------±------±----±--------±--------±-------±-------------+
Installing template ‘php/opcache.ini.sh’…
System config value tempdirectory set to string /var/www/nextcloud/data/data/tmp
System config value logfile set to string /var/www/nextcloud/data/data/nextcloud.log
System config value trusted_domains => 11 set to string XX.XX.XXX.XXX [data removed]
System config value trusted_domains => 1 set to string XX.XX.XX.X [data removed]
System config value trusted_domains => 14 set to string nextcloudpi
System config value trusted_domains => 3 set to string XXX.XXX [data removed]
System config value overwrite.cli.url set to string https://XXX.XXX [data removed]
System config value trusted_proxies => 11 set to string 127.0.0.1
System config value trusted_proxies => 12 set to string ::1
System config value trusted_proxies => 14 set to string XX.XX.XXX.XXX [data removed]
Setup notify_push (attempt 1/5)
✓ redis is configured
✓ push server is receiving redis messages
✓ push server can load mount info from database
✓ push server can connect to the Nextcloud server
✓ push server is a trusted proxy
✓ push server is running the same version as the app
configuration saved
Scanning AppData for files
Data should be there; we need to know more about your setup.
Booting from sd-card?
External storage?
Do you have ssh acces to your server?
… and so on.
The system boots from the MicroSD card on the Raspberry Pi with no additional external storage attached. I did setup a network link to an NTFS Windows 10 server that hosts the bulk of our data on home network. This appears as another root folder when browsing in the FILES section. As I understand it however, NextCloud doesn’t really index this location so the files/folders that are presented when I navigate this resource are usually very stale/incorrect. I do seem to have read/write access to/from the network drive though for whatever that’s worth.
I just checked and I do have SSH access to NextCloudPi when I’m connected to the local network.
I am not sure about your setup, to get outer storage (google drive, magentacloud e.a.) work, you have to install / activate an app in nextcloud.
Your first concern is your data, so I propose you handle your sd-card as disk-hazard. Go on and build a copy/clone chain so you don’t have to work on original card but can copy from first copy and start examination of the card from start again if necessary.
You may ssh into your server, ncp-config provides the same command set as admin webgui:4443. You may search for the backup file made during update /var/www/nextcloud-bkp_20251102_1762108252.tar.gz but it is probably gone.
Examination of your sd-card is best done on linux of course, your rpi4 is quickly set up with raspios desktop put screen, keyboard and mouse and card reader in place.
Ok, I’m home for a couple days (I travel for a living) and can work on this more. I shut down my instance of NextCloud and removed the MicroSD card from the RaspberryPi. A while ago I put together a Kubuntu Live ISO on a USB drive and set it up with persistence. I just booted it up and plugged in the MicroSD card and Kubuntu’s File Manager sees and can navigate the two partitions on the card, “RPICFG” and “armbi_root”. The majority of the data is in “armbi_root” and I did a quick search for the backup.tar.gz but it’s gone and so are all the Notes files (I searched for a couple file names I found listed in the extended log I pulled a couple days ago).
In regards to making a “working copy”, I have several blank MicroSD cards and thumb drives sitting around. I don’t know how to clone this SD card in Linux but I do have access to a bootable Clonezilla and bootable Acronis Backup ISO that I use regularly to backup my Windows installs. Is there an easier way to clone the SD card in Kubuntu?
Just to be clear, did you ever use nc-datadir to change the directory of your data? Sorry if this is a silly question, but did you check that your config.php is pointed to the correct path for your data?
#Access root
sudo su
#Enter sudo password
#Open Nextcloud configuration file in nano editor
nano /var/www/nextcloud/config/config.php
@geoW I was able to use my Acronis bootable ISO to create a duplicate image on another identical MicroSD card I kept as a backup (Raspberry Pis like to eat SD cards). I have installed the clone SD card back into the unit and NextCloud is back up and running (but data is still missing). I have the original card plugged into a laptop running Kubuntu now. I’m wondering if the best bet is to run some kind of data recovery software next? I have an entire stable of recovery programs for NTFS and FAT32 but nothing for Linux file systems.
@hjhslick0492 That’s a good question! I ran the commands you posted and the “datadirectory” lines shows “/var/www/nextcloud/data/data”
To get things right, in case of disc hazard we copy the original drive and never zouch again, the first copy is the “mother” of all following copies we need to have during our investigations, no other work is done with it. So we start investigation with 2. gen copy.
In linux you would have seen error/repair messages durin boot time if filesystems would have been damaged., you may examine your sd-copy on your kubuntu system (kdepartitionmanager), with file-manager (dolphin) you may exanine the file tree of the server.