Nextcloud update (and restore) failed after first updating yunohost

:+1:

After letting this run for 2 days, I found there weren’t any processes running related to it
 it was stuck or stopped on the INSERT INTO memories_planet_geometry VALUES. I forced it to stop. I was thinking of a new avenue, to remove the memories_planet_geometry table from the db in the backup because it’s so huge, looking at this other topic you were also involved in Nextcloud update failed, restore backup failed :slight_smile: But I have no idea how to begin doing that
 :frowning:

Or did I mess this all up by updating ynh and then trying to restore a nextcloud backup that was on the old version of ynh?

I went back to see what your previous commands would return.

$ sudo yunohost tools update system
Info: Fetching available upgrades for system packages

Warning: W: Failed to fetch https://packages.sury.org/php/dists/bookworm/InRelease  Connection failed [IP: 151.101.207.52 443]
Warning: W: Some index files failed to download. They have been ignored, or old ones used instead.
Error: Something went wrong while updating the cache of APT (Debian's package manager). Here is a dump of the sources.list lines, which might help identify problematic lines: 
sources.list:deb http://ftp.debian.org/debian bookworm main contrib non-free-firmware
sources.list:deb-src http://ftp.debian.org/debian bookworm main contrib non-free-firmware
sources.list:deb http://deb.debian.org/debian bookworm-backports main contrib
sources.list:deb-src http://deb.debian.org/debian bookworm-backports main contrib
sources.list:deb [signed-by=/etc/apt/keyrings/YunoHost_repository.asc] http://repo.yunohost.org/debian/ bookworm stable
sources.list:deb http://security.debian.org/debian-security bookworm-security main contrib non-free-firmware
sources.list:deb-src http://security.debian.org/debian-security bookworm-security main contrib non-free-firmware
sources.list:deb http://ftp.debian.org/debian bookworm-updates main contrib non-free-firmware
sources.list:deb-src http://ftp.debian.org/debian bookworm-updates main contrib non-free-firmware
sources.list.d/yarn.list:deb [signed-by=/etc/apt/trusted.gpg.d/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main
sources.list.d/extra_php_version.list:deb [signed-by=/etc/apt/trusted.gpg.d/extra_php_version.gpg] https://packages.sury.org/php/ bookworm main
apps: 
important_yunohost_upgrade: False
last_apps_catalog_update: 217555
last_apt_update: 0
pending_migrations: 
system: 
  kernel, systemd, and other critical packages: 
    0: 
      current_version: 6.1.153-1
      name: linux-compiler-gcc-12-x86
      new_version: 6.1.158-1
    1: 
      current_version: 6.1.153-1
      name: linux-headers-amd64
      new_version: 6.1.158-1
    2: 
      current_version: 6.1.153-1
      name: linux-image-amd64
      new_version: 6.1.158-1
    3: 
      current_version: 6.1.153-1
      name: linux-kbuild-6.1
      new_version: 6.1.158-1
  misc utils and libs: 
    0: 
      current_version: 7:5.1.7-0+deb12u1
      name: ffmpeg
      new_version: 7:5.1.8-0+deb12u1
    1: 
      current_version: 7:5.1.7-0+deb12u1
      name: libavcodec59
      new_version: 7:5.1.8-0+deb12u1
    2: 
      current_version: 7:5.1.7-0+deb12u1
      name: libavdevice59
      new_version: 7:5.1.8-0+deb12u1
    3: 
      current_version: 7:5.1.7-0+deb12u1
      name: libavfilter8
      new_version: 7:5.1.8-0+deb12u1
    4: 
      current_version: 7:5.1.7-0+deb12u1
      name: libavformat59
      new_version: 7:5.1.8-0+deb12u1
    5: 
      current_version: 7:5.1.7-0+deb12u1
      name: libavutil57
      new_version: 7:5.1.8-0+deb12u1
    6: 
      current_version: 1.6.39-2
      name: libpng-dev
      new_version: 1.6.39-2+deb12u1
    7: 
      current_version: 1.6.39-2
      name: libpng-tools
      new_version: 1.6.39-2+deb12u1
    8: 
      current_version: 1.6.39-2
      name: libpng16-16
      new_version: 1.6.39-2+deb12u1
    9: 
      current_version: 7:5.1.7-0+deb12u1
      name: libpostproc56
      new_version: 7:5.1.8-0+deb12u1
    10: 
      current_version: 7:5.1.7-0+deb12u1
      name: libswresample4
      new_version: 7:5.1.8-0+deb12u1
    11: 
      current_version: 7:5.1.7-0+deb12u1
      name: libswscale6
      new_version: 7:5.1.8-0+deb12u1
    12: 
      current_version: 6.1.153-1
      name: linux-libc-dev
      new_version: 6.1.158-1
  yunohost: 
    0: 
      current_version: 12.1.12
      name: yunohost-admin
      new_version: 12.1.13
    1: 
      current_version: 12.1.32
      name: yunohost
      new_version: 12.1.38

$ apt-cache policy redis-server mariadb-server imagemagick libmagickcore-6.q16-6-extra
redis-server:
  Installed: (none)
  Candidate: 5:7.0.15-1~deb12u6
  Version table:
     5:7.0.15-1~deb12u6 500
        500 http://security.debian.org/debian-security bookworm-security/main amd64 Packages
     5:7.0.15-1~deb12u5 500
        500 http://ftp.debian.org/debian bookworm/main amd64 Packages
mariadb-server:
  Installed: (none)
  Candidate: 1:10.11.14-0+deb12u2
  Version table:
     1:10.11.14-0+deb12u2 500
        500 http://ftp.debian.org/debian bookworm/main amd64 Packages
imagemagick:
  Installed: (none)
  Candidate: 8:6.9.11.60+dfsg-1.6+deb12u4
  Version table:
     8:6.9.11.60+dfsg-1.6+deb12u4 500
        500 http://security.debian.org/debian-security bookworm-security/main amd64 Packages
     8:6.9.11.60+dfsg-1.6+deb12u3 500
        500 http://ftp.debian.org/debian bookworm/main amd64 Packages
libmagickcore-6.q16-6-extra:
  Installed: (none)
  Candidate: 8:6.9.11.60+dfsg-1.6+deb12u4
  Version table:
     8:6.9.11.60+dfsg-1.6+deb12u4 500
        500 http://security.debian.org/debian-security bookworm-security/main amd64 Packages
     8:6.9.11.60+dfsg-1.6+deb12u3 500
        500 http://ftp.debian.org/debian bookworm/main amd64 Packages

MĂȘme erreur (503) :
https://packages.sury.org/php/dists/bookworm/InRelease

Sorry, is there something that I should do here? :smiley:

Unfortunately nothing, it’s an issue with the provider of the PHP packages: Temporary failure while installing PHP packages.

Ok thanks for guiding me, then I’ll wait to do anything until this is fixed
!

I ended up trying to restore the NC backup via the CLI, and that shows a lot more than the webUI:

Info: [#####++.............] > Restoring the MySQL database...
Exception in thread Thread-8:
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
Warning: --------------
    self.run()
  File "/usr/lib/python3/dist-packages/yunohost/utils/process.py", line 157, in run
    self.queue.put((self.log_callback, line.decode("utf-8").strip("\n")))
                                       ^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe6 in position 38: invalid continuation byte
Warning: INSERT INTO `memories_planet_geometry` VALUES

Which is very much the issue that Olomorn also had in this thread that you helped in! Nextcloud update failed, restore backup failed - #2 by otm33

I’d be happy to either delete the geometry table or to change the encoding
 but I for the life of me can’t figure out how to do either :frowning: Olomorn also didn’t describe it in their thread, sadly :stuck_out_tongue:

First, make a backup of 
 your nextcloud backup.

cp -pr /home/yunohost.backup/archives/nc_bak.tar /home/yunohost.backup/archives/nc_bak2.tar

Extract the db and
 make a copy of it

cd /home/yunohost.backup/archives
tar xvf  nc_bak2.tar apps/nextcloud/backup/db.sql
cp -pr apps/nextcloud/backup/db.sql apps/nextcloud/backup/db.sql.bak

Edit the db.sql with nano (it can be tricky but if you mess it up, only the backup copy will be affected
 and you’ll be able to retry from a new copy of db.sql.bak)

=> remove memories_planet_geometry section and save the file.

nano /home/yunohost.backup/archives/apps/nextcloud/backup/db.sql

Then update the nc_bak2 archive

tar --update -f /home/yunohost.backup/archives/nc_bak2.tar apps/nextcloud/backup/db.sql

Cross fingers and restore the nc_bak2 archive from webadmin.

I did what you suggested, and: https://paste.yunohost.org/raw/ejojejimum I’m back with more logs!

NC shows up as app in the portal, but I still get the Nginx welcome screen when I go to the actual nextcloud url.

While, fwiw, the restore script seems to have gone through the Nginx setup just fine


Make sure your /etc/nginx/conf.d/nextcloud.maindomain.tld.d/nextcloud.conf matches with the default one : nextcloud_ynh/conf/nginx.conf at master · YunoHost-Apps/nextcloud_ynh · GitHub

we’re getting there


if I change this URL to any text really, it works. I’m not sure why it doesn’t work on just the base subdomain or how I can make that happen, but at least it’s working
!

Mmmh
 what do you mean ?
You can also try to force upgrade (from webadmin necxtcloud app page).

I mean, if I add any text at all after the slash in the url, the app works. But having the url for the app be just https://nextcloud.xxxx.nohost.me results in showing the Nginx welcome screen :slight_smile:

Make sure your /etc/nginx/conf.d/nextcloud.maindomain.tld.d/nextcloud.conf matches with the default one : nextcloud_ynh/conf/nginx.conf at master · YunoHost-Apps/nextcloud_ynh · GitHub

this does match
 ish? __PATH__etc are actual paths

Ok !
I would try changing the url (by adding a path) -and then reverting to the original url- or forcing an upgrade: both will regenerate nginx conf.

So much seems wrong: that doesn’t work, it just goes back to the “Welcome to nginx!” screen when clicking the app in the portal..however, I solved that now by using a different url and letting the nextcloud.xxxx.me subdomain default to Nextcloud! One less worry
 :-D.

However #2: when I try to upgrade NC, this is what happens: https://paste.yunohost.org/raw/fihakoluru :frowning:

Hi there, I’m having the same exact issue I think. How did you force stop it?

Could you share the output of

yunohost app shell nextcloud
# nextcloud shell
php occ maintenance:mode  # share the output of this command
exit

Hey, sorry to hear that. Force stop what?

nextcloud@lalo:~$ php occ maintenance:mode
Maintenance mode is currently enabled

Am I wrong in assuming it’s a good idea to turn on maintenance mode before backing up or updating?