The desktop app has decided to delete and download everything again. I hope this is the last time.
There’s definitely something still wrong with it. The desktop app is just syncing everything over and over again. It keeps saying it’s failing, but the files end up being there. I’ve tried all the various repairs and rescans, but it doesn’t make any difference.
This sounds like client-side sync state went stale after the files:scan reshuffled fileids in oc_filecache. The server thinks the files are fine, the desktop client’s journal disagrees, so it loops.
Two things would help narrow it down:
-
On the server, while the desktop is mid-loop, grab a snippet of the log:
snap run nextcloud.occ log:tail 200 journalctl -u snap.nextcloud.* --since "10 min ago" | tail -200And from the support page send the full log archive. I’m looking for the actual HTTP code on the failing requests (412 / 423 / 507 all mean different things).
-
On the desktop, what OS and client version, and what does the activity log say next to the red “failed” entries?
If you just want it to stop and you don’t mind a one-off full re-compare, the cheapest reset is on the desktop only — pause sync, remove the sync connection in the client (Settings → account → remove folder sync, not “remove account”, and don’t touch the local files), then re-add it pointing at the same local folder. The client rebuilds its journal from scratch against the current server state and the loop dies.
Too late
I also reached the conclusion it must be the client app. About an hour ago I uninstalled the desktop app, deleted the Nextcloud folders under AppData, got rid of the old Nextcloud file folder, reinstalled the desktop app, and set it to sync. Seems to be working so far, but I probably won’t know for sure until tomorrow morning. Your way looks like it would have been a lot quicker.
I’m sorry to say I am still getting lots of errors. I’ve had a look at the logs (sent them to you) and I can see a lot messages about database corruptions. Is there any way of rebuilding it?
I won’t be able to do anything today, but I should be able to look at it again tomorrow evening.
I have backups from every Sunday morning.
Your file data is safe — it’s on the 1TB SanDisk SSD (/dev/sda, btrfs, 132G used) mounted at /opt/disk/external, which the error report confirms is healthy. Only the Postgres database on the SD card is damaged, and trying to repair that database while still running off the dying card is why nothing sticks.
Cleanest path:
- Get a new SD card and flash the latest Syncloud image — don’t
ddclone the old one, you’ll copy the corruption. - Boot the new card, reactivate the device through the normal first-time setup (app/web activation, login).
- Reattach the external disk in Settings → Storage. The platform re-creates
/data → /opt/disk/external; yournextcloudfolder under it is found as-is. - Rebuild the filecache from the files on disk:
This walks every user’s data folder and re-populates Nextcloud’s database from scratch. It can take a while for 132G but it’s the same command our integration tests use.snap run nextcloud.occ files:scan --all - Reconnect the desktop client — pause sync, remove the folder-sync connection (Settings → account → remove folder sync — NOT remove account, and don’t touch local files), then re-add it pointing at the same local folder. Client rebuilds its journal against the clean server.
No need to use your Sunday backup — the files on the external disk are the source of truth, the DB is regenerable from them.
I’ve been thinking about this. I think I will try restoring from a backup because there is more than just my files on the server. There are a number of users, and I have contacts and calendars in there as well (which I have already exported). If it doesn’t work, I’ll try doing it from scratch. I’ve also got services other than Nextcloud on there (Gogs (with multiple users), Paperless, Syncthing).
Seems to be working fine now. Thanks for all your help with it.