What the message looks like
There were problems with the code integrity check. More information…
Results:
- core
- INVALID_HASH
- core/js/mimetypelist.js
- EXTRA_FILE
- core/old-backup.phpCommon causes
- Files were left over or mixed after a manual update, for example an old folder copied over a new one.
- A core or app file was edited by hand, or a backup, patch or
.origfile was put into the program folder. - An upload or unzip was incomplete, so files are missing (
MISSING_FILE) or damaged (INVALID_HASH). - An app that did not come from the App Store, or a custom theme placed in the wrong folder, is reported as extra.
Check
- Check the core files
- Check one app
sudo -u www-data php occ integrity:check-app calendar - Which version is installed?
sudo -u www-data php occ status - Files changed in the last days
find /var/www/nextcloud -maxdepth 2 -type f -mtime -3 -not -path '*/data/*' | head -n 20
Fix
- Read the result:
INVALID_HASHmeans the file was changed,MISSING_FILEmeans it is gone,EXTRA_FILEmeans it does not belong there. - Download the archive of exactly your installed version from the official source, verify its checksum, and copy the reported files back from it.
- Move
EXTRA_FILEentries out of the program folder, for example to a backup folder outside the web root. - Put custom themes and apps in
themes/andcustom_apps/, not into core folders. Useupdater/updater.pharor the web updater for future updates. - Run
occ integrity:check-coreagain, then press the rescan button in the admin overview.
Typical scenario
A manual update was done by simply unpacking the new archive over the old program folder. Afterwards occ integrity:check-core lists several EXTRA_FILE lines: files that no longer exist in the new version but remain from the old state. The admin area shows the warning although everything runs. First check: which error type precedes the file names, INVALID_HASH, FILE_MISSING or EXTRA_FILE?
FAQ
Can I ignore this warning?
It can point to a broken or tampered installation, so do not leave it. If the list holds only a file you changed on purpose, document it. Otherwise restore the original so updates and support stay predictable.
Does the check touch my data directory?
No. It only looks at the program files, the shipped apps and the signed apps. Your data folder is not compared.
What do INVALID_HASH, FILE_MISSING and EXTRA_FILE mean?
INVALID_HASH means a file was modified. FILE_MISSING means an expected file is absent. EXTRA_FILE marks a file that should not exist in this version, often a leftover from an earlier state or third-party code.
How do I fix just a single file?
Download the archive of exactly the same version, copy the affected file from it into place and run the check again. You may delete a surplus file if you are sure it does not belong to Nextcloud. Then repeat occ integrity:check-core.
Why is .htaccess reported?
Nextcloud maintains its own block in that file, and changes to it, for example by an admin, cause a mismatch. occ maintenance:update:htaccess rewrites the part managed by Nextcloud. Custom rules are better kept in the web server configuration.