INVALID_HASH lib/private/DB/AdapterPgSql.php after upgrading to nextcloud 16.0.4.0

I just upgrade from 15.0.8 to 16.0.4.0 and now ive got this warning

  • Some files have not passed the integrity check. Further information on how to resolve this issue can be found in the documentation. ([List of invalid files…]

if i click on the “List of invalid files” i got this

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
      • lib/private/DB/AdapterPgSql.php
    • EXTRA_FILE
      • .rnd

Raw output

Array
(
[core] => Array
(
[INVALID_HASH] => Array
(
[lib/private/DB/AdapterPgSql.php] => Array
(
[expected] => 02765b182b62d4e67a68fd51361a3d141ca1cd064cd0d937ba42997e638ce9ecbb02614722ad8470aa6b75f54018b79f00c9d8c31dc9b10a40d08086b09bca16
[current] => dabc4b92db39df395d0a43cc4a0ba9e4d80a9c6176b7050b45000c359001fad1549866f49d377ec1112a8abccb79fe2159f2a35d556ab445445a916b673cc361
)

            )

        [EXTRA_FILE] => Array
            (
                [.rnd] => Array
                    (
                        [expected] => 
                        [current] => 116789d21b14037178e007581bb0a1033d4c65eb96a9bd07dde8a5070c24770b56ae0a567055e7ca73ece7d8dbd12377875c8c41b5d5bd39f64663803159f23c
                    )

            )

    )

)

What i need to do exactly

I don’t see any file lib/private/DB/AdapterPgSql.php

root@cloud:/# cd lib
root@cloud:/lib# ls
bridge-utils discover init libhandle.so.1.0.3 lsb security terminfo
console-setup firmware klibc-k3La8MUnuzHQ0_kG8hokcGAC0PA.so libxtables.so.10 modprobe.d systemd udev
cpp ifupdown libhandle.so.1 libxtables.so.10.0.0 modules sysvinit x86_64-linux-gnu

Same error in my system.
I hope this is the file you can find
univention-app shell nextcloud
cd /var/www/html/lib/private/DB

That’s all of my knowledge

root@cloud:~# cd /var/www/html/lib/private/DB
-bash: cd: /var/www/html/lib/private/DB: No such file or directory

i don’t have this folder thanks for your help !

First go into the docker with
root@meinserver:~# univention-app shell nextcloud
Than
root@nextc-05820453:/# cd /var/www/html/lib/private/DB

ok ive found it but what exactly i need to do to solve the problem

I have the same problem. I cannot estimate how bad the error is. Any ideas for a solution?


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
		- lib/private/DB/AdapterPgSql.php

Raw output
==========
Array
(
    [core] => Array
        (
            [INVALID_HASH] => Array
                (
                    [lib/private/DB/AdapterPgSql.php] => Array
                        (
                            [expected] => 02765b182b62d4e67a68fd51361a3d141ca1cd064cd0d937ba42997e638ce9ecbb02614722ad8470aa6b75f54018b79f00c9d8c31dc9b10a40d08086b09bca16
                            [current] => dabc4b92db39df395d0a43cc4a0ba9e4d80a9c6176b7050b45000c359001fad1549866f49d377ec1112a8abccb79fe2159f2a35d556ab445445a916b673cc361
                        )

                )

        )

)

I am affected too. In fact, everyone is affected.

Steps to reproduce this from cli:

  • login into the docker container
  • run occ integrity:check-core and check the output
root@ucstest27:~# docker exec -it nifty_bhaskara bash
root@nextc-53571082:/# su www-data -s /bin/bash -c "/var/www/html/occ integrity:check-core"
  - INVALID_HASH:
    - lib/private/DB/AdapterPgSql.php:
      - expected: 02765b182b62d4e67a68fd51361a3d141ca1cd064cd0d937ba42997e638ce9ecbb02614722ad8470aa6b75f54018b79f00c9d8c31dc9b10a40d08086b09bca16
      - current: dabc4b92db39df395d0a43cc4a0ba9e4d80a9c6176b7050b45000c359001fad1549866f49d377ec1112a8abccb79fe2159f2a35d556ab445445a916b673cc361
...

Seems the file has a different hash than specified within signature.json. This usually happens when the file has been modified after writing the signature data.
Documentation: https://docs.nextcloud.com/server/16/admin_manual/configuration_server/occ_command.html#integrity-check-label

First I briefly checked this issue against the plain docker image from Univention: (docker pull docker.software-univention.de/nextcloud:16.0.4-0; docker run ... ; docker exec -it ...) and found exact the same issue. So my hypothesis is that this issue is not a local problem, because exact the same invalid hash is also found within the docker image provided by Univention.

Therefore I briefly checked against the official docker image docker.io/library/nextcloud:16.0.4 (eg. docker pull nextcloud:16.0.4; docker exec..) too. By using this image, the hash was fine, no errors or warnings reported.

As last step, I checked the md5sum of the file AdapterPgSql.php within both containers, and the md5sum is indeed different:

So I think that Univention ships a different version of this file, compared with the original version here: https://github.com/nextcloud/server/blob/v16.0.4/lib/private/DB/AdapterPgSql.php

So I asked myself why this could happen. Taken from the Blog: https://www.univention.de/blog-de/2019/09/nextcloud-16-im-univention-app-center-verfuegbar/

It took a while to make Nextcloud 16 compatible with the PostgreSQL (9.4) version in UCS, but now…

So I assume that precisely the adjustments needed to make Nextcloud compatible with PostgreSQL (9.4) used within UCS will cause the warnings we all see. It would be great if someone from Univention could confirm my assumption. (Then we could close this thread)

1 Like

The invalid hash results from a patch (https://github.com/nextcloud/univention-app/blob/master/resources/16572.patch) that is needed for psql <= 9.4. It will not be needed as of 16.0.6 anymore (https://github.com/nextcloud/server/pull/16814).

1 Like