Upgrade to Nexctcloud v210624280 is not working

Hi, I cannot upgrade Nextcloud to version v210624280 .
System:2110141091
Installer:210929152
Hardware: HC4

Here follows what happens. Ideas or suggestions are welcome, thanks.

Steps to reproduce the error

  • through web interface: nothing happens but I can create backups of the app ;

  • through Putty (console):

root@syncloud:~# sudo snap refresh nextcloud
error: cannot perform the following tasks:
- Run pre-refresh hook of "nextcloud" snap if present (run hook "pre-refresh":
-----
2021-10-17 20:28:37,518 - database - INFO - executing: snap run nextcloud.pgdumpall -f /var/snap/nextcloud/current/database.dump
pg_dump: Dumping the contents of table "oc_cards" failed: PQgetResult() failed.
pg_dump: Error message from server: ERROR:  unexpected chunk size 31 (expected 1996) in chunk 36 of 137 for toast value 18072 in pg_toast_17326
pg_dump: The command was: COPY public.oc_cards (id, addressbookid, carddata, uri, lastmodified, etag, size, uid) TO stdout;
pg_dumpall.bin: pg_dump failed on database "nextcloud", exiting
Traceback (most recent call last):
  File "/snap/nextcloud/210108194/meta/hooks/pre-refresh", line 7, in <module>
    Installer().pre_refresh()
  File "/snap/nextcloud/210108194/hooks/installer.py", line 90, in pre_refresh
    self.db.backup()
  File "/snap/nextcloud/210108194/hooks/postgres.py", line 59, in backup
    self.log.info(check_output(cmd, shell=True))
  File "/snap/nextcloud/current/python/lib/python2.7/subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command 'snap run nextcloud.pgdumpall -f /var/snap/nextcloud/current/database.dump' returned non-zero exit status 1
-----)
root@syncloud:~#

What is your current version of Nextcloud?
If you skip one major version update you need to upgrade one by one using this instruction:

What is your current version of Nextcloud?

20.0.4

If you skip one major version update you need to upgrade one by one using this instruction

According to the guide I have to run commands from 21 to the end. The first command fails: it cannot resolve the address:

root@syncloud:~# wget apps.syncloud.org/apps/nextcloud_ 210624280_$(dpkg --print-architecture).snap
--2021-10-19 14:42:15--  http://apps.syncloud.org/apps/nextcloud_
Resolving apps.syncloud.org (apps.syncloud.org)... 52.218.137.226
Connecting to apps.syncloud.org (apps.syncloud.org)|52.218.137.226|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2021-10-19 14:42:15 ERROR 404: Not Found.

--2021-10-19 14:42:15--  http://210624280_armhf.snap/
Resolving 210624280_armhf.snap (210624280_armhf.snap)... failed: Name or service not known.
wget: unable to resolve host address '210624280_armhf.snap'

Thanks in advance

Simone

Sorry wiki page had an extra space in the command (just fixed it), could try again?

Thanks a lot, I made another step. Now I have got:


root@syncloud:~# wget apps.syncloud.org/apps/nextcloud_210624280_$(dpkg --print-architecture).snap
--2021-10-20 07:11:04--  http://apps.syncloud.org/apps/nextcloud_210624280_armhf.snap
Resolving apps.syncloud.org (apps.syncloud.org)... 52.218.224.147
Connecting to apps.syncloud.org (apps.syncloud.org)|52.218.224.147|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 296259584 (283M) [application/octet-stream]
Saving to: 'nextcloud_210624280_armhf.snap'

nextcloud_210624280 100%[===================>] 282.54M  15.9MB/s    in 19s

2021-10-20 07:11:24 (14.5 MB/s) - 'nextcloud_210624280_armhf.snap' saved [296259584/296259584]

root@syncloud:~# sudo snap install nextcloud_210624280_$(dpkg --print-architecture).snap --devmode
error: cannot perform the following tasks:
- Run pre-refresh hook of "nextcloud" snap if present (run hook "pre-refresh":
-----
2021-10-20 07:15:25,181 - database - INFO - executing: snap run nextcloud.pgdumpall -f /var/snap/nextcloud/current/database.dump
pg_dump: Dumping the contents of table "oc_cards" failed: PQgetResult() failed.
pg_dump: Error message from server: ERROR:  unexpected chunk size 31 (expected 1996) in chunk 36 of 137 for toast value 18072 in pg_toast_17326
pg_dump: The command was: COPY public.oc_cards (id, addressbookid, carddata, uri, lastmodified, etag, size, uid) TO stdout;
pg_dumpall.bin: pg_dump failed on database "nextcloud", exiting
Traceback (most recent call last):
  File "/snap/nextcloud/210108194/meta/hooks/pre-refresh", line 7, in <module>
    Installer().pre_refresh()
  File "/snap/nextcloud/210108194/hooks/installer.py", line 90, in pre_refresh
    self.db.backup()
  File "/snap/nextcloud/210108194/hooks/postgres.py", line 59, in backup
    self.log.info(check_output(cmd, shell=True))
  File "/snap/nextcloud/current/python/lib/python2.7/subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command 'snap run nextcloud.pgdumpall -f /var/snap/nextcloud/current/database.dump' returned non-zero exit status 1
-----)

Thanks

Simone

I see, looks like nextcloud database is corrupted or not enough disk space.

What kind of boot disk are you using (where syncloud image was written)?

If you have a backup (Settings - Backup) you could restore that backup into a fresh install of Nextcloud (of the same version as backup) and then continue the upgrade.

If you have no backup you can remove Nextcloud and install again from the store but you will lose settings like contacts/calendar. Files are stored separately on disk and can be rescanned back into Nextcloud if you have the same username using this command:

1 Like

Hi Boris,
thanks a lot. I have solved with a fresh install of Nextcloud. I wasn’t aware that the archive is not impacted by it! I seized the opportunity to perform a complete reset and now I am much happier of its configuration than before. Thanks a lot. Ciao
Simone :pizza: