Hi,
I am in the process to move my Nextcloud AIO to a new server.
For that I copied my latest backup to a datastore. Mounted this datastore with NFS to the new machine under /mnt/backup/borg.
Started the AIO with the same docker-compose.yml that I use on the old server.
Then I successfully restored the backup without any problems.
I also did an integrity check of the backups. Everything is OK.
Also the start of the AIO has no problems. But when try to login I get in the database the following error
2025-02-23T12:48:24.667689369Z Setting postgres values...
2025-02-23T12:48:24.680901507Z chmod: /var/run/postgresql: Operation not permitted
2025-02-23T12:48:24.682912765Z
2025-02-23T12:48:24.682926040Z PostgreSQL Database directory appears to contain a database; Skipping initialization
2025-02-23T12:48:24.682930028Z
2025-02-23T12:48:24.856545143Z 2025-02-23 13:48:24.856 CET [14] LOG: starting PostgreSQL 16.6 on x86_64-pc-linux-musl, compiled by gcc (Alpine 14.2.0) 14.2.0, 64-bit
2025-02-23T12:48:24.856612922Z 2025-02-23 13:48:24.856 CET [14] LOG: listening on IPv4 address "0.0.0.0", port 5432
2025-02-23T12:48:24.856631748Z 2025-02-23 13:48:24.856 CET [14] LOG: listening on IPv6 address "::", port 5432
2025-02-23T12:48:24.860208966Z 2025-02-23 13:48:24.860 CET [14] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2025-02-23T12:48:24.868026978Z 2025-02-23 13:48:24.867 CET [24] LOG: database system was shut down at 2025-02-22 15:10:29 CET
2025-02-23T12:48:24.875678020Z 2025-02-23 13:48:24.875 CET [14] LOG: database system is ready to accept connections
2025-02-23T12:49:09.497012214Z 2025-02-23 13:49:09.496 CET [83] ERROR: missing chunk number 0 for toast value 111010 in pg_toast_17285
2025-02-23T12:49:09.497046860Z 2025-02-23 13:49:09.496 CET [83] STATEMENT: SELECT * FROM "oc_passwords_password_rv" WHERE "deleted" = $1
2025-02-23T12:49:10.578825961Z 2025-02-23 13:49:10.578 CET [83] ERROR: missing chunk number 0 for toast value 111010 in pg_toast_17285
2025-02-23T12:49:10.578851348Z 2025-02-23 13:49:10.578 CET [83] STATEMENT: SELECT * FROM "oc_passwords_password_rv" WHERE "deleted" = $1
2025-02-23T12:49:10.936296971Z 2025-02-23 13:49:10.936 CET [83] ERROR: missing chunk number 0 for toast value 111010 in pg_toast_17285
2025-02-23T12:49:10.936319615Z 2025-02-23 13:49:10.936 CET [83] STATEMENT: SELECT "a".* FROM "oc_passwords_password_rv" "a" INNER JOIN "oc_passwords_password" "b" ON a."model" = b."uuid" WHERE ("a"."deleted" = $1) AND ("b"."user_id" = "a"."user_id") AND ("b"."uuid" = $2)
I tried to repair the database with
docker exec --user www-data -it nextcloud-aio-nextcloud php occ maintenance:repair
But this does not work. I see the following:
...
- Repair Passwords Database Objects
- Checking 0 tag revisions
0 [--------->------------------]
- Fixed 0 tag revisions
- Checking 27695 folder revisions
27695/27695 [============================] 100%
- Fixed 0 folder revisions
- ERROR: An exception occurred while executing a query: SQLSTATE[XX001]: Data corrupted: 7 ERROR: missing chunk number 0 for toast value 111010 in pg_toast_17285
- init metadata
- Switches from default updater server to the customer one if a valid subscription is available
- Repair step already executed
- Force-reset all Text document sessions
- Initialize migration of background images from dashboard to theming app
- Add background job to check for backup codes
- Populating added database structures for workflows
exit status 1
And I see then in the database log this error message
2025-02-23T12:49:23.700801414Z 2025-02-23 13:49:23.700 CET [94] ERROR: missing chunk number 0 for toast value 111393 in pg_toast_16514
2025-02-23T12:49:23.700828145Z 2025-02-23 13:49:23.700 CET [94] STATEMENT: SELECT * FROM "oc_authtoken" WHERE ("uid" = $1) AND ("version" = $2) LIMIT 1000
I tried to find a solution for the problem, but I have no knowledge with postgresql. So I am unable to determine which answer could help with my problem.
I think it is a damaged index.
I looked if it is possible with occ
to delete all indexs and renew them, but such command seems not to be existing.
Is their a way to rebuild all index, or an other way to repair the database?
Could I have done something wrong during restore?
Thank you for your help.
Greetings