Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL server has gone away during upgrade #8863

Closed
leavenotracks opened this issue Mar 17, 2018 · 61 comments
Closed

MySQL server has gone away during upgrade #8863

leavenotracks opened this issue Mar 17, 2018 · 61 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: install and update high

Comments

@leavenotracks
Copy link

Steps to reproduce

  1. Initiate update to 13.0.1 via Web UI
  2. Continue update via Web UI

Expected behaviour

Updater should complete without error.

Actual behaviour

Update is not successful:

image

NextCloudPi diagnostics

NextCloudPi version  v0.52.1
NextCloudPi image    NextCloudPi_12-04-17
distribution         Raspbian GNU/Linux 9 \n \l
automount            yes
USB devices          sda sdb
datadir              /media/brickCloud/ncdata
data in SD           no
data filesystem      btrfs
data disk usage      207G/1.9T
rootfs usage         1.9G/15G
swapfile             /var/swap
Nextcloud check      ok
Nextcloud version    13.0.1.1
HTTPD service        up
PHP service          up
MariaDB service      up
Redis service        up
Postfix service      up
internet check       ok
port check 80        open
port check 443       open
IP                   192.168.1.82
gateway              192.168.1.254
interface            eth0
certificates         annawalklate.plus.com
certs due            84 days
NAT loopback         no
uptime               52min

Nextcloud configuration

Nextcloud 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
{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": {
            "0": "localhost",
            "5": "nextcloudpi.local",
            "1": "192.168.1.82",
            "4": "annawalklate.plus.com",
            "2": "annawalklate.plus.com"
        },
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/annawalklate.plus.com",
        "dbtype": "mysql",
        "version": "13.0.0.14",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "mail_smtpmode": "php",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "overwriteprotocol": "https",
        "loglevel": "2",
        "log_type": "file",
        "maintenance": false,
        "logfile": "\/media\/brickCloud\/ncdata\/nextcloud.log",
        "theme": "",
        "updater.secret": "***REMOVED SENSITIVE VALUE***"
    }
}

HTTPd logs

[Fri Mar 16 06:25:02.108164 2018] [ssl:warn] [pid 841:tid 1992212480] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Fri Mar 16 06:25:03.001097 2018] [mpm_event:notice] [pid 841:tid 1992212480] AH00489: Apache/2.4.25 (Raspbian) OpenSSL/1.0.2l configured -- resuming normal operations
[Fri Mar 16 06:25:03.001176 2018] [core:notice] [pid 841:tid 1992212480] AH00094: Command line: '/usr/sbin/apache2'
[Fri Mar 16 23:53:50.099971 2018] [mpm_event:notice] [pid 841:tid 1992212480] AH00491: caught SIGTERM, shutting down
[Fri Mar 16 23:54:13.109988 2018] [ssl:warn] [pid 765:tid 1992273920] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Fri Mar 16 23:54:14.051389 2018] [ssl:warn] [pid 1012:tid 1992273920] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Fri Mar 16 23:54:15.005289 2018] [mpm_event:notice] [pid 1012:tid 1992273920] AH00489: Apache/2.4.25 (Raspbian) OpenSSL/1.0.2l configured -- resuming normal operations
[Fri Mar 16 23:54:15.005538 2018] [core:notice] [pid 1012:tid 1992273920] AH00094: Command line: '/usr/sbin/apache2'

Database logs

2018-03-17  0:17:02 1988698112 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-03-17  0:17:02 1988698112 [Note] InnoDB: Compressed tables use zlib 1.2.8
2018-03-17  0:17:02 1988698112 [Note] InnoDB: Using Linux native AIO
2018-03-17  0:17:02 1988698112 [Note] InnoDB: Using generic crc32 instructions
2018-03-17  0:17:02 1988698112 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2018-03-17  0:17:02 1988698112 [Note] InnoDB: Completed initialization of buffer pool
2018-03-17  0:17:02 1988698112 [Note] InnoDB: Highest supported file format is Barracuda.
2018-03-17  0:17:02 1988698112 [Note] InnoDB: The log sequence numbers 591266213 and 591266213 in ibdata files do not match the log sequence number 613061340 in the ib_logfiles!
2018-03-17  0:17:02 1988698112 [Note] InnoDB: Restoring possible half-written data pages from the doublewrite buffer...
2018-03-17  0:17:03 1988698112 [Note] InnoDB: 128 rollback segment(s) are active.
2018-03-17  0:17:03 1988698112 [Note] InnoDB: Waiting for purge to start
2018-03-17  0:17:03 1988698112 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.35-80.0 started; log sequence number 613061340
2018-03-17  0:17:03 1442837312 [Note] InnoDB: Dumping buffer pool(s) not yet started
2018-03-17  0:17:03 1988698112 [Note] Plugin 'FEEDBACK' is disabled.
2018-03-17  0:17:03 1988698112 [Note] Recovering after a crash using tc.log
2018-03-17  0:17:03 1988698112 [Note] Starting crash recovery...
2018-03-17  0:17:03 1988698112 [Note] Crash recovery finished.
2018-03-17  0:17:03 1988698112 [Note] Server socket created on IP: '127.0.0.1'.
2018-03-17  0:17:03 1988698112 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.1.23-MariaDB-9+deb9u1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  Raspbian 9.0

