Activating Nextcloud calendar leads to mysql-error

Nethserver 7.9.2009
Nextcloud 20.0.8

When I try to activate app calendar 3.0.6 through nextcloud web-interface I get the following MySQL-error:

An exception occurred while executing 'SELECT DISTINCT k.CONSTRAINT_NAME, k.COLUMN_NAME, k.REFERENCED_TABLE_NAME, k.REFERENCED_COLUMN_NAME /*!50116 , c.update_rule, c.delete_rule */ FROM information_schema.key_column_usage k /*!50116 INNER JOIN information_schema.referential_constraints c ON c.constraint_name = k.constraint_name AND c.table_name = 'oc_documents_op' */ WHERE k.table_name = 'oc_documents_op' AND k.table_schema = 'nextcloud' /*!50116 AND c.constraint_schema = 'nextcloud' */ AND k.REFERENCED_COLUMN_NAME is not NULL': SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

I would be very grateful for some advice for next steps of troubleshooting. Thanks a lot!

I found a related issue, did you open it?

The current NethServer Nextcloud version is 23.0.8, if it’s not a typo please update your NethServer.

Does the NethServer have enough RAM?

Thank you for the extremely fast feedback!

Yes, I opened exactly that issue.

I remember the problem occured first when I tried to upgrade Nextcloud using Migration scripts.

NethServer uses about 1.3 GB out of 4.

NethServer Nextcloud 20.0.8 uses the old mariadb 5 database engine, the more recent mariadb 10 was introduced with Neth Nextcloud 21.

I think you don’t need the scripts, because it’s just an update from 20 to 21. It should be possible to update in Software Center.

OK, so RAM shouldn’t be an issue.

It should be possible to update in Software Center.

Software Center says that I can update to nethserver-nextcloud 1.19.7 from 1.16.6-1.ns7 current. Are you sure that’s an update from Nextcloud 20 to 21 - from one major release to the following?

You are right. That’s an update from 20 to 23. You need to update on command line:

Update to 20.0.9:

yum update nethserver-nextcloud-1.16.7-1.ns7

Update to 21.0.3:

yum update nethserver-nextcloud-1.17.1-1.ns7

Update to 22.1.1:

yum update nethserver-nextcloud-1.18.0-1.ns7

Now you can update from Software Center.

1 Like

To downgrade to the next major version (NC 21.0.3):

yum downgrade nethserver-nextcloud-1.17.1-1.ns7

1 Like

Thanks, I will try these commands gradually.

1 Like

All theses commands worked without errors. Thank you.

But now web-interface says, that nextcloud will be updated to 23.0.8 and when I start the update, it shows

Exception: Updates between multiple major versions and downgrades are unsupported.

Is there a configfile, where I have to change a nextcloud versionnumber manually, too?

nextcloud config.php says ‘version’ => ‘20.0.8.1’,

No, that’s another method.

What version do you have installed now?

rpm -qa nethserver-nextcloud

I think you just need to update step by step as described here:

I did that.

Now I have installed

nethserver-nextcloud-1.19.7-1.ns7.noarch

What about replacing 'version’ => ‘20.0.8.1’ with ‘version’ => ‘23.0.8’ in config.php?

I don’t know why the version isn’t raised after the step-by-step updates. Did you miss a step?
If you have a backup you could also try the b) method in the wiki but there’s a db migration from 20 to 21 that may cause issues.

Maybe start again with version 20:

yum downgrade nethserver-nextcloud-1.16.7-1.ns7

No, I did every step and anything worked without an error.

Does the new db exist?

[root@server2 ~]# /opt/rh/rh-mariadb105/root/bin/mysqlshow --socket=/var/run/rh-mariadb105-mariadb/nextcloud-mysql.sock
+--------------------+
|     Databases      |
+--------------------+
| information_schema |
| mysql              |
| nextcloud          |
| performance_schema |
+--------------------+

Let’s check the old db too:

mysqlshow

Yes, it looks like yours and mysqlshow shows

+--------------------+
|     Databases      |
+--------------------+
| information_schema |
| mysql              |
| nextcloud          |
| oscdb              |
| performance_schema |
| roundcubemail      |
+--------------------+

Usually when the DB is migrated the old DB should be deleted. Maybe something went wrong during db migration.
I’m going to try to reproduce it…

For Reproduction: I did not the downgrade so far, I’m still at
nethserver-nextcloud-1.19.7-1.ns7.noarch