Update fails with MySql error 1878 on Database Migration


#1

Steps to reproduce

  1. Updating OC 8.2.7 to 8.2.11 via Web-Frontend
  2. Trying to update 8.2.11 to 9.0.11 via Web-Frontend

Expected behaviour

updating the database

Actual behaviour

Update stops with message

OC\DB\MigrationException: An exception occurred while executing 'ALTER TABLE oc_oc_filecache_opulluws00dme ADD `checksum` VARCHAR(255) DEFAULT NULL': SQLSTATE[HY000]: General error: 1878 Temporary file write failure.

Server configuration

Operating system: Debian 6

Web server: Apache

Database: Mysql

PHP version: 5.5.11

ownCloud version: between 8.2.11 and 9.0.11

Updated from an older ownCloud or fresh install: between 8.2.11 and 9.0.11

Where did you install ownCloud from: official

Signing status (ownCloud 9.0 and above): cannot login

The content of config/config.php: cannot login

List of activated apps: cannot login

Logs

Web server error log

nothing relevant found

PHP error log

[28-Oct-2018 05:18:00 UTC] {"reqId":"W9VGiFQmQzYAADpeiTQAAAAH","remoteAddr":"77.190.50.159","app":"core","message":"starting upgrade from 8.2.11.1 to 9.0.11.2","level":0,"time":"2018-10-28T05:18:00+00:00","method":"GET","url":"\/owncloud\/core\/ajax\/update.php?requesttoken=BDthLxEEIWk4DCc3dwZ8Xg43EjceJ38bKhlmKT4NGHM%3D%3AMn%2BIiBlYpcwTOA2lGDBzOt9ROKVsIJR1KZNhAT7o5hM%3D","user":"--"}
[28-Oct-2018 05:18:03 UTC] {"reqId":"W9VGiFQmQzYAADpeiTQAAAAH","remoteAddr":"77.190.50.159","app":"core","message":"Simulated database structure update failed (exception 'OC\\DB\\MigrationException' with message 'An exception occurred while executing 'ALTER TABLE oc_oc_filecache_iq6yjdf4cx51a ADD `checksum` VARCHAR(255) DEFAULT NULL':\n\nSQLSTATE[HY000]: General error: 1878 Temporary file write failure.' in \/home\/owncloud\/owncloud\/lib\/private\/db\/migrator.php:152\nStack trace:\n#0 \/home\/owncloud\/owncloud\/lib\/private\/db\/migrator.php(110): OC\\DB\\Migrator->checkTableMigrate(Object(Doctrine\\DBAL\\Schema\\Table))\n#1 \/home\/owncloud\/owncloud\/lib\/private\/db\/mdb2schemamanager.php(129): OC\\DB\\Migrator->checkMigrate(Object(Doctrine\\DBAL\\Schema\\Schema))\n#2 \/home\/owncloud\/owncloud\/lib\/private\/db.php(202): OC\\DB\\MDB2SchemaManager->simulateUpdateDbFromStructure('\/home\/owncloud\/...')\n#3 \/home\/owncloud\/owncloud\/lib\/private\/updater.php(365): OC_DB::simulateUpdateDbFromStructure('\/home\/owncloud\/...')\n#4 \/home\/owncloud\/owncloud\/lib\/private\/updater.php(315): OC\\Updater->checkCoreUpgrade()\n#5 \/home\/owncloud\/owncloud\/lib\/private\/updater.php(212): OC\\Updater->doUpgrade('9.0.11.2', '8.2.11.1')\n#6 \/home\/owncloud\/owncloud\/core\/ajax\/update.php(120): OC\\Updater->upgrade()\n#7 {main})","level":4,"time":"2018-10-28T05:18:03+00:00","method":"GET","url":"\/owncloud\/core\/ajax\/update.php?requesttoken=BDthLxEEIWk4DCc3dwZ8Xg43EjceJ38bKhlmKT4NGHM%3D%3AMn%2BIiBlYpcwTOA2lGDBzOt9ROKVsIJR1KZNhAT7o5hM%3D","user":"--"}
[28-Oct-2018 05:18:03 UTC] {"reqId":"W9VGiFQmQzYAADpeiTQAAAAH","remoteAddr":"77.190.50.159","app":"core","message":"Exception: {\"Exception\":\"OC\\\\DB\\\\MigrationException\",\"Message\":\"An exception occurred while executing 'ALTER TABLE oc_oc_filecache_iq6yjdf4cx51a ADD `checksum` VARCHAR(255) DEFAULT NULL':\\n\\nSQLSTATE[HY000]: General error: 1878 Temporary file write failure.\",\"Code\":0,\"Trace\":\"#0 \\\/home\\\/owncloud\\\/owncloud\\\/lib\\\/private\\\/db\\\/migrator.php(110): OC\\\\DB\\\\Migrator->checkTableMigrate(Object(Doctrine\\\\DBAL\\\\Schema\\\\Table))\\n#1 \\\/home\\\/owncloud\\\/owncloud\\\/lib\\\/private\\\/db\\\/mdb2schemamanager.php(129): OC\\\\DB\\\\Migrator->checkMigrate(Object(Doctrine\\\\DBAL\\\\Schema\\\\Schema))\\n#2 \\\/home\\\/owncloud\\\/owncloud\\\/lib\\\/private\\\/db.php(202): OC\\\\DB\\\\MDB2SchemaManager->simulateUpdateDbFromStructure('\\\/home\\\/owncloud\\\/...')\\n#3 \\\/home\\\/owncloud\\\/owncloud\\\/lib\\\/private\\\/updater.php(365): OC_DB::simulateUpdateDbFromStructure('\\\/home\\\/owncloud\\\/...')\\n#4 \\\/home\\\/owncloud\\\/owncloud\\\/lib\\\/private\\\/updater.php(315): OC\\\\Updater->checkCoreUpgrade()\\n#5 \\\/home\\\/owncloud\\\/owncloud\\\/lib\\\/private\\\/updater.php(212): OC\\\\Updater->doUpgrade('9.0.11.2', '8.2.11.1')\\n#6 \\\/home\\\/owncloud\\\/owncloud\\\/core\\\/ajax\\\/update.php(120): OC\\\\Updater->upgrade()\\n#7 {main}\",\"File\":\"\\\/home\\\/owncloud\\\/owncloud\\\/lib\\\/private\\\/db\\\/migrator.php\",\"Line\":152}","level":3,"time":"2018-10-28T05:18:03+00:00","method":"GET","url":"\/owncloud\/core\/ajax\/update.php?requesttoken=BDthLxEEIWk4DCc3dwZ8Xg43EjceJ38bKhlmKT4NGHM%3D%3AMn%2BIiBlYpcwTOA2lGDBzOt9ROKVsIJR1KZNhAT7o5hM%3D","user":"--"}