Nextcloud logs

{"reqId":"WqxeYn8AAQEAAAQRj@kAAA4T","level":1,"time":"2018-03-17T00:16:36+00:00","remoteAddr":"81.174.158.229","user":"--","app":"updater","method":"GET","url":"\/core\/ajax\/update.php?requesttoken=5O1U155XZkuqsVqmUW4sQ6mwTpBgVYnNhVzzd3CVSEo%3D%3Aib4ajdd4VHqbxBnKPSEDF8XbfscWGrz4xgTYXEP4KSw%3D","message":"\\OC\\Repair::step: Repair step: Add move avatar background job","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.162 Safari\/537.36","version":"13.0.0.14"}
{"reqId":"WqxeYn8AAQEAAAQRj@kAAA4T","level":1,"time":"2018-03-17T00:16:36+00:00","remoteAddr":"81.174.158.229","user":"--","app":"updater","method":"GET","url":"\/core\/ajax\/update.php?requesttoken=5O1U155XZkuqsVqmUW4sQ6mwTpBgVYnNhVzzd3CVSEo%3D%3Aib4ajdd4VHqbxBnKPSEDF8XbfscWGrz4xgTYXEP4KSw%3D","message":"\\OC\\Repair::info: Repair info: Repair step already executed","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.162 Safari\/537.36","version":"13.0.0.14"}
{"reqId":"WqxeYn8AAQEAAAQRj@kAAA4T","level":1,"time":"2018-03-17T00:16:36+00:00","remoteAddr":"81.174.158.229","user":"--","app":"updater","method":"GET","url":"\/core\/ajax\/update.php?requesttoken=5O1U155XZkuqsVqmUW4sQ6mwTpBgVYnNhVzzd3CVSEo%3D%3Aib4ajdd4VHqbxBnKPSEDF8XbfscWGrz4xgTYXEP4KSw%3D","message":"\\OC\\Repair::step: Repair step: Add preview cleanup background jobs","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.162 Safari\/537.36","version":"13.0.0.14"}
{"reqId":"WqxeYn8AAQEAAAQRj@kAAA4T","level":1,"time":"2018-03-17T00:16:36+00:00","remoteAddr":"81.174.158.229","user":"--","app":"updater","method":"GET","url":"\/core\/ajax\/update.php?requesttoken=5O1U155XZkuqsVqmUW4sQ6mwTpBgVYnNhVzzd3CVSEo%3D%3Aib4ajdd4VHqbxBnKPSEDF8XbfscWGrz4xgTYXEP4KSw%3D","message":"\\OC\\Repair::step: Repair step: Fix potential broken mount points","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.162 Safari\/537.36","version":"13.0.0.14"}
{"reqId":"WqxeYn8AAQEAAAQRj@kAAA4T","level":1,"time":"2018-03-17T00:16:36+00:00","remoteAddr":"81.174.158.229","user":"--","app":"updater","method":"GET","url":"\/core\/ajax\/update.php?requesttoken=5O1U155XZkuqsVqmUW4sQ6mwTpBgVYnNhVzzd3CVSEo%3D%3Aib4ajdd4VHqbxBnKPSEDF8XbfscWGrz4xgTYXEP4KSw%3D","message":"\\OC\\Repair::info: Repair info: No mounts updated","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.162 Safari\/537.36","version":"13.0.0.14"}
{"reqId":"WqxeYn8AAQEAAAQRj@kAAA4T","level":1,"time":"2018-03-17T00:16:36+00:00","remoteAddr":"81.174.158.229","user":"--","app":"updater","method":"GET","url":"\/core\/ajax\/update.php?requesttoken=5O1U155XZkuqsVqmUW4sQ6mwTpBgVYnNhVzzd3CVSEo%3D%3Aib4ajdd4VHqbxBnKPSEDF8XbfscWGrz4xgTYXEP4KSw%3D","message":"\\OC\\Repair::step: Repair step: Repair language codes","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.162 Safari\/537.36","version":"13.0.0.14"}
{"reqId":"WqxeYn8AAQEAAAQRj@kAAA4T","level":1,"time":"2018-03-17T00:16:36+00:00","remoteAddr":"81.174.158.229","user":"--","app":"updater","method":"GET","url":"\/core\/ajax\/update.php?requesttoken=5O1U155XZkuqsVqmUW4sQ6mwTpBgVYnNhVzzd3CVSEo%3D%3Aib4ajdd4VHqbxBnKPSEDF8XbfscWGrz4xgTYXEP4KSw%3D","message":"\\OC\\Repair::step: Repair step: Install new core bundle components","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.162 Safari\/537.36","version":"13.0.0.14"}
{"reqId":"WqxeYn8AAQEAAAQRj@kAAA4T","level":1,"time":"2018-03-17T00:16:36+00:00","remoteAddr":"81.174.158.229","user":"--","app":"updater","method":"GET","url":"\/core\/ajax\/update.php?requesttoken=5O1U155XZkuqsVqmUW4sQ6mwTpBgVYnNhVzzd3CVSEo%3D%3Aib4ajdd4VHqbxBnKPSEDF8XbfscWGrz4xgTYXEP4KSw%3D","message":"\\OC\\Repair::step: Repair step: Repair invalid paths in file cache","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.162 Safari\/537.36","version":"13.0.0.14"}
{"reqId":"WqxeYn8AAQEAAAQRj@kAAA4T","level":1,"time":"2018-03-17T00:16:36+00:00","remoteAddr":"81.174.158.229","user":"--","app":"updater","method":"GET","url":"\/core\/ajax\/update.php?requesttoken=5O1U155XZkuqsVqmUW4sQ6mwTpBgVYnNhVzzd3CVSEo%3D%3Aib4ajdd4VHqbxBnKPSEDF8XbfscWGrz4xgTYXEP4KSw%3D","message":"\\OC\\Repair::step: Repair step: Rename folder with user specific keys","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.162 Safari\/537.36","version":"13.0.0.14"}
{"reqId":"WqxeYn8AAQEAAAQRj@kAAA4T","level":1,"time":"2018-03-17T00:16:36+00:00","remoteAddr":"81.174.158.229","user":"--","app":"updater","method":"GET","url":"\/core\/ajax\/update.php?requesttoken=5O1U155XZkuqsVqmUW4sQ6mwTpBgVYnNhVzzd3CVSEo%3D%3Aib4ajdd4VHqbxBnKPSEDF8XbfscWGrz4xgTYXEP4KSw%3D","message":"\\OC\\Repair::step: Repair step: Add log rotate job","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.162 Safari\/537.36","version":"13.0.0.14"}
{"reqId":"WqxeYn8AAQEAAAQRj@kAAA4T","level":1,"time":"2018-03-17T00:16:36+00:00","remoteAddr":"81.174.158.229","user":"--","app":"updater","method":"GET","url":"\/core\/ajax\/update.php?requesttoken=5O1U155XZkuqsVqmUW4sQ6mwTpBgVYnNhVzzd3CVSEo%3D%3Aib4ajdd4VHqbxBnKPSEDF8XbfscWGrz4xgTYXEP4KSw%3D","message":"\\OC\\Repair::step: Repair step: Clear frontend caches","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.162 Safari\/537.36","version":"13.0.0.14"}
{"reqId":"WqxeYn8AAQEAAAQRj@kAAA4T","level":1,"time":"2018-03-17T00:16:36+00:00","remoteAddr":"81.174.158.229","user":"--","app":"updater","method":"GET","url":"\/core\/ajax\/update.php?requesttoken=5O1U155XZkuqsVqmUW4sQ6mwTpBgVYnNhVzzd3CVSEo%3D%3Aib4ajdd4VHqbxBnKPSEDF8XbfscWGrz4xgTYXEP4KSw%3D","message":"\\OC\\Repair::info: Repair info: Image cache cleared","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.162 Safari\/537.36","version":"13.0.0.14"}
{"reqId":"WqxeYn8AAQEAAAQRj@kAAA4T","level":3,"time":"2018-03-17T00:16:36+00:00","remoteAddr":"81.174.158.229","user":"--","app":"PHP","method":"GET","url":"\/core\/ajax\/update.php?requesttoken=5O1U155XZkuqsVqmUW4sQ6mwTpBgVYnNhVzzd3CVSEo%3D%3Aib4ajdd4VHqbxBnKPSEDF8XbfscWGrz4xgTYXEP4KSw%3D","message":"PDOStatement::execute(): MySQL server has gone away at \/var\/www\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/PDOStatement.php#105","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.162 Safari\/537.36","version":"13.0.0.14"}
{"reqId":"WqxeYn8AAQEAAAQRj@kAAA4T","level":3,"time":"2018-03-17T00:16:36+00:00","remoteAddr":"81.174.158.229","user":"--","app":"PHP","method":"GET","url":"\/core\/ajax\/update.php?requesttoken=5O1U155XZkuqsVqmUW4sQ6mwTpBgVYnNhVzzd3CVSEo%3D%3Aib4ajdd4VHqbxBnKPSEDF8XbfscWGrz4xgTYXEP4KSw%3D","message":"PDOStatement::execute(): Error reading result set's header at \/var\/www\/nextcloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/PDOStatement.php#105","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.162 Safari\/537.36","version":"13.0.0.14"}
{"reqId":"WqxeYn8AAQEAAAQRj@kAAA4T","level":2,"time":"2018-03-17T00:16:36+00:00","remoteAddr":"81.174.158.229","user":"--","app":"updater","method":"GET","url":"\/core\/ajax\/update.php?requesttoken=5O1U155XZkuqsVqmUW4sQ6mwTpBgVYnNhVzzd3CVSEo%3D%3Aib4ajdd4VHqbxBnKPSEDF8XbfscWGrz4xgTYXEP4KSw%3D","message":"\\OC\\Repair::warning: Repair warning: Unable to clear the frontend cache","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.162 Safari\/537.36","version":"13.0.0.14"}
{"reqId":"WqxeYn8AAQEAAAQRj@kAAA4T","level":3,"time":"2018-03-17T00:16:36+00:00","remoteAddr":"81.174.158.229","user":"--","app":"core","method":"GET","url":"\/core\/ajax\/update.php?requesttoken=5O1U155XZkuqsVqmUW4sQ6mwTpBgVYnNhVzzd3CVSEo%3D%3Aib4ajdd4VHqbxBnKPSEDF8XbfscWGrz4xgTYXEP4KSw%3D","message":"Exception: {\"Exception\":\"Doctrine\\\\DBAL\\\\Exception\\\\DriverException\",\"Message\":\"An exception occurred while executing 'UPDATE `oc_appconfig` SET `configvalue` = ? WHERE (`appid` = ?) AND (`configkey` = ?) AND (`configvalue` <> ?)' with params [0, \\\"core\\\", \\\"lastupdatedat\\\", 0]:\\n\\nSQLSTATE[HY000]: General error: 2006 MySQL server has gone away\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/DBALException.php(128): Doctrine\\\\DBAL\\\\Driver\\\\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException))\\n#1 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Connection.php(1015): Doctrine\\\\DBAL\\\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOMySql\\\\Driver), Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException), 'UPDATE `oc_appc...', Array)\\n#2 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/DB\\\/Connection.php(216): Doctrine\\\\DBAL\\\\Connection->executeUpdate('UPDATE `oc_appc...', Array, Array)\\n#3 \\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Query\\\/QueryBuilder.php(208): OC\\\\DB\\\\Connection->executeUpdate('UPDATE `oc_appc...', Array, Array)\\n#4 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/DB\\\/QueryBuilder\\\/QueryBuilder.php(214): Doctrine\\\\DBAL\\\\Query\\\\QueryBuilder->execute()\\n#5 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/AppConfig.php(210): OC\\\\DB\\\\QueryBuilder\\\\QueryBuilder->execute()\\n#6 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/AllConfig.php(166): OC\\\\AppConfig->setValue('core', 'lastupdatedat', 0)\\n#7 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Updater.php(293): OC\\\\AllConfig->setAppValue('core', 'lastupdatedat', 0)\\n#8 \\\/var\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Updater.php(139): OC\\\\Updater->doUpgrade('13.0.1.1', '13.0.0.14')\\n#9 \\\/var\\\/www\\\/nextcloud\\\/core\\\/ajax\\\/update.php(212): OC\\\\Updater->upgrade()\\n#10 {main}\",\"File\":\"\\\/var\\\/www\\\/nextcloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Driver\\\/AbstractMySQLDriver.php\",\"Line\":115}","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.162 Safari\/537.36","version":"13.0.0.14"}
{"reqId":"WqxeYn8AAQEAAAQRj@kAAA4T","level":3,"time":"2018-03-17T00:16:36+00:00","remoteAddr":"81.174.158.229","user":"--","app":"updater","method":"GET","url":"\/core\/ajax\/update.php?requesttoken=5O1U155XZkuqsVqmUW4sQ6mwTpBgVYnNhVzzd3CVSEo%3D%3Aib4ajdd4VHqbxBnKPSEDF8XbfscWGrz4xgTYXEP4KSw%3D","message":"\\OC\\Updater::failure: Doctrine\\DBAL\\Exception\\DriverException: An exception occurred while executing 'UPDATE `oc_appconfig` SET `configvalue` = ? WHERE (`appid` = ?) AND (`configkey` = ?) AND (`configvalue` <> ?)' with params [0, \"core\", \"lastupdatedat\", 0]:\n\nSQLSTATE[HY000]: General error: 2006 MySQL server has gone away","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.162 Safari\/537.36","version":"13.0.0.14"}
{"reqId":"WqxeYn8AAQEAAAQRj@kAAA4T","level":3,"time":"2018-03-17T00:16:36+00:00","remoteAddr":"81.174.158.229","user":"--","app":"updater","method":"GET","url":"\/core\/ajax\/update.php?requesttoken=5O1U155XZkuqsVqmUW4sQ6mwTpBgVYnNhVzzd3CVSEo%3D%3Aib4ajdd4VHqbxBnKPSEDF8XbfscWGrz4xgTYXEP4KSw%3D","message":"\\OC\\Updater::updateEnd: Update failed","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.162 Safari\/537.36","version":"13.0.0.14"}
{"reqId":"WqxeYn8AAQEAAAQRj@kAAA4T","level":1,"time":"2018-03-17T00:16:36+00:00","remoteAddr":"81.174.158.229","user":"--","app":"updater","method":"GET","url":"\/core\/ajax\/update.php?requesttoken=5O1U155XZkuqsVqmUW4sQ6mwTpBgVYnNhVzzd3CVSEo%3D%3Aib4ajdd4VHqbxBnKPSEDF8XbfscWGrz4xgTYXEP4KSw%3D","message":"\\OC\\Updater::maintenanceActive: Maintenance mode is kept active","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.162 Safari\/537.36","version":"13.0.0.14"}
{"reqId":"WqxeYn8AAQEAAAQRj@kAAA4T","level":1,"time":"2018-03-17T00:16:36+00:00","remoteAddr":"81.174.158.229","user":"--","app":"updater","method":"GET","url":"\/core\/ajax\/update.php?requesttoken=5O1U155XZkuqsVqmUW4sQ6mwTpBgVYnNhVzzd3CVSEo%3D%3Aib4ajdd4VHqbxBnKPSEDF8XbfscWGrz4xgTYXEP4KSw%3D","message":"\\OC\\Updater::resetLogLevel: Reset log level to Warning(2)","userAgent":"Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/65.0.3325.162 Safari\/537.36","version":"13.0.0.14"}

