[Solved] Invalid hash for mimetypelist.js

Iā€™ve done a new install of Nextcloud 14.0.3, via the Web Installer, on a new Linode server, and it took a pleasantly surprising 2 hours. However, since then Iā€™ve been battling for about 12 hours (!) with 8 or so security warnings. Iā€™ve got them all to disappear except one: ā€œSome files have not passed the integrity check.ā€ There is an invalid hash on core/js/mimetypelist.js.

Iā€™ve looked at some of the other mimetype stuff on the forums, and this is what Iā€™ve tried:
(1) Download the Nextcloud zipfile and extract it.
(2) Copy core/js/mimetypelist.js and core/js/mimetype.js over the existing ones on the server.
(3) Run the following occ commands:
sudo -u www-data php occ maintenance:mode --on
sudo -u www-data php occ maintenance:mimetype:update-db --repair-filecache
sudo -u www-data php occ maintenance:mimetype:update-js
sudo -u www-data php occ maintenance:mode --off

Unfortunately, this hasnā€™t solved the problem, and Iā€™m not really sure what to do. I intalled a few extra apps after the initial install, but only the Official ones, and Iā€™d have thought they shouldnā€™t give rise to this problem. Any suggestions?

Hmm. I suppose Iā€™d better answer my own question ā€¦

Following the suggestion here: Failed integrity check after manual upgrade
run:
nano config/config.php
Add at the end:
'integrity.check.disabled' => true,
Reload the page and click Rescan in the error message.
Log out.
Log in again.
The error has disappeared.
Then:
nano config/config.php
again, and remove 'integrity.check.disabled' => true,

I should note that this is frowned on by Lukas Reschke, the Security Lead, but it seems to me to defeat the purpose of integrity checks if you have one that is stuck and canā€™t be cleared. Iā€™m not sure what happens, but perhaps one of the apps edits mimetypelist.js to add new entries, but doesnā€™t clean up after itself by regenerating the hash?

Anyway, all good now, and very impressed by Nextcloud.

4 Likes

similar issue on NC 16.0.7 ā€¦ tryied your 2-nd approach without success.
thx for sharing.

Same problem here. Does anyone have a solution? I follow your steps and nothingā€¦the error still there.

A year later and issues of INVALID_HASH without being able to clear the error after a manual install is nothing short of maddening.

After following what worked for the person who came up with a solution in 2018, no luck at all.

Attempts to rescan always result in:

Access denied
CSRF check failed

Unable to clear or reset this.

Surely someone on the planet knows how to fix:

INVALID_HASH

or

Access denied
CSRF check failed

I live in hope.

Just incase anyone runs across this. I have found that upgrading in from 21 to 22 that I had this error. It was caused by the Mind map app changing the mimetypelist file and therefore it failed the integrity check.

Easiest solution was to replace that file with the original from the github repo.

2 Likes

This worked for me with NC27->28. Thanks!

1 Like