core icon indicating copy to clipboard operation
core copied to clipboard

"General error: 5 database is locked" while uploading small files

Open dttpy opened this issue 12 years ago • 27 comments

Expected behaviour

No error message while uploading small files, and the thumbnail of the files can be shown directly after the end of uploading.

Actual behaviour

8 small files were planed to be uploaded. While uploading the files (step 2 below), an error message is shown:

exception occurred while executing 'UPDATE "oc_filecache" SET "size"=? WHERE "fileid" = ?':  SQLSTATE[HY000]: General error: 5 database is locked

Because of this error, after the end of the upload, it shows the sum of files in the folder is 7, and after refreshing the page, the "invisible" file is back, the the sum of files is 8. This problem comes always accidently. Sometimes 2 error messages can be shown while uploading 5 files, but sometimes it works fine, even by uploading 100 files.

Here is the link of the test files. They are all the small ".gif" files with the average size: 5 kb. http://db.tt/Yat97nN

Steps to reproduce

  1. create a folder and go inside it
  2. upload several small files, in my case 8 files
  3. If there is no error message, repeat the second step, else: refresh the page

Server configuration

Operating system: Ubuntu 13.10

Web server: apache 2.4.6 (Ubuntu)

Database: SQLite

PHP version: 5.5.3-1ubuntu2.3

ownCloud version: 7.0.3

Updated from an older ownCloud or fresh install: from 7.0.3rc

List of activated app:standard apps of owncloud 7.0.3 and encryption

The content of config/config.php: (Without the database password and passwordsalt) $CONFIG = array ( 'instanceid' => 'oc6d9cda6e26',

'datadirectory' => '/var/ocdata/***/owncloud/data', 'dbtype' => 'sqlite3', 'version' => '7.0.3.4', 'installed' => true, 'theme' => '', 'maintenance' => false, 'maxZipInputSize' => 838860800, 'allowZipDownload' => true, 'loglevel' => '0', 'trusted_domains' => array ( 0 => '192.168.1.80', ), );

Are you using external storage, if yes which one: no

Client configuration

Browser: firefox 33.1.1

Operating system: ubuntu 13.10

Logs

Web server error log

ownCloud log (data/owncloud.log)

