Nextcloud update failed, restore backup failed

What type of hardware are you using: Old laptop or computer
What YunoHost version are you running: 12.0.14
How are you able to access your server: The webadmin
SSH
Are you in a special context or did you perform specific tweaking on your YunoHost instance ?: nothing special

Describe your issue

Hi everyone,

Recently, I launched the Nextcloud update from 30.0.8 to 31.0.4 through the webadmin. The update failed, the app was removed, and the backup started being restored. The problem is that the restoration never finished, and I wasn’t able to restore the backup after either. The restoration starts, but when it comes to restoring the database, it gets stuck at the beginning - never finishing even after a few hours - and I have to stop the process manually.

Share relevant logs or error messages

Here is the upgrade log:
https://paste.yunohost.org/raw/olabedaqiq

and here is the backup restore log:
https://paste.yunohost.org/raw/hikudefimo

Here is the specific error on which the process gets stuck:

Info: [#####++…] > Restoring the MySQL database…
Exception in thread Thread-8:
Warning: --------------
Traceback (most recent call last):
File “/usr/lib/python3.11/threading.py”, line 1038, in _bootstrap_inner
Warning: INSERT INTO memories_planet_geometry VALUES
self.run()
File “/usr/lib/python3/dist-packages/moulinette/utils/process.py”, line 150, 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 36: invalid continuation byte

When I saw that, I opened the SQL file from the backup, and this is what it looks like:

I don’t know if this is normal, or what to do. I really need my backup to be restored. I could use an older one, but I’d much rather use this one.

Hi,
What’s the encoding of the memories_planet_geometry table ? May be related ?

I suppose it is indeed utf8mb4.

DROP TABLE IF EXISTS `memories_planet_geometry`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `memories_planet_geometry` (
  `id` varchar(32) NOT NULL,
  `poly_id` varchar(32) NOT NULL,
  `type_id` int(11) NOT NULL,
  `osm_id` int(11) NOT NULL,
  `geometry` polygon NOT NULL,
  PRIMARY KEY (`id`),
  KEY `planet_osm_id_idx` (`osm_id`),
  SPATIAL KEY `planet_osm_polygon_geometry_idx` (`geometry`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

I do not know how to handle this, but I think I can safely delete the data from this table. The only problem is that it seems huge (thousands of lines), and I’m not sure how to remove all this data while making sure I don’t remove anything else.

Thank you for the link. It gave me the confirmation that it was safe to remove this data from the backup. So I did, then repackaged the backup, and restored it with Yunohost as usual and this time it worked.
I haven’t noticed anything wrong with Nextcloud and the Memories app after the restoration.

I don’t know if the problem comes from how the Nextcloud app for Yunohost is set up, or if it’s the backup/restore system from Yunohost itself that caused this issue, but I managed to fix it by myself for now, so I’ll set this topic to solved.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.