Update to 22 failed with database error - Updated

Okay, guys, it was not very nice not to receive any answer about updating to 22-Problems, but anyways, we found what it is all about:
MariaDB 10.6 does no longer support compressed columns. So if you run your Nextcloud and MariaDB on Docker, pulling the latest updates, you will run into this issue.
So it helps to restore your MariaDB. But you will need to delete the row with ā€œcompressedā€ data within somewhere at the first 15 lines of your dump.

@Nextclouders: Go and delete the compressed col stuff. Thanks.

Thanks for putting in the effort. I have the same problem, though I am running Manjaro and I cant really downgrade MariaDB.
But I think I found a solution. Just uninstall this desaster called nextcloud. Update 21 was several hours of work, update 22 same. Like I gonna spend my life fixing software that was supposed to make my live easyer.
Funny thing is, there is a popup windows here on this homepage that reads:
ā€œThe biggest improvements Nextcloud Hub 22 introduces are:ā€
They call not working at all an improvement?

Your issues have nothing to do with the Nextcloud software. They have to do with the fact that you are using Nextcloud on a rolling release distro that is primarily developed for desktop use. Generally, it is recommended to use LTS distributions for server use. With server software that depends on various components, you canā€™t always just blindly upgrade everything, without first clarifying what impact that might have.

If you want a simpler solution where others already did some of the work for you, you could use an appliance like NextcloudPi or the Snap Package.

Or you could put it in a VM or use Docker. The possibilities are endlessā€¦ But installing it natively on a rolling release distro, possibly even on your main work or home computer, is pretty much the worst choice of all and you are literally begging for issues, if you do that.

1 Like

Although I thought that I had configured NC not to update automatically, it actually seems to have started an update to v22, but it got stuck and showed a ā€œnextcloud in maintenance modeā€ message.

After having disabled that, it appears that I have the very same issue and unfortunately I have to admit, that I am stuck. No idea how to solve the issue.
Can you elaborate? (or is there any recent fix?)

Hi,
guess you need to describe your setup.
My issue was about MariaDB 10.6 at the end of the day. They changed their settings regarding the ā€œCompressedā€ feature of rows. This is deprecated now, but Nextcloud uses this. So to allow an update you need to import your dump without this flag in your dump:
ROW_FORMAT=COMPRESSED

DROP TABLE IF EXISTS `accounts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `accounts` (
  `uid` varchar(64) COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  `data` longtext COLLATE utf8mb4_bin NOT NULL,
  PRIMARY KEY (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=COMPRESSED;
/*!40101 SET character_set_client = @saved_cs_client */;

Hope this helps and hope Nextcloud is going to change this for 22.

/best
Frank.

Or just stay on MariaDB <10.6 and wait and hope that there will be an official migration guide at some point. Time is not of the essence. Every major MariaDB version has 5 years of support. :wink:

1 Like

You are right. Until now, our puppet fact was set to ā€œlatest releasesā€, but we stopped this now. In addition to this, we are setting up one VM as DEV-Instance of NC.

Thatā€™s a pretty good idea anyways. I always test new versions of NC and dependencies before I roll them out in ā€œproductionā€. And that although I only use Nextcloud for personal things. But since I also migrated my girlfriend from Goggle to my NC, I canā€™t afford downtime anymore :smiley:

I feel you mate!

I could (at least temporarily) solve the issue by specifying

SET GLOBAL innodb_read_only_compressed=OFF;

in MariaDB.

Continuing the update process then worked without further issues. Thanks for pointing me into the right direction.

1 Like

As I had been successful by switching off the default read-only flag for compressed data ( innodb_read_only_compressed=OFF), I wonder if it would be an alternative to alter the tables from row_format compressed to e.g dynamic.
Would this work or does Nextcloud rely on the compressed format? If this is the case, what is the perspective (assuming that the row_format compressed will be dropped with one of the next releases)?

How would you turn that off if youā€™re using docker containers?

You saved my life this evening. thanksā€¦ :partying_face:

1 Like

I use docker-compose. The reply from @tjohs and others above pointed me in the right direction. I added the following to the commandline options for mariadb in the docker compose image:
ā€“innodb_read_only_compressed=OFF

This worked for me.

My mariadb section now looks like:

db:
image: mariadb
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb_read_only_compressed=OFF
restart: always

see:
https://mariadb.com/docs/reference/mdb/system-variables/innodb_read_only_compressed/

1 Like

Hi All,
So, where to put this magic - innodb_read_only_compressed=OFF ?
it must be done inside the docker.compose file ?
(Same situation after updates to 22, NC is in docker)

Regards,
Kortik

Iā€™m not a docker expert, but I would say yes. Just add the command --innodb_read_only_compressed=OFF like described in the post before yours. You can find other examples hereā€¦ Database Incompatibility with MariaDB 10.6.0 Ā· Issue #1492 Ā· nextcloud/docker Ā· GitHub

Thanks bb77,
I tried to add this command to the docker compose but I see again ā€œUpdateā€ page and when I click it then I see:
image

Thanks everyone for cooperation.
Finally it was done when I add:
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --skip-innodb-read-only-compressed
instead of:
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb_read_only_compressed=OFF

PS: skip vs OFF :slight_smile:

2 Likes

Same thing for NC 23.0.0. Doesn anyone have a solution for PostgreSQL?

2 Likes

I am using Nextcloud via docker containers, I was not specifying the image version of mariadb in my docker-compose.yml and ran into the problem mentioned in this thread.

Solved easily by adding version 10.5 for mariadb image in the docker-compose.yml:
nextclouddb:
image: mariadb:10.5

MariaDB 10.5 LTS runs until 24 Jun 2025 - so long time left to solve the issue!