Failed integrity check after manual upgrade

Hi folks,

I see the following error after upgrading:

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
      • .htaccess

Raw output

Array
(
[core] => Array
(
[INVALID_HASH] => Array
(
[.htaccess] => Array
(
[expected] => 4a97aae4d05df89a28bf2e63fe2a31cdf2afe74d3c9f622afb581d6b0f1f4e001639c7c3a31d7aaa793c00d5f355e0bfaad62ec45507245de441cfc552115cd7
[current] => cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e
)

[…]

I followed the process here: https://docs.nextcloud.org/server/9/admin_manual/maintenance/manual_upgrade.html

But then forgot to include the htaccess file before I took it out of maintenance mode. Since then I’ve deleted it, rsync’d the old one across from the backup folder, to no avail.

How do I tell NC this is the htaccess file the core needs to use?

1 Like

Have you tried putting NC into maintenance mode, rsyncing the .htaccess and then taking it out of maintenance mode? I’m not sure if this will help, but could be worth a try…

I just tried it, but unfortunately that didn’t help!

Hmmm… sorry, but this sounds like it requires help from someone in the community with more Nextcloud-fu than I…:cry:

1 Like

I’m hoping there’s a simple occ command override … but we shall see!

Hi,

Here is a trick (do it only if you are sure of your “.htaccess” file integrity)

Put that in your “config.php” :

‘integrity.check.disabled’ => true,

Now reload the page and when you see the yellow banner click on rescan
Log-out and next time you log-in as admin you will not see the banner.
You can now delete the line you put in your config.php to re-enable the integrity check, and you will not see anymore the banner.

9 Likes

Excellent, I’ll try this!
Presumably the integrity check will work as normal, including flagging the htaccess file up if it changes again?

Yes, it should :slight_smile:

Please don’t disable the integrity check for purposes of working around a potential bug. Before going such a way it is more interesting to understand WHY this is happening.

@JasonBayton Are you sure that you uploaded the correct .htaccess file? Also can you share the file with us before and after the update?

1 Like

Hi @LukasReschke, for the update I renamed my NC folder, created a new folder to pop the updated core components in and copied my data and config files back in.

I did not however copy across the htaccess and as such it tried using the one supplied on a new install before I deleted it and copied it over from the backup file (I’ve made changes in there for removing index.php from URL paths IIRC so it was required).

Therefore there’s only one .htaccess file, and it appears removing the one I started NC with after the upgrade and copying over the previous version is what caused the hash mismatch.

Aïe, aïe, aïe, the “Security Lead” has struck… :blush:

I must admit that you are perfectly right. (was just a trick i shouldn’t have posted here)

Thanks, @JasonBayton. Will look into this.

@Akhenaton No worries :wink:

@LukasReschke for this particular instance I followed @Akhenaton’s suggestion as I’m confident it was me who caused the error. So I’ll mark this as resolved :thumbsup:

1 Like

I just upgraded to 952, this time making sure I copied everything over from the backup DIR before the upgrade and… the same issue -

[INVALID_HASH] => Array
                (
                    [.htaccess] => Array
                        (
                            [expected] => 4a97aae4d05df89a28bf2e63fe2a31cdf2afe74d3c9f622afb581d6b0f1f4e001639c7c3a31d7aaa793c00d5f355e0bfaad62ec45507245de441cfc552115cd7
                            [current] => 8ef19f131a6cc6eb6f37c82f2b7ec8921d3eea974c386fce39d96a1c70a1eb3f0d9d42cc4fb76fa5e395c71ab4ce7b4dc4d77218bb54b45f3987e942f1f14068
                        )

                )

Maybe it is a bug?

I’m also getting this after doing a manual upgrade to 952 - the .htaccess was taken straight from the archive. I even tried removing it and regenerating a .htaccess file using the occ command line script.

I would just like to add a +1 for this scenario. My expected hash on .htaccess is the same as the OP, but my current hash is a different number.

I’m a total n00b, but I’m an apps guy, and it makes me suspicious that the .htaccess file has gone trhough some iterations with the upgrades.

I did a manual upgrade from ownCloud 9.0.(current/failed to check) to nextCloud 9.0.52.

Ain’t no way I’m disabling the integrity check…this is a basic fix somewhere, for guys waaay smarter than me… :slight_smile:

My raw output:

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
      • .htaccess

Raw output

Array
(
[core] => Array
(
[INVALID_HASH] => Array
(
[.htaccess] => Array
(
[expected] => 4a97aae4d05df89a28bf2e63fe2a31cdf2afe74d3c9f622afb581d6b0f1f4e001639c7c3a31d7aaa793c00d5f355e0bfaad62ec45507245de441cfc552115cd7
[current] => 451fd1fa17239d8d1fa31c5b22dce5ef6710b93ff90a4705416e452d3f4cf22f387b49e98bd01a69ce2a2da8a2613298c37cd306955ed16808755afbbc32d38f
)

            )

    )

)

Just upgrade again following this: https://docs.nextcloud.com/server/9/admin_manual/maintenance/manual_upgrade.html

Good afternoon, I have replace the .user.ini files and .htaccess files with the ones from the server zip file, the .user.ini error has gone away, but the .htaccess error is still there and I have replaced the file multiple times, anyone else find a fix to this?

Hello,

I have the same issue an with this I can not upgrade to 10.02.

My manual update I did following:

1.renaming old Folder
2. ftp uploading the unzipped 10.01 files, same foldername as before
3. back copy of config file
4. extending the rewrite rule to run SSL of hosteurope.

My www folder have 700 and its subfolder nextcloud 750
The rescan shows a lot files with wrong hashes ?!

I not know to fix this, any help or tip ? I am no expert, only an expirenced user.

Hi,

No, it doesn’t !!!

After applying your trick, integrity check never worked again, for any file.
How can I re-enable integrity check ?