Upgrade to 10.13.0 fails: SQLSTATE[HY000]: General error: 1812 Tablespace is missing for tablemeineCloud.oc_migrations

First of all, I’ve installed OwnCloud this way:

echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/server:/10/Ubuntu_22.04/ /' | sudo tee /etc/apt/sources.list.d/isv:ownCloud:server:10.list
curl -fsSL https://download.opensuse.org/repositories/isv:ownCloud:server:10/Ubuntu_22.04/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/isv_ownCloud_server_10.gpg > /dev/null
sudo apt update
sudo apt install owncloud-complete-files

So by running apt updates it will get updated too.

This time it installed the Version 10.13.0

After that, opening the web page, a database update is waiting. It shows me the following:

ownCloud wird auf Version 10.13.0 aktualisiert.

Diese Apps werden aktualisiert:

* Activity (activity)
* Admin Config Report (configreport)
* Files (files)
* Text Editor (files_texteditor)
* First run wizard (firstrunwizard)
* Market (market)
* Notifications (notifications)

Now what happens.

Steps to reproduce

  1. Open the page
  2. Click on the button to start the update.

Expected behaviour

Running and finish the update.

Actual behaviour

I get the following error message:

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'SELECT versionFROMoc_migrationsWHEREapp= ? ORDER BYversionASC' with params ["core"]: SQLSTATE[HY000]: General error: 1812 Tablespace is missing for tablemeineCloud.oc_migrations.

Clicking on that part in PhpMyAdmin outputs the same error message.

Trying to do a repair end with:

meineCloud.oc_migrations

* Warning InnoDB: Tablespace is missing for table meineCloud/oc_migrations.
* Error Tablespace is missing for table `meineCloud`.`oc_migrations`.
* Error Corrupt

Looking through all entries, only “oc_migrations” is in this faulty state. Every other entry is ok.

I’ve tried with “innodb_force_recovery” parameters to get at least an export of the content and be able to reimport it into a new entry. But no success. The error message just changes to “SQLSTATE[HY000]: General error: 2006 MySQL server has gone away”

Thy mysqldump output with innodb_force_recovery set to 4 looks like this:

Server:~$ mysqldump -u '’ -p meineCloud oc_migrations
Enter password:
– MySQL dump 10.13 Distrib 8.0.34, for Linux (x86_64)

– Host: localhost Database: meineCloud


– Server version 8.0.34-0ubuntu0.22.04.1

/*!40101 SET (at)OLD_CHARACTER_SET_CLIENT=(at)(at)CHARACTER_SET_CLIENT /;
/
!40101 SET (at)OLD_CHARACTER_SET_RESULTS=(at)(at)CHARACTER_SET_RESULTS /;
/
!40101 SET (at)OLD_COLLATION_CONNECTION=(at)(at)COLLATION_CONNECTION /;
/
!50503 SET NAMES utf8mb4 /;
/
!40103 SET (at)OLD_TIME_ZONE=(at)(at)TIME_ZONE /;
/
!40103 SET TIME_ZONE=‘+00:00’ /;
/
!40014 SET (at)OLD_UNIQUE_CHECKS=(at)(at)UNIQUE_CHECKS, UNIQUE_CHECKS=0 /;
/
!40014 SET (at)OLD_FOREIGN_KEY_CHECKS=(at)(at)FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 /;
/
!40101 SET (at)OLD_SQL_MODE=(at)(at)SQL_MODE, SQL_MODE=‘NO_AUTO_VALUE_ON_ZERO’ /;
/
!40111 SET (at)OLD_SQL_NOTES=(at)(at)SQL_NOTES, SQL_NOTES=0 */;


– Table structure for table oc_migrations

DROP TABLE IF EXISTS oc_migrations;
/*!40101 SET (at)saved_cs_client = (at)(at)character_set_client /;
/
!50503 SET character_set_client = utf8mb4 /;
CREATE TABLE oc_migrations (
app varchar(177) COLLATE utf8mb4_bin NOT NULL,
version varchar(14) COLLATE utf8mb4_bin NOT NULL,
PRIMARY KEY (app,version)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin ROW_FORMAT=COMPRESSED;
/
!40101 SET character_set_client = (at)saved_cs_client */;


– Dumping data for table oc_migrations

mysqldump: Couldn’t execute ‘SELECT /*!40001 SQL_NO_CACHE */ * FROM oc_migrations’: Lost connection to MySQL server during query (2013)

I don’t want to start with a clean new OwnCloud installation.

So is there a way to fix this?

EDIT: I was able to do a rollback of the entire server with a backup to a date before the update got installed. The version is now 10.12.2.1 and the server is running.

The “oc_migrations” entry in the database is still corrupt.

But: Maybe with a running server its possible to delete and rebuild this?

Server configuration

Operating system: Ubuntu 22.04.3 LTS

Web server: Apache

Database: libmysql - mysqlnd 7.4.33

PHP version: 7.4.33

ownCloud version: 10.13.0

Updated from an older ownCloud or fresh install: Updated from the earlier version that got rolled out over the repo. (10.12.2.1)

Where did you install ownCloud from: As described at the beginning

The other stuff in the list is currently not possible (because I get nothing more than this Database update page) or there is no visible connection to the faulty database entry.

Hey,

i found the following on https://dba.stackexchange.com/a/244480:

"Tablespace is missing for table XXXX”

There are broadly three ways in which this error can happen:

  • Table files have the wrong ownership/permissions
  • The table file is misplaced
  • The data file is corrupted or deleted

other solutions can be found here: https://bobcares.com/blog/mysql-tablespace-is-missing-for-table/

I think there could be a serious issue on database system level not related to ownCloud.

If this is the case i think the database manual, support community or some professional help could be required to recover from these database issues.

I already knew these. It’s not like I wasn’t already looking for it.

That’s why I ended up coming here to look for a way to rebuild that part of the database.

To be able to use it again, I have now reinstalled OwnCloud. It’s a bit noticeable though. This is now the second time I had to rebuild OwnCloud because of database issues. None of my other applications on the server, including CMS, have had to deal with corrupted databases in all these years. And the other applications have been running on the server much longer than OwnCloud.

As far as I know, ownCloud doesn’t touch any DB file outside of what is available through SQL, so I don’t think ownCloud can corrupt the DB by itself.

It’s true that ownCloud can use the DB extensively, and adding other services such CMS could increase the DB load too much for the DB to handle the requests correctly.
I think you could try to setup ownCloud with an exclusive DB (not shared with other services) and / or try to monitor the workload on the DB.

1 Like

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