@splitt3r
Copy link
Contributor

splitt3r commented Mar 17, 2018

Googling General error: 2006 MySQL server has gone away gives some hints. Perhaps this is related to NextCloudPi?

@MorrisJobke
Copy link
Member

@rullzer @nickvergessen I really don't like that we more often get the "MySQL server has gone away" messages ... it seem to be not reasonable that all the mysql servers to stop working right in the middle of the updates :/ This looks really 🐟y

@MorrisJobke MorrisJobke added bug 0. Needs triage Pending check for reproducibility or if it fits our roadmap feature: install and update labels Mar 17, 2018
@rullzer
Copy link
Member

rullzer commented Mar 17, 2018

@MorrisJobke It seem to be getting more indeed. Maybe recent mysql/mariadb updates shortend the timout of connections?

@leavenotracks
Copy link
Author

leavenotracks commented Mar 19, 2018

@splitt3r I have not yet ruled out the possibility that of it being related to NCP, though I haven't seen the exact same issues reported over there.

@rullzer in terms of timeouts this is what I have:

image

These "MySQL server has gone away" errors are causing me problems during normal operation also, see
#8770

@MorrisJobke
Copy link
Member

@leavenotracks What is the max_allowed_packet variable set to?

@leavenotracks
Copy link
Author

@MorrisJobke
image