ownCloud log (data/owncloud.log)

{"reqId":"W7n7QlQmQzYAADEYHvwAAAAH","remoteAddr":"77.12.83.248","app":"core","message":"starting upgrade from 8.2.7.1 to 8.2.11.1","level":0,"time":"2018-10-07T12:25:38+00:00","method":"GET","url":"\/owncloud\/core\/ajax\/update.php?requesttoken=CiptBAM6OBczTBlwMjgONh8MGDp%2BEGJYST82MFZC%3AyhYK5NBdjgO7QSMG4MOcNZ7o9KBAar"}

So I found that the error means that there might not be enough space for executing the command and copying the table. But that is odd because the table “filecache” is only around 16MB.
Any ideas where to start?

Thanks in Adavance!

Greetings
Peter


#2

Make sure that this upgrade path is supported.
I recommend a manual update, as described in the docs.
Do not use the Web-Frontend.


#3

Hi Alfred,

thanks for the comment.

Tried again manually with console command … result seems to be the same
From what I understand from the doc the upgrade path should be alright because the two versions are the latest between the major releases 8.2 and 9.0

So I downloaded 9.0.11 again unpacked it an copied config.php as necessary
Then I ran

./occ upgrade

Result:

ownCloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Set log level to debug
Turned on maintenance mode
Checking whether the database schema can be updated (this can take a long time depending on the database size)
OC\DB\MigrationException: An exception occurred while executing 'ALTER TABLE oc_oc_filecache_b37jzipmsu47p ADD `checksum` VARCHAR(255) DEFAULT NULL':

SQLSTATE[HY000]: General error: 1878 Temporary file write failure.
Update failed
Maintenance mode is kept active
Reset log level

Is there a way to reduce the size of the tables?
For now I have the problem with “oc_filecache” but “oc_activity” is even bigger.
Sure this would not actually solve the problem, but seems like a workaround for now. I actually want to upgrade the machine, startet with Owncloud and grinding my teeth about it already.


#4

I don’t know how to reduce the size of those tables, unless to empty them.

Are you running out of disk space?


#5

Hey,

there was a discussion around this recently in Upgraded from 8.1 to 8.2 which came to the conclusion that it seems you’re able to go directly from 8.2.11 to the latest 10.0.10: Upgraded from 8.1 to 8.2


#6

Hi,

yes and no.
Apparently /tmp is being used for the altering command by mysql.
There was a very small partition mounted on /tmp.
So I created a new /temp somewhere and pointed to it in my.cnf
What is odd is that the update before worked just fine.

Then there have been some hickups with the occ script due to permission settings. Fixed.

Now the upgrade has been successfull but the calendar not working anymore :frowning:
But thats a project for another day.

Thanks, even if it was a problem with the machine.