{"reqId":"5474d56d31135","app":"search_lucene","message":"searching hits for pk:91d8d5b505c818592ad87975085a82d1","level":0,"time":"2014-11-25T19:15:57+00:00","method":"GET","url":"\/owncloud703\/cron.php"}
{"reqId":"5474d56d31135","app":"search_lucene","message":"found 0 hits ","level":0,"time":"2014-11-25T19:15:57+00:00","method":"GET","url":"\/owncloud703\/cron.php"}
{"reqId":"5474d56e16692","app":"core","message":"OC_Image::loadFromFileHandle(): Trying","level":0,"time":"2014-11-25T19:15:58+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2F%2F1.txt&c=53bea5bed1155&x=36&y=36&forceIcon=0"}
{"reqId":"5474d56e16692","app":"core","message":"OC_Image->fixOrientation() No readable file path set.","level":0,"time":"2014-11-25T19:15:58+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2F%2F1.txt&c=53bea5bed1155&x=36&y=36&forceIcon=0"}
{"reqId":"5474d56e16c11","app":"core","message":"OC_Image::loadFromFileHandle(): Trying","level":0,"time":"2014-11-25T19:15:58+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2F%2Fnew.txt&c=53beb76180a40&x=36&y=36&forceIcon=0"}
{"reqId":"5474d56e16692","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T19:15:58+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2F%2F1.txt&c=53bea5bed1155&x=36&y=36&forceIcon=0"}
{"reqId":"5474d56e16c11","app":"core","message":"OC_Image->fixOrientation() No readable file path set.","level":0,"time":"2014-11-25T19:15:58+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2F%2Fnew.txt&c=53beb76180a40&x=36&y=36&forceIcon=0"}
{"reqId":"5474d56e16c11","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T19:15:58+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2F%2Fnew.txt&c=53beb76180a40&x=36&y=36&forceIcon=0"}
{"reqId":"5474d56e1d889","app":"core","message":"OC_Image::loadFromFileHandle(): Trying","level":0,"time":"2014-11-25T19:15:58+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2F%2F%25%5E%26*%28%29.txt&c=53bea5a25c7a4&x=36&y=36&forceIcon=0"}
{"reqId":"5474d56e1d889","app":"core","message":"OC_Image->fixOrientation() No readable file path set.","level":0,"time":"2014-11-25T19:15:58+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2F%2F%25%5E%26*%28%29.txt&c=53bea5a25c7a4&x=36&y=36&forceIcon=0"}
{"reqId":"5474d56e1d889","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T19:15:58+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2F%2F%25%5E%26*%28%29.txt&c=53bea5a25c7a4&x=36&y=36&forceIcon=0"}
{"reqId":"5474d57566518","app":"music","message":"update - \/admin\/files\/as","level":0,"time":"2014-11-25T19:16:05+00:00","method":"POST","url":"\/owncloud703\/index.php\/apps\/files\/ajax\/newfolder.php"}
{"reqId":"5474d58b9b72a","app":"OC\\Files\\Cache\\Scanner","message":"!!! No reuse of etag for 'files_encryption\/keyfiles\/as' !!! \ncache: Array\n(\n    [fileid] => 3165\n    [storage] => home::admin\n    [path] => files_encryption\/keyfiles\/as\n    [parent] => 682\n    [name] => as\n    [mimetype] => httpd\/unix-directory\n    [mimepart] => httpd\n    [size] => 2596\n    [mtime] => 1415345470\n    [storage_mtime] => 1415345470\n    [encrypted] => \n    [unencrypted_size] => 0\n    [etag] => 545c753ef1b7c\n    [permissions] => 31\n)\n \ndata: Array\n(\n    [mimetype] => httpd\/unix-directory\n    [mtime] => 1416942987\n    [size] => -1\n    [etag] => 5474d58b9b477\n    [storage_mtime] => 1416942987\n    [permissions] => 31\n    [parent] => 682\n)\n","level":0,"time":"2014-11-25T19:16:27+00:00","method":"POST","url":"\/owncloud703\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"5474d58b9b72a","app":"OC\\Files\\Cache\\Scanner","message":"!!! No reuse of etag for 'files_encryption\/share-keys\/as' !!! \ncache: Array\n(\n    [fileid] => 3167\n    [storage] => home::admin\n    [path] => files_encryption\/share-keys\/as\n    [parent] => 1899\n    [name] => as\n    [mimetype] => httpd\/unix-directory\n    [mimepart] => httpd\n    [size] => 28160\n    [mtime] => 1415345471\n    [storage_mtime] => 1415345470\n    [encrypted] => \n    [unencrypted_size] => 0\n    [etag] => 545c753f400f4\n    [permissions] => 31\n)\n \ndata: Array\n(\n    [mimetype] => httpd\/unix-directory\n    [mtime] => 1416942987\n    [size] => -1\n    [etag] => 5474d58be498c\n    [storage_mtime] => 1416942987\n    [permissions] => 31\n    [parent] => 1899\n)\n","level":0,"time":"2014-11-25T19:16:27+00:00","method":"POST","url":"\/owncloud703\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"5474d58b9b72a","app":"music","message":"update - \/admin\/files\/as\/3m_sie.gif","level":0,"time":"2014-11-25T19:16:28+00:00","method":"POST","url":"\/owncloud703\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"5474d58b9b72a","app":"music","message":"update - mimetype image\/gif","level":0,"time":"2014-11-25T19:16:28+00:00","method":"POST","url":"\/owncloud703\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"5474d58d98645","app":"music","message":"update - \/admin\/files\/as\/8p.gif","level":0,"time":"2014-11-25T19:16:29+00:00","method":"POST","url":"\/owncloud703\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"5474d58d98645","app":"music","message":"update - mimetype image\/gif","level":0,"time":"2014-11-25T19:16:29+00:00","method":"POST","url":"\/owncloud703\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"5474d58da908c","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'thumbnails\/4106' is not readable !!!","level":0,"time":"2014-11-25T19:16:29+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2F3m_sie.gif&c=5474d58b745dc&x=36&y=36&forceIcon=0"}
{"reqId":"5474d58da908c","app":"core","message":"Generating preview for \"\/as\/3m_sie.gif\" with \"OC\\Preview\\Image\"","level":0,"time":"2014-11-25T19:16:29+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2F3m_sie.gif&c=5474d58b745dc&x=36&y=36&forceIcon=0"}
{"reqId":"5474d58da908c","app":"PHP","message":"exif_read_data(e5c4677a5ef04a6de52447589bda54c1gif): File not supported at \/var\/www\/owncloud703\/lib\/private\/image.php#326","level":0,"time":"2014-11-25T19:16:29+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2F3m_sie.gif&c=5474d58b745dc&x=36&y=36&forceIcon=0"}
{"reqId":"5474d58da908c","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T19:16:29+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2F3m_sie.gif&c=5474d58b745dc&x=36&y=36&forceIcon=0"}
{"reqId":"5474d58e012f5","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'thumbnails\/4109' is not readable !!!","level":0,"time":"2014-11-25T19:16:30+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2F8p.gif&c=5474d58d11063&x=36&y=36&forceIcon=0"}
{"reqId":"5474d58e012f5","app":"core","message":"Generating preview for \"\/as\/8p.gif\" with \"OC\\Preview\\Image\"","level":0,"time":"2014-11-25T19:16:30+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2F8p.gif&c=5474d58d11063&x=36&y=36&forceIcon=0"}
{"reqId":"5474d58e012f5","app":"PHP","message":"exif_read_data(20be67717c0d57b18baf4b0718563963gif): File not supported at \/var\/www\/owncloud703\/lib\/private\/image.php#326","level":0,"time":"2014-11-25T19:16:30+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2F8p.gif&c=5474d58d11063&x=36&y=36&forceIcon=0"}
{"reqId":"5474d58e012f5","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T19:16:30+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2F8p.gif&c=5474d58d11063&x=36&y=36&forceIcon=0"}
{"reqId":"5474d58ee8652","app":"music","message":"update - \/admin\/files\/as\/aniolek.gif","level":0,"time":"2014-11-25T19:16:30+00:00","method":"POST","url":"\/owncloud703\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"5474d58ee8652","app":"music","message":"update - mimetype image\/gif","level":0,"time":"2014-11-25T19:16:30+00:00","method":"POST","url":"\/owncloud703\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"5474d58f18eae","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'thumbnails\/4114' is not readable !!!","level":0,"time":"2014-11-25T19:16:31+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Faniolek.gif&c=5474d58e0ae06&x=36&y=36&forceIcon=0"}
{"reqId":"5474d58f18eae","app":"core","message":"Generating preview for \"\/as\/aniolek.gif\" with \"OC\\Preview\\Image\"","level":0,"time":"2014-11-25T19:16:31+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Faniolek.gif&c=5474d58e0ae06&x=36&y=36&forceIcon=0"}
{"reqId":"5474d58f18eae","app":"PHP","message":"exif_read_data(b61720104ca0e9c7a0609c0429ba8fbdgif): File not supported at \/var\/www\/owncloud703\/lib\/private\/image.php#326","level":0,"time":"2014-11-25T19:16:31+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Faniolek.gif&c=5474d58e0ae06&x=36&y=36&forceIcon=0"}
{"reqId":"5474d58f18eae","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T19:16:31+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Faniolek.gif&c=5474d58e0ae06&x=36&y=36&forceIcon=0"}
{"reqId":"5474d58fdbdce","app":"music","message":"update - \/admin\/files\/as\/aparat.gif","level":0,"time":"2014-11-25T19:16:31+00:00","method":"POST","url":"\/owncloud703\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"5474d58fdbdce","app":"music","message":"update - mimetype image\/gif","level":0,"time":"2014-11-25T19:16:31+00:00","method":"POST","url":"\/owncloud703\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"5474d5901cec1","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'thumbnails\/4119' is not readable !!!","level":0,"time":"2014-11-25T19:16:32+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Faparat.gif&c=5474d58f21761&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5901cec1","app":"core","message":"Generating preview for \"\/as\/aparat.gif\" with \"OC\\Preview\\Image\"","level":0,"time":"2014-11-25T19:16:32+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Faparat.gif&c=5474d58f21761&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5901cec1","app":"PHP","message":"exif_read_data(6af36cd1646306ebbeb8186d1fb9e75egif): File not supported at \/var\/www\/owncloud703\/lib\/private\/image.php#326","level":0,"time":"2014-11-25T19:16:32+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Faparat.gif&c=5474d58f21761&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5901cec1","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T19:16:32+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Faparat.gif&c=5474d58f21761&x=36&y=36&forceIcon=0"}
{"reqId":"5474d59150677","app":"music","message":"update - \/admin\/files\/as\/bezradny.gif","level":0,"time":"2014-11-25T19:16:33+00:00","method":"POST","url":"\/owncloud703\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"5474d59150677","app":"music","message":"update - mimetype image\/gif","level":0,"time":"2014-11-25T19:16:33+00:00","method":"POST","url":"\/owncloud703\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"5474d591708e1","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'thumbnails\/4129' is not readable !!!","level":0,"time":"2014-11-25T19:16:33+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fbezradny.gif&c=5474d590b95d8&x=36&y=36&forceIcon=0"}
{"reqId":"5474d591708e1","app":"core","message":"Generating preview for \"\/as\/bezradny.gif\" with \"OC\\Preview\\Image\"","level":0,"time":"2014-11-25T19:16:33+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fbezradny.gif&c=5474d590b95d8&x=36&y=36&forceIcon=0"}
{"reqId":"5474d591708e1","app":"PHP","message":"exif_read_data(75d9d99b387bd2eaecb49327f7b56907gif): File not supported at \/var\/www\/owncloud703\/lib\/private\/image.php#326","level":0,"time":"2014-11-25T19:16:33+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fbezradny.gif&c=5474d590b95d8&x=36&y=36&forceIcon=0"}
{"reqId":"5474d591708e1","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T19:16:33+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fbezradny.gif&c=5474d590b95d8&x=36&y=36&forceIcon=0"}
{"reqId":"5474d591708e1","app":"core","message":"An exception occurred while executing 'UPDATE \"oc_filecache\" SET \"size\"=? WHERE \"fileid\" = ?':\n\nSQLSTATE[HY000]: General error: 5 database is locked","level":0,"time":"2014-11-25T19:16:33+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fbezradny.gif&c=5474d590b95d8&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5925705b","app":"music","message":"update - \/admin\/files\/as\/bije.gif","level":0,"time":"2014-11-25T19:16:34+00:00","method":"POST","url":"\/owncloud703\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"5474d5925705b","app":"music","message":"update - mimetype image\/gif","level":0,"time":"2014-11-25T19:16:34+00:00","method":"POST","url":"\/owncloud703\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"5474d5927b213","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'thumbnails\/4132' is not readable !!!","level":0,"time":"2014-11-25T19:16:34+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fbije.gif&c=5474d59177907&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5927b213","app":"core","message":"Generating preview for \"\/as\/bije.gif\" with \"OC\\Preview\\Image\"","level":0,"time":"2014-11-25T19:16:34+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fbije.gif&c=5474d59177907&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5927b213","app":"PHP","message":"exif_read_data(fde32564b8662bc7742769517cae9934gif): File not supported at \/var\/www\/owncloud703\/lib\/private\/image.php#326","level":0,"time":"2014-11-25T19:16:34+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fbije.gif&c=5474d59177907&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5927b213","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T19:16:34+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fbije.gif&c=5474d59177907&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5936f484","app":"music","message":"update - \/admin\/files\/as\/boisie.gif","level":0,"time":"2014-11-25T19:16:35+00:00","method":"POST","url":"\/owncloud703\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"5474d5936f484","app":"music","message":"update - mimetype image\/gif","level":0,"time":"2014-11-25T19:16:35+00:00","method":"POST","url":"\/owncloud703\/index.php\/apps\/files\/ajax\/upload.php"}
{"reqId":"5474d593895e3","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'thumbnails\/4137' is not readable !!!","level":0,"time":"2014-11-25T19:16:35+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fboisie.gif&c=5474d59284448&x=36&y=36&forceIcon=0"}
{"reqId":"5474d593895e3","app":"core","message":"Generating preview for \"\/as\/boisie.gif\" with \"OC\\Preview\\Image\"","level":0,"time":"2014-11-25T19:16:35+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fboisie.gif&c=5474d59284448&x=36&y=36&forceIcon=0"}
{"reqId":"5474d593895e3","app":"PHP","message":"exif_read_data(fc479aabb5d7688357cb6e70f007038agif): File not supported at \/var\/www\/owncloud703\/lib\/private\/image.php#326","level":0,"time":"2014-11-25T19:16:35+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fboisie.gif&c=5474d59284448&x=36&y=36&forceIcon=0"}
{"reqId":"5474d593895e3","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T19:16:35+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fboisie.gif&c=5474d59284448&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a145efa","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'thumbnails\/4124' is not readable !!!","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fbeczy.gif&c=5474d59026542&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a145efa","app":"core","message":"Generating preview for \"\/as\/beczy.gif\" with \"OC\\Preview\\Image\"","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fbeczy.gif&c=5474d59026542&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a149046","app":"core","message":"OC_Image::loadFromFileHandle(): Trying","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2F3m_sie.gif&c=5474d58b745dc&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a149046","app":"core","message":"OC_Image->fixOrientation() No readable file path set.","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2F3m_sie.gif&c=5474d58b745dc&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a149046","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2F3m_sie.gif&c=5474d58b745dc&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a145efa","app":"PHP","message":"exif_read_data(bfaf06253a954e9b040ced71245e09f4gif): File not supported at \/var\/www\/owncloud703\/lib\/private\/image.php#326","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fbeczy.gif&c=5474d59026542&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a145efa","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fbeczy.gif&c=5474d59026542&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a184166","app":"core","message":"OC_Image::loadFromFileHandle(): Trying","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Faparat.gif&c=5474d58f21761&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a184166","app":"core","message":"OC_Image->fixOrientation() No readable file path set.","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Faparat.gif&c=5474d58f21761&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a184166","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Faparat.gif&c=5474d58f21761&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a191da8","app":"core","message":"OC_Image::loadFromFileHandle(): Trying","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2F8p.gif&c=5474d58d11063&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a191da8","app":"core","message":"OC_Image->fixOrientation() No readable file path set.","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2F8p.gif&c=5474d58d11063&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a191da8","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2F8p.gif&c=5474d58d11063&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a19d00e","app":"core","message":"OC_Image::loadFromFileHandle(): Trying","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fbezradny.gif&c=5474d590b95d8&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a19d00e","app":"core","message":"OC_Image->fixOrientation() No readable file path set.","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fbezradny.gif&c=5474d590b95d8&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a19d00e","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fbezradny.gif&c=5474d590b95d8&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a1a734a","app":"core","message":"OC_Image::loadFromFileHandle(): Trying","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Faniolek.gif&c=5474d58e0ae06&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a1a734a","app":"core","message":"OC_Image->fixOrientation() No readable file path set.","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Faniolek.gif&c=5474d58e0ae06&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a1a734a","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Faniolek.gif&c=5474d58e0ae06&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a1b0d78","app":"core","message":"OC_Image::loadFromFileHandle(): Trying","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fbije.gif&c=5474d59177907&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a1b0d78","app":"core","message":"OC_Image->fixOrientation() No readable file path set.","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fbije.gif&c=5474d59177907&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a1b0d78","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fbije.gif&c=5474d59177907&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a1b6426","app":"core","message":"OC_Image::loadFromFileHandle(): Trying","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fboisie.gif&c=5474d59284448&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a1b6426","app":"core","message":"OC_Image->fixOrientation() No readable file path set.","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fboisie.gif&c=5474d59284448&x=36&y=36&forceIcon=0"}
{"reqId":"5474d5a1b6426","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T19:16:49+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fboisie.gif&c=5474d59284448&x=36&y=36&forceIcon=0"}

dttpy avatar Nov 25 '14 19:11 dttpy

In the middle of the log:

{"reqId":"5474d591708e1","app":"core","message":"An exception occurred while executing 'UPDATE \"oc_filecache\" SET \"size\"=? WHERE \"fileid\" = ?':\n\nSQLSTATE[HY000]: General error: 5 database is locked","level":0,"time":"2014-11-25T19:16:33+00:00","method":"GET","url":"\/owncloud703\/index.php\/core\/preview.png?file=%2Fas%2Fbezradny.gif&c=5474d590b95d8&x=36&y=36&forceIcon=0"}

It seems that what happens is as follows: while a file is being uploaded, the preview of another is being read. The upload itself is triggering the scanner with a potential database lock, and sometimes the preview generation triggers it.

@butonic @icewind1991 I thought we managed to increase the SQLite lock timeout somehow ?

Also I find it strange that the file preview would even need the database, maybe it's only to read the mime type ? CC @georgehrke @LukasReschke

PVince81 avatar Nov 25 '14 20:11 PVince81

Just few seconds before you I've added the same issue: https://github.com/owncloud/core/issues/12428

ghost avatar Nov 25 '14 22:11 ghost

@PVince81 I really have no idea about SQLite3 internals and I don't really feel about digging into that myself extensively.

I for one consider it still as not the best idea to have SQLite3 as default set. But anyways…

LukasReschke avatar Nov 25 '14 23:11 LukasReschke

@LukasReschke [i'm not a SQLite/php expert] does ownCloud properly closes/releases resources? also there is a busyTimeout that SQLite3 gives, you can have a look this answer over there http://stackoverflow.com/questions/9866139/database-locked-while-trying-to-access-from-php-script

UPDATE another possible solution to the General error: 5 database is locked -> http://php.net/manual/en/ref.pdo-sqlite.php#115031

ghost avatar Nov 25 '14 23:11 ghost

About releasing resources: https://github.com/owncloud/core/issues/10566

PVince81 avatar Nov 26 '14 09:11 PVince81

Absolute wild guess, maybe the WAL mode might help here by making things faster (though obviously not a fix but a work-around). Introduced with https://github.com/owncloud/core/pull/12420

Would be interesting to see the impacts. @arno01 @dttpy Can you try to reproduce this with the newest master which has this patch applied and get back with feedback to us?

LukasReschke avatar Nov 26 '14 10:11 LukasReschke

@LukasReschke I've just tried the git one (ownCloud 8.0 pre alpha (git) == or v7.8.1.0), and the same test as in here https://github.com/owncloud/core/issues/12428#issuecomment-64485903

again I can see the same error "An exception occurred while executing 'UPDATE "oc_filecache" SET "size"=? WHERE "fileid" = ?' with params [3072, 8]: SQLSTATE[HY000]: General error: 5 database is locked"

so e9696a8c9a200a7078a07826141dc81b0a9dd919 commit doesn't resolve the pb :/

ghost avatar Nov 26 '14 12:11 ghost

Very strange since this works just fine for me locally. On which hardware is this running? Which PHP versions? Which SQLite version? etc...

LukasReschke avatar Nov 26 '14 12:11 LukasReschke

actually all files successfully uploaded and are accessible, even despite that error message.. Most likely because I didn't enable the encryption, thus it didn't result in a missing .shareKey file

I've got a KVM based VPS, with 256 RAM, Debian 7.7

PHP PHP 5.4.35-0+deb7u2 (cli) (built: Nov 19 2014 09:05:45)

sqlite3 3.7.13 2012-06-11 02:05:22 f5b5a13f7394dc143aa136f1d4faba6839eaa6dc

ghost avatar Nov 26 '14 12:11 ghost

humm, the problem seem doesn't happen when I switched /etc/php5/fpm/pool.d/owncloud.conf From

...
pm = ondemand
pm.max_children = 10
pm.start_servers = 1
...

To

...
pm = static
pm.max_children = 1
pm.start_servers = 1
...

UPD1 pm can still be ondemand, most important is to have the only 1 PHP FPM instance to workaround this problem... however the performance is lower with the only single PHP FPM instance ...

Probably each separate PHP FPM process doesn't check whether database is locked or not?

ghost avatar Nov 26 '14 13:11 ghost

Enabled encryption, got the same error message while uploading many small files with my original PHP FPM settings (pm = ondemand; pm.max_children = 10;) The good news is that now, even despite the error, I can access the data! (shareKey file was created for each file)

ghost avatar Nov 26 '14 13:11 ghost

It looks like this call does not exist in Doctrine. I wonder if it's possible to call busyTimeout() on whichever wrapped object Doctrine might be using for the SQLite connection (there is no such code there, I grepped it).

PVince81 avatar Jan 22 '15 17:01 PVince81

I struggled over the same nasty problem. Even as the files upload finally, there occure dependent errors in the sync clients. Plus some files are not accessible afterwards. I found files with size 0 on the clients. I also suspect that the locking-conflict produces other irregularities in the database, that are spreading like a virus. Some files are starting to throw permanent server errors. In cases I did not address this problem, the client got caught in a endless loop and finally crashed. The 0 Size files in the client are not the same as the files that can not be accessed on the Server.

ghost avatar Jan 24 '15 12:01 ghost

I have access to an environment where this error happens so I'll try and debug it.

I suspect that SQLite might be locking the DB as soon as a write operation happens, and only free the lock once the PHP request has finished. Not sure why the preview creation would want to write anything to the DB. I suspect it might be simply adding an entry for the thumbnail fail.

Needs further research. Assigning to self.

PVince81 avatar Jan 28 '15 17:01 PVince81

Sorry for spaming this to all sqlite issues these days - here is a long discussion about this issue on teh drupal project - https://www.drupal.org/node/1120020 .

DeepDiver1975 avatar Jan 29 '15 09:01 DeepDiver1975

From what I see here it seems to happen mostly when writing the thumbnail entries in oc_filecache, and that triggers an update of the parent folder's size in the file cache. Not sure whether this is really necessary when outside of "files/":

{
    "reqId":"6c2d000c4971b876c2dab876d5bc3718",
    "remoteAddr":"192.168.1.2",
    "app":"index",
    "message":"Exception: {\"Message\":\"An exception occurred while executing ' UPDATE \\"oc_filecache\\" SET \\"size\\"=? WHERE \\"fileid\\" = ?' with params [170672, 20]:SQLSTATE[HY000]: General error: 5 database is locked\",\"Code\":0,
\"Trace\":\"
    #0 /var/ocdata/vincent/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(116): Doctrine\\DBAL\\Driver\\AbstractSQLiteDriver->convertException('An exception oc...', Object(Doctrine\\DBAL\\Driver\\PDOException))
    #1 /var/ocdata/vincent/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(172): Doctrine\\DBAL\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\DBAL\\Driver\\PDOSqlite\\Driver), Object(Doctrine\\DBAL\\Driver\\PDOException), 'UPDATE \\"oc_file...', Array)
    #2 /var/ocdata/vincent/owncloud/lib/private/db/statementwrapper.php(63): Doctrine\\DBAL\\Statement->execute(Array)
    #3 /var/ocdata/vincent/owncloud/lib/private/db.php(141): OC_DB_StatementWrapper->execute(Array)
    #4 /var/ocdata/vincent/owncloud/lib/private/files/cache/cache.php(271): OC_DB::executeAudited('UPDATE `*PREFIX...', Array)
    #5 /var/ocdata/vincent/owncloud/lib/private/files/cache/cache.php(616): OC\\Files\\Cache\\Cache->update(20, Array)
    #6 /var/ocdata/vincent/owncloud/lib/private/files/cache/homecache.php(21): OC\\Files\\Cache\\Cache->calculateFolderSize('thumbnails', NULL)
    #7 /var/ocdata/vincent/owncloud/lib/private/files/cache/cache.php(569): OC\\Files\\Cache\\HomeCache->calculateFolderSize('thumbnails', NULL)
    #8 /var/ocdata/vincent/owncloud/lib/private/files/cache/cache.php(575): OC\\Files\\Cache\\Cache->correctFolderSize('thumbnails')
    #9 /var/ocdata/vincent/owncloud/lib/private/files/cache/cache.php(575): OC\\Files\\Cache\\Cache->correctFolderSize('thumbnails/575')
    #10 /var/ocdata/vincent/owncloud/lib/private/files/cache/updater.php(56): OC\\Files\\Cache\\Cache->correctFolderSize('thumbnails/575/...', Array)
    #11 /var/ocdata/vincent/owncloud/lib/private/files/view.php(810): OC\\Files\\Cache\\Updater->update('/thumbnails/575...')
    #12 /var/ocdata/vincent/owncloud/lib/private/files/view.php(422): OC\\Files\\View->basicOperation('file_put_conten...', 'thumbnails/575/...', Array, 'GIF89a$?$??????...')
    #13 /var/ocdata/vincent/owncloud/lib/private/preview.php(540): OC\\Files\\View->file_put_contents('thumbnails/575/...', 'GIF89a$?$??????...')
    #14 /var/ocdata/vincent/owncloud/lib/private/preview.php(565): OC\\Preview->getPreview()
    #15 /var/ocdata/vincent/owncloud/core/ajax/preview.php(44): OC\\Preview->showPreview()
    #16 /var/ocdata/vincent/owncloud/lib/private/route/route.php(135) : runtime-created function(1): require_once('/var/ocdata/vin...')
    #17 [internal function]: __lambda_func(Array)
    #18 /var/ocdata/vincent/owncloud/lib/private/route/router.php(250): call_user_func('?lambda_1490', Array)
    #19 /var/ocdata/vincent/owncloud/lib/base.php(763): OC\\Route\\Router->match('/core/preview.p...')
    #20 /var/ocdata/vincent/owncloud/index.php(28): OC::handleRequest()
    #21 {main}\",\"File\":\"/var/ocdata/vincent/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractSQLiteDriver.php\",\"Line\":84
}","level":4,"time":"2014-11-28T07:36:31+00:00"}

In general it looks like there are still too many DB queries done (independently from SQLite)

PVince81 avatar Jan 29 '15 09:01 PVince81

Potential fix here: https://github.com/owncloud/core/issues/13752

Seemed to make the exception disappear in our local env.

PVince81 avatar Jan 29 '15 10:01 PVince81

@arno01 @hanspeter-heeb are you able to test with the patch from https://github.com/owncloud/core/pull/13752 ?

PVince81 avatar Jan 29 '15 12:01 PVince81

Fixed with #13752

MorrisJobke avatar Jan 29 '15 13:01 MorrisJobke

@PVince81 , Question: «@hanspeter-heeb are you able to test with the patch from #13752 ?» Answer: My Administrator applied the patch. I uploaded files that did not upload correctly before from mac over web-interface while a windows 7, ownCloud 1.7.1 client was active. There was a minor, recoverable error that produced a 8 kB file stub on the server in two cases. The error in the log, due to my administrator, was: «no share key found». I uploaded files, not uploadable before, over the sinc-client (windows 1.7.1, windows 7 as mentioned before). No errors. So the tests returned 98% fine. And 2% recoverable errors. I asked my server-administrator to check the two files that produced error during the first batch-upload. The files did afterwards upload correctly with a single file upload.

ghost avatar Feb 02 '15 13:02 ghost