@MorrisJobke
Copy link
Member

That means 16 MB ... 🤔 ... @rullzer @nickvergessen could this be a reason? But 16 MB is really a lot. :/

@rullzer
Copy link
Member

rullzer commented Mar 20, 2018

in theory sure. but in practice 16MB should be more than enough.

Also it seems to fail on setting a config value. I find it very unlikely that this results in a packet of more than 16MB.

@user23498723452
Copy link

Not to redirect away from the app, but raspberry pi's use sd cards for storage by default, correct? If this user is using an sdcard, couldn't this be caused by various io issues? Assuming the db is on the pi.

@ghost
Copy link

ghost commented Mar 21, 2018

I am on debian testing here, mariadb 10.1.29, on a machine which is comparable in slowness to the raspi, and I upgraded to 13.0.1 with the web updater just fine without mariadb crashing.

@leavenotracks
Copy link
Author

@user23498723452 The nc database sits on a USB HD, along with the data.

@LollenJumplan I was able to upgrade to 13.0 from 12.0.5 via the web updater without any issues.

@janvlug
Copy link

janvlug commented Mar 24, 2018

I tried to upgrade from 13.0.0 to 13.0.1 via the web updater. But the update did not finish completely. When I open Nextcloud in the browser, I get this message:
"This Nextcloud instance is currently in maintenance mode..."
See this forum post for more details.
I'm using MariaDB on a Synology NAS.

