nextcloud / nextcloud/server

Clear (invalid) checksum when upgrading from OC

Open
#24,810 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop enhancement feature: filesystem feature: install and update feature: owncloud migration
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

When upgrading from OC 10.5.0 to NC 21.0.0beta2 we should clear the checksums in the database.
As far as I saw any upload from the NC desktop client would also clear the checksum, so we should do it right away or have an occ command to do so.

Why ? Because if there are broken checksums the desktop client will not sync the files.

In my own setup I had some broken checksums on OC before doing the upgrade. How I managed to have broken checksums, not sure... I interrupted a request that was restoring files from trashbin.

Steps (guessed from my setup)
  1. Setup OC 10.5.0
  2. Upload a bunch of TXT files using the NC desktop client (which means you'll still have a local copy)
  3. Edit oc_filecache and manually corrupt the checksum of a file "test-corrupt.txt"
  4. Upgrade to NC 21.0.0beta2
  5. Run the NC desktop client
  6. Edit "test-corrupt.txt" locally
  7. Check the server version in the web UI
Expected result

"test-corrupt.txt" can be uploaded, the file is changed on server.

Actual result

"test-corrupt.txt" is not uploaded, the NC desktop client says there's a checksum mismatch.

Versions

OC 10.0.5 -> NC 20.0.0beta2
NC desktop client 3.1.0 (openSUSE package)

Notes

Best solution so far is to manually delete those broken checksums to resume syncing.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names the oc_filecache table and an upgrade from OC 10.5.0 to NC 21.0.0beta2; start by tracing where checksum values are migrated or validated during upgrade. Compare the proposed database cleanup with an occ command, then verify that a previously corrupted test-corrupt.txt can be edited and uploaded without a checksum mismatch.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.