Video uploads not working

9.1.x
help

#1

Hello,

I have a problem with my cloud. After fixing that Apache issue, now I see that I can not upload video files on cloud from my iPhone.
I've looked into logs and I saw the output below.

On this server I use:
DEBIAN 3.16.39-1 (2016-12-30) x86_64
PHP 7.0.15
Apache 2.4.25
MariaDB 10.1.21

upload_max_filesize = 2G

OwnCloud version: 9.1.2 Stable

Error:

Exception: {"Message":"An exception occurred while executing 'UPDATE oc_file_locks SET lock = -1, ttl = ? WHERE key = ? AND lock = 1' with params [1486382928, \"files\\/c688b56183bbbe4df954608c593b87bf\"]:\n\nSQLSTATE[HY000]:
General error: 2006 MySQL server has gone away","Exception":"
Doctrine\DBAL\Exception\DriverException","Code":0,"Trace":"#0 \/home\/USER\/domains\/mydomain.TLD\/public_html\/cloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/DBALException.php(116):
Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))\n#1 \/home\/USER\/domains\/mydomain.TLD\/public_html\/cloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Connection.php(996):
Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'UPDATE oc_file...', Array)\n#2 \/home\/USER\/domains\/mydomain.TLD\/public_html\/cloud\/lib\/private\/DB\/Connection.php(209):
Doctrine\\DBAL\\Connection->executeUpdate('UPDATE
oc_file...', Array, Array)\n#3 \/home\/USER\/domains\/mydomain.TLD\/public_html\/cloud\/lib\/private\/Lock\/DBLockingProvider.php(228): OC\\DB\\Connection->executeUpdate('UPDATE`oc_file...', Array)\n#4 \/home\/USER\/domains\/mydomain.TLD\/public_html\/cloud\/lib\/private\/Files\/Storage\/Common.php(686):
OC\Lock\DBLockingProvider->changeLock('files\/c688b5618...', 2)\n#5 \/home\/USER\/domains\/mydomain.TLD\/public_html\/cloud\/lib\/private\/Files\/Storage\/Wrapper\/Wrapper.php(608):
OC\Files\Storage\Common->changeLock('files\/Photos\/20...', 2, Object(OC\Lock\DBLockingProvider))\n#6 \/home\/USER\/domains\/mydomain.TLD\/public_html\/cloud\/lib\/private\/Files\/Storage\/Wrapper\/Wrapper.php(608):
OC\Files\Storage\Wrapper\Wrapper->changeLock('files\/Photos\/20...', 2, Object(OC\Lock\DBLockingProvider))\n#7 \/home\/USER\/domains\/mydomain.TLD\/public_html\/cloud\/lib\/private\/Files\/View.php(1956):
OC\Files\Storage\Wrapper\Wrapper->changeLock('files\/Photos\/20...', 2, Object(OC\Lock\DBLockingProvider))\n#8 \/home\/USER\/domains\/mydomain.TLD\/public_html\/cloud\/apps\/dav\/lib\/Connector\/Sabre\/Node.php(348):
OC\Files\View->changeLock('\/Photos\/2017\/fe...', 2)\n#9 \/home\/USER\/domains\/mydomain.TLD\/public_html\/cloud\/apps\/dav\/lib\/Connector\/Sabre\/File.php(169):
OCA\DAV\Connector\Sabre\Node->changeLock(2)\n#10 \/home\/USER\/domains\/mydomain.TLD\/public_html\/cloud\/apps\/dav\/lib\/Connector\/Sabre\/Directory.php(136):
OCA\DAV\Connector\Sabre\File->put(Resource id #369)\n#11 \/home\/USER\/domains\/mydomain.TLD\/public_html\/cloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(1036):
OCA\DAV\Connector\Sabre\Directory->createFile('Video-2017-02-0...', Resource id #369)\n#12 \/home\/USER\/domains\/mydomain.TLD\/public_html\/cloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php(523):
Sabre\DAV\Server->createFile('Photos\/2017\/feb...', Resource id #369, NULL)\n#13 [internal function]:
Sabre\DAV\CorePlugin->httpPut(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#14 \/home\/USER\/domains\/mydomain.TLD\/public_html\/cloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105):
call_user_func_array(Array, Array)\n#15 \/home\/USER\/domains\/mydomain.TLD\/public_html\/cloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(459):
Sabre\Event\EventEmitter->emit('method:PUT', Array)\n#16 \/home\/USER\/domains\/mydomain.TLD\/public_html\/cloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(248):
Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#17 \/home\/USER\/domains\/mydomain.TLD\/public_html\/cloud\/apps\/dav\/appinfo\/v1\/webdav.php(56):
Sabre\DAV\Server->exec()\n#18 \/home\/USER\/domains\/mydomain.TLD\/public_html\/cloud\/remote.php(164):
require_once('\/home\/USER\/doma...')\n#19 {main}","File":"\/home\/USER\/domains\/mydomain.TLD\/public_html\/cloud\/3rdparty\/doctrine\/dbal\/lib\/Doctrine\/DBAL\/Driver\/AbstractMySQLDriver.php","Line":115,"User":"USERNAME"}

Any ideas? :frowning:

Thank you!


#2

Hi,

there is a documentation on how to workaround this error available here:

https://doc.owncloud.org/server/latest/admin_manual/configuration_database/linux_database_configuration.html#how-to-workaround-general-error-2006-mysql-server-has-gone-away


#3

Thank you, kljhlkhglklfgh!
I edited /etc/my.cnf and I've changed wait_timeout from 30 to 60.

After that, I got another error

"Exception: {\"Message\":\"HTTP\\/1.1 423 \\"FilePath\\/FileName.ext\\" is locked\",\"Exception\"

but I fixed by deleting all oc_file_locks database entryes.

Thank you again!


#4

If you're uploading large files you might also want to configure redis based file locking like explained in [1] as well as system cron based background jobs [2]. This should also help with locked files and their clean-up.

[1]

https://doc.owncloud.org/server/latest/admin_manual/configuration_files/files_locking_transactional.html

[2]

https://doc.owncloud.org/server/latest/admin_manual/configuration_server/background_jobs_configuration.html#cron