I get this exception when trying to set the maintenance mode to off:
Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: could not find driver in /volume1/web/nextcloud/lib/private/DB/Connection.php:64

MariaDB version: 5.5.57-MariaDB

@janvlug
Copy link

janvlug commented Mar 24, 2018

I made a small modification to the code to fully throw the original stack trace. Here is part of it:

An unhandled exception has been thrown:
PDOException: could not find driver in /volume1/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43
Stack trace:
#0 /volume1/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(43): PDO->__construct('mysql:host=loca...', '[REDACTED]', '[REDACTED]', Array)
#1 /volume1/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOMySql/Driver.php(44): Doctrine\DBAL\Driver\PDOConnection->__construct('mysql:host=loca...', '[REDACTED]', '[REDACTED]', Array)
#2 /volume1/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(360): Doctrine\DBAL\Driver\PDOMySql\Driver->connect(Array, '[REDACTED]', '[REDACTED]', Array)
#3 /volume1/web/nextcloud/lib/private/DB/Connection.php(61): Doctrine\DBAL\Connection->connect()

@janvlug
Copy link

janvlug commented Mar 25, 2018

Further on the issue I had, it has been solved now.
It appeared that the pdo module is not installed when using php70 from the CLI.

I manually set 'maintenance' => false in config/config.php.

