Mimetypelist.js problems - Upgrading problem

Technical information
=====================
The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
them.

Results
=======
- core
	- INVALID_HASH
		- core/js/mimetypelist.js

Raw output
==========
Array
(
    [core] => Array
        (
            [INVALID_HASH] => Array
                (
                    [core/js/mimetypelist.js] => Array
                        (
                            [expected] => 23a3fa45757b26795f5cf8f94d9e5bce76fc916288a6458679311b312c167adcf4158ccb2c5c3db791fa0b87703b6c5863afb6c9d790b8cbac5ab3ae8c3418fb
                            [current] => 86c1f1b719b65bf02b1dca9b061ef310c8dfface25c9ccfa243c4090665fa6f305d8a4143d7410350af27b1d9e14968c7d999a965d1e110bc674d30ed5dee4e8
                        )

                )

        )

)

I am trying to update from Nextcloud 22.2.3 to Nextcloud 22.2.5 but got this error on Overview tab, and when executing the Updater from GUI, cannot make backup … probably because of this error.

1 Like

I got the same error after the update. Downloading the package from the website and copy the file to the location did not help.

1 Like

Do you have onlyoffice installed. → BUG ( Integrity check fails for core/js/mimetypelist.js after upgrade to NC 23 · Issue #30732 · nextcloud/server · GitHub )

I did not encountered this error.

have you tried
occ maintenance:mimetype:update-js

Meanwhile I updated to e newer release and the error vanished. Thx anyway.

$ sudo -u www-data php occ maintenance:mimetype:update-js
mimetypelist.js is updated
$ sudo -u www-data php occ integrity:check-core
  - INVALID_HASH:
    - core/js/mimetypelist.js:
      - expected: 23a3fa45757b26795f5cf8f94d9e5bce76fc916288a6458679311b312c167adcf4158ccb2c5c3db791fa0b87703b6c5863afb6c9d790b8cbac5ab3ae8c3418fb
      - current: 86c1f1b719b65bf02b1dca9b061ef310c8dfface25c9ccfa243c4090665fa6f305d8a4143d7410350af27b1d9e14968c7d999a965d1e110bc674d30ed5dee4e8

occ seems that it cannot rewrite the file.
Maybe this is a bug or something …
Disabling ONLYOFFICE did not help at all…
It is advisable to manually replace the file from github source?

@DaniS updating with Updatr from nextcloud interface gets stuck at Creating Backup


Later on …
Solved the issue by downloading the .zip package closest to my release… eg. 22.2.3 i downloaded the 22.2.6 version of mimetypelist.js and replaced that original file fom my server. Everything worked!
As for the part where Creating Backup showed in Updating from web interface… a simple sudo chown -R www-data:www-data <nextcloud dir> solved the issue

1 Like

remove the file and download the latest version then it works,
here are the commands just adjust your installation directory if you have it somewhere else

sudo rm /var/www/nextcloud/core/js/mimetypelist.js
sudo wget https://raw.githubusercontent.com/nextcloud/server/master/core/js/mimetypelist.js -P /var/www/nextcloud/core/js

You should always take the files from the tag of your version:

  1. open a terminal
  2. enter this code (check NC_DIR and HT_USER carefully beforehand):
HT_USER=www-data # change this if your ht user is different
NC_DIR=/var/www/nextcloud
nc_download_default() { local app_id=$1 file=$2 version_tag path=$2
    case "$app_id" in
        server) version_tag="v$(awk -F\' '/String/{gsub(/ /,"");$2=tolower($2);print $2}' "$NC_DIR/version.php")"   ;;
        *)      xml_f="$NC_DIR/apps/$app_id/appinfo/info.xml"
                version_tag="v$(xmlstarlet sel -B -t -v "//info/version" "$xml_f"|sed '2,$d')"
                path="apps/$app_id/$file"
    esac
    sudo -u $HT_USER curl -so $NC_DIR/$path https://raw.githubusercontent.com/nextcloud/$app_id/$version_tag/$file
}

nc_download_default server "core/js/mimetypelist.js"
sudo -u $HT_USER php $NC_DIR/occ integrity:check-core

This way you will have the correct file for your version on the right place.

You can integrate this function in your environment (e.g. add it to your ~/.bash_aliases) You can use it for missing files from within shipped apps as well, but then xmlstarlet must be installed.


Much and good luck,
ernolf