When I accessed Nextcloud in the browser after changing this setting the update was triggered again, and went smoothly. Everything seems to work fine again.

Concluding: somehow the value of maintenance was not set back to false. Now the update went through, I'm probably unable to reproduce the root case.

@MorrisJobke
Copy link
Member

#9065 had this:

ALTER TABLE oc_authtoken CHANGE id id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL

and

ALTER TABLE oc_admin_settings CHANGE id id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL

@MorrisJobke MorrisJobke changed the title Update to 13.0.1 via web updater not sucessful MySQL server has gone away during upgrade Apr 4, 2018
@MorrisJobke
Copy link
Member

@IPlayForHer @janvlug @leavenotracks @LollenJumplan @user23498723452 @splitt3r Do you use SSL for the mysql connection? (see #3709) Maybe this only affects SSL mysql connections and this is the reason why we can't reproduce it.

@IPlayForHer
Copy link

IPlayForHer commented Apr 5, 2018 via email

@Ablu
Copy link

Ablu commented Jul 2, 2018

I got this error while using the "download as zip" feature of a large folder. In that case I was able to fix it by increasing wait_timeout of mariadb.

@nextcloud-bot nextcloud-bot removed the stale Ticket or PR with no recent activity label Jul 2, 2018
@nextcloud-bot nextcloud-bot mentioned this issue Jul 29, 2018
@MorrisJobke MorrisJobke removed this from the Nextcloud 14 milestone Aug 24, 2018
@dasboeh
Copy link

dasboeh commented Oct 17, 2018

Hello. I tried to upgrade from 13.0.6 to 14.0.3.
Got this error:

Suche nach einer Aktualisierung für die App "workflowengine" im App-Store

App-Store auf Aktualisierung für die App "workflowengine" geprüft

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing ' UPDATE `oc_filecache` SET `mimetype` = ? WHERE `mimetype` <> ? AND `mimetype` <> ? AND `name` COLLATE UTF8_general_ci LIKE ? ' with params ["99", 2, "99", "%.vsdm"]: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

When I read the other postings correctly: there's still no solution to this, right?

I ran updater.phar and it "told me" it did a backup. As I'm new to Nextcloud: where did updater.phar put the backup, so I can restore it, like described here?

@MorrisJobke
Copy link
Member

I ran updater.phar and it "told me" it did a backup. As I'm new to Nextcloud: where did updater.phar put the backup, so I can restore it, like described here?

The updater only backs up the code itself but not the whole data nor database. But you could rerun "occ upgrade" and check if it works then.

@dasboeh
Copy link

dasboeh commented Oct 17, 2018

When I issue occ upgrade again, the same error occurs again, at the same positon in upgrade process, namely: "workflowengine".
As I understand it: the upgrade process wants to alter some tables in the database and failes because connection to database is lost. Wouldn't it be possible to do the update in the database manually? Could this work, to log in to nextcloud db and to issue the failed command like:

UPDATE `oc_filecache` SET `mimetype` = ? WHERE `mimetype` <> ? AND `mimetype` <> ? AND `name` COLLATE UTF8_general_ci LIKE ? ' with params ["99", 2, "99", "%.vsdm"];

I don't know if this is correct, since I don't know the SQL language by heart.
Thanks for any help in fixing this error.

@MorrisJobke
Copy link
Member

@icewind1991 @nickvergessen @rullzer Any idea what could be the problem here and why MySQL drops the connection?

@MorrisJobke
Copy link
Member

Do you also see this in your DB log?

Recovering after a crash using tc.log
2018-03-17  0:17:03 1988698112 [Note] Starting crash recovery...
2018-03-17  0:17:03 1988698112 [Note] Crash recovery finished.
...

@dasboeh
Copy link

dasboeh commented Oct 17, 2018

Yes, I see it around the time I was trying to update nextcloud:

2018-10-17  7:54:51 3063208768 [Note] Recovering after a crash using tc.log
2018-10-17  7:54:51 3063208768 [Note] Starting crash recovery...
2018-10-17  7:54:51 3063208768 [Note] Crash recovery finished.

@MorrisJobke
Copy link
Member

Yes, I see it around the time I was trying to update nextcloud:

is there anything else that maybe indicate what the crash cause was?

@dasboeh
Copy link

dasboeh commented Oct 17, 2018

is there anything else that maybe indicate what the crash cause was?

hmm... nothing I can think of. I updated Nextcloud before, but only in the range of version 13.

journalctl -S 2018-10-17 -r | grep mysql doesn't show anything either besides messages of restarting the mysql server

@MorrisJobke
Copy link
Member

doesn't show anything either besides messages of restarting the mysql server

Maybe check for "mariadb" as well?

@dasboeh
Copy link

dasboeh commented Oct 17, 2018

I got this:

Okt 17 07:54:49 odroid systemd[1]: mariadb.service: Scheduled restart job, restart counter is at 4.
Okt 17 07:54:49 odroid systemd[1]: mariadb.service: Service hold-off time over, scheduling restart.
Okt 17 07:54:43 odroid systemd[1]: mariadb.service: Failed with result 'signal'.
Okt 17 07:54:43 odroid systemd[1]: mariadb.service: Main process exited, code=killed, status=6/ABRT

Don't know if it's helpful...

@MorrisJobke
Copy link
Member

Main process exited, code=killed, status=6/ABRT

That one looks weird -.-

https://discuss.elastic.co/t/es-node-killed-with-6-abrt-how-to-find-out-why-and-by-whom/24108/3

Could you maybe check your system log? syslog, journalctl or dmesg at this time maybe?

@dasboeh
Copy link

dasboeh commented Oct 18, 2018

This is journalctl -S "2018-10-17 07:54:40" -U "2018-10-17 07:54:53":

-- Logs begin at Mon 2018-07-23 08:43:54 UTC, end at Thu 2018-10-18 12:59:43 UTC. --
Okt 17 07:54:40 odroid sudo[2535]:   user : TTY=pts/1 ; PWD=/var/www/nextcloud ; USER=www-data ; COMMAND=./occ upgrade
Okt 17 07:54:40 odroid sudo[2535]: pam_unix(sudo:session): session opened for user www-data by user(uid=0)
Okt 17 07:54:43 odroid systemd[1]: mariadb.service: Main process exited, code=killed, status=6/ABRT
Okt 17 07:54:43 odroid systemd[1]: mariadb.service: Failed with result 'signal'.
Okt 17 07:54:43 odroid sudo[2535]: pam_unix(sudo:session): session closed for user www-data
Okt 17 07:54:49 odroid systemd[1]: mariadb.service: Service hold-off time over, scheduling restart.
Okt 17 07:54:49 odroid systemd[1]: mariadb.service: Scheduled restart job, restart counter is at 4.
Okt 17 07:54:49 odroid systemd[1]: Stopped MariaDB 10.1.34 database server.
Okt 17 07:54:49 odroid systemd[1]: Starting MariaDB 10.1.34 database server...
Okt 17 07:54:49 odroid mysqld[2789]: 2018-10-17  7:54:49 3063208768 [Note] /usr/sbin/mysqld (mysqld 10.1.34-MariaDB-0ubuntu0.18.04.1) starting as pr
Okt 17 07:54:51 odroid /etc/mysql/debian-start[2847]: Upgrading MySQL tables if necessary.
Okt 17 07:54:51 odroid /etc/mysql/debian-start[2851]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
Okt 17 07:54:51 odroid /etc/mysql/debian-start[2851]: Looking for 'mysql' as: /usr/bin/mysql
Okt 17 07:54:51 odroid /etc/mysql/debian-start[2851]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Okt 17 07:54:51 odroid /etc/mysql/debian-start[2851]: This installation of MySQL is already upgraded to 10.1.34-MariaDB, use --force if you still ne
Okt 17 07:54:51 odroid /etc/mysql/debian-start[2859]: Checking for insecure root accounts.
Okt 17 07:54:51 odroid /etc/mysql/debian-start[2864]: Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables
Okt 17 07:54:51 odroid systemd[1]: Started MariaDB 10.1.34 database server.

Maybe I should consider a fresh installation of 14.03...

@MorrisJobke
Copy link
Member

occ upgrade triggered and 3 seconds later mariadb crashes :/

@meminens
Copy link

Running the latest stable version of Nextcloud and this error started popping up out of blue. Particularly when I click on the gallery button or on a file name that is a picture.

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'SELECT `fileid`, `storage`, `path`, `path_hash`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `storage_mtime`, `encrypted`, `etag`, `permissions`, `checksum` FROM `oc_filecache` WHERE `storage` = ? AND `path_hash` = ?' with params [1, "a03ebdb66d92002be01dffa1de24d276"]: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away```

@meminens
Copy link

meminens commented Nov 2, 2018

Here my is MySQL 5.7 config:

[mysqld]
connect_timeout=60
wait_timeout=60
interactive_timeout=60
max_allowed_packet=128M

Keep receiving this error when navigating folders with pictures. Very small folders. Only handful files and each file is about ~1 mb. Any thoughts?

@Rychu-Pawel
Copy link

Rychu-Pawel commented May 11, 2019

From what I see this is the main thread for this "Server has gone away" issue caused by MySQL SSL connection.
I have a fresh instance of Nextcloud 16.0.0 installed a week ago. I have only one user, no data uploaded yet and have a lot of "Server has gone away" 💩 in my logs. My MariaDB server is setup locally to the nextcloud. The connection is through the socket and it is SSL based. SSL certs are self-signed.

To me, this is obviously a bug in the nextcloud code and here is why I think so. I have a few months old owncloud instance next to the nextcloud. Configuration in config/config.php is exactly the same (except obvious things like dbname). At the time writing it stores over 100GB of files in total for 3 users. Owncloud doesn't report any "server has gone away" nor "SSL_shutdown:shutdown while in init" errors.

Same Ubuntu 18.04, PHP, nginx, OpenSSL, MariaDB server, MariaDB certificates, config/config.php config. But different codebase (from some point as I understand). Hope this will reopen the discussion a bit :)

In my case when the issue appears I always get at least 4 errors in the following order. First 3 from APP = PHP:

PDOStatement::execute(): SSL operation failed with code 1. OpenSSL Error messages: error:140E0197:SSL routines:SSL_shutdown:shutdown while in init at /srv/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php#141

PDOStatement::execute(): MySQL server has gone away at /srv/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php#141

PDOStatement::execute(): Error reading result set's header at /srv/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php#141

And then failed commands. Usually up to two. One from App = core and second from App = cron:

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'UPDATE `oc_jobs` SET `execution_duration` = ? WHERE `id` = ?' with params [3, 30]: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'DELETE FROM `oc_jobs` WHERE (`class` = ?) AND (`argument` = ?)' with params [some_private_data_here]: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

@longnh994
Copy link

Hello. I tried to upgrade on WebUI and has error when upload file on Web:

An exception occurred while executing 'SELECT * FROM oc_files_avir_status WHERE status_type=? and result=?' with params [1, 0]: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

Help me solve it!

@kwoxer
Copy link

kwoxer commented Nov 9, 2019

I also get this error since weeks. I'm using NC 16.0.6.1.

[webdav] Fatal: Sabre\DAV\Exception\ServiceUnavailable: Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'UPDATE `oc_preferences` SET `configvalue` = ? WHERE (`userid` = ?) AND (`appid` = ?) AND (`configkey` = ?)' with params [1573297718, "curtis", "login", "lastLogin"]:

SQLSTATE[HY000]: General error: 2006 MySQL server has gone away at <<closure>>

0. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php line 201
   OCA\DAV\Connector\Sabre\Auth->check(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
1. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php line 150
   Sabre\DAV\Auth\Plugin->check(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
2. <<closure>>
   Sabre\DAV\Auth\Plugin->beforeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
3. /var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
   undefinedundefinedcall_user_func_array([Sabre\DAV\Auth\ ... "], [Sabre\HTTP\Requ ... }])
4. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 466
   Sabre\Event\EventEmitter->emit("beforeMethod", [Sabre\HTTP\Requ ... }])
5. /var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php line 254
   Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
6. /var/www/nextcloud/apps/dav/lib/Server.php line 316
   Sabre\DAV\Server->exec()
7. /var/www/nextcloud/apps/dav/appinfo/v2/remote.php line 35
   OCA\DAV\Server->exec()
8. /var/www/nextcloud/remote.php line 163
   undefinedundefinedrequire_once("/var/www/nextcl ... p")

PROPFIND /remote.php/dav/calendars/curtis/curtis/
from 95.91.208.109 by curtis at 2019-11-09T12:08:38+01:00

@barnettZQG
Copy link

change the MySQL config, resolved.

set global max_allowed_packet=134217728;

@skjnldsv
Copy link
Member

As I cannot reproduce the original issue anymore, I will close this ticket. If this is still happening please make sure to upgrade to the latest version. After that, feel free to reopen.

@darccio
Copy link

darccio commented Jan 31, 2021

@skjnldsv I found this issue updating from 19.0.8 to 20.0.6, as suggested by Nextcloud itself.

The server is a KVM virtual machine with 4 GB. It runs PHP 7.4 as FPM, also updated to the latest version available at Debian Stretch, with memory_limit=512M.

After upgrading to Debian Buster, I was able to finish the Nextcloud upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: install and update high
Projects
None yet
Development

No branches or pull requests