owncloud / core

:cloud: ownCloud web server core (Files, DAV, etc.)
https://owncloud.com
GNU Affero General Public License v3.0
8.37k stars 2.06k forks source link

ownCloud 7.0.3 stable problems due to missing shareKey (sqlite3, SQLSTATE[HY000]: General error: 5 database is locked) #12428

Closed arno01 closed 9 years ago

arno01 commented 9 years ago

Hello devs,

I'm having an issue, when I've uploaded about 10 little files (<70 Kb) from Desktop via Web Interface to my ownCloud directory, I've noticed a yellow pop-up message in the web interface that shortly disappear, it was "An exception occurred while executing 'UPDATE "oc_filecache" SET "size"=? WHERE "fileid" = ?': SQLSTATE[HY000]: General error: 5 database is locked"

Then I've noticed that because of this error, one of uploaded files has been created without .shareKey file, which leads to the following problems: 1) at the Web Interface when I'm trying to open "info.txt" file it says "An error occurred! Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." and then I can't open anything until I refresh (F5) the page; 2) info.txt file doesn't sync... the ownCloud client says that it has been "302 Moved Temporarily" in Action tab, Activity.

Thus, I'd like to ask you, what would be the way: 1) to clean up the "info.txt" from the ownCloud, because I can't delete it via Web Interface; 2) if not to clean it up, but to somehow, regenerate the .shareKey file ? ( owncloud/data/arno/files_encryption/share-keys/code/vigenere/info.txt.arno.shareKey ) ; 3) what would be a workaround to avoid this problem in the future? I prefer not to switch from SQLite3 ...

Please feel free to ask me for more details to help you troubleshoot this problem.

extra notes

If I'm running

sqlite3 owncloud/data/owncloud.db .dump  |grep -i --color info.txt

I can see there

INSERT INTO "oc_filecache" VALUES(5197,1,'files/code/vigenere/info.txt','f92274ca7e1120fb69efefbdb06f6261',5180,'info.txt',11,10,1416931481,1416931481,0,'5474a89934a3a',27,0,0);
INSERT INTO "oc_filecache" VALUES(5200,1,'files_encryption/keyfiles/code/vigenere/info.txt.key','d065735452d7174fc83397d74f486b9b',5182,'info.txt.key',15,3,1416931481,1416931481,0,'5474a89983275',27,44,0);
INSERT INTO "oc_filecache" VALUES(5227,2,'arno/files/code/vigenere/info.txt','983302e47d55632835d7776f433215a5',5218,'info.txt',11,10,1416931481,1416931481,0,'5474a8daadbae',27,9652,0);
root@www:~# 

However I can't see .shareKey ... neither it was created as I described above.

I expect to see there "files_encryption/share-keys/code/vigenere/info.txt.arno.shareKey" and the file itself ..

arno01 commented 9 years ago

I'm able to repeat this error anytime.

Test case

1) generate 13 files of random data 1kb size arno@vaio ~/testdir $ for i in a b c d e f g h i j k l m; do tr -dc '[:alnum:]' < /dev/urandom |head -c 1024 > $i.txt; done

2) upload these 13 files via ownCloud's web interface by selecting them all and using drag & drop

Observations

A) while uploading, you will see a message pop-up in yellow "An exception occurred while executing 'UPDATE "oc_filecache" SET "size"=? WHERE "fileid" = ?': SQLSTATE[HY000]: General error: 5 database is locked" (please see attached images are below)

owncloud703error1 owncloud703error2

B) 5 files can't be accessed via web interface: c.txt, e.txt, g.txt, i.txt, k.txt

C) also these 5 files do not have a thumbnail generated for them

D) Error "An error occurred! Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." displayed only when trying to open the g.txt file. UPDATE This behavior differs for the g.txt file most likey because ownCloud managed to create the g.txt.key => /my/path/owncloud/data/arno/files_encryption/keyfiles/testdir/g.txt.key

E) all 13 files appeared at the /my/path/owncloud/data/arno/files/testdir/ path as expected size of each file is 9584 bytes

F) only 9 files appeared at the /my/path/owncloud/data/arno/files_encryption/keyfiles/testdir/ path 4 missing files: c.txt.key, e.txt.key, i.txt.key and the k.txt.key

G) only 8 files appeared at the /my/path/owncloud/data/arno/files_encryption/share-keys/testdir/ path 5 missing files: c.txt.arno.shareKey, e.txt.arno.shareKey, g.txt.arno.shareKey, i.txt.arno.shareKey and the k.txt.arno.shareKey size of each file is 512 bytes

H) modified files (checked right after I uploaded the 13 files as described above

/my/path/owncloud/data
/my/path/owncloud/data/owncloud.db
/my/path/owncloud/data/arno/files_encryption/share-keys
/my/path/owncloud/data/arno/files_encryption/share-keys/testdir
/my/path/owncloud/data/arno/files_encryption/share-keys/testdir/b.txt.arno.shareKey
/my/path/owncloud/data/arno/files_encryption/share-keys/testdir/j.txt.arno.shareKey
/my/path/owncloud/data/arno/files_encryption/share-keys/testdir/m.txt.arno.shareKey
/my/path/owncloud/data/arno/files_encryption/share-keys/testdir/a.txt.arno.shareKey
/my/path/owncloud/data/arno/files_encryption/share-keys/testdir/d.txt.arno.shareKey
/my/path/owncloud/data/arno/files_encryption/share-keys/testdir/h.txt.arno.shareKey
/my/path/owncloud/data/arno/files_encryption/share-keys/testdir/f.txt.arno.shareKey
/my/path/owncloud/data/arno/files_encryption/share-keys/testdir/l.txt.arno.shareKey
/my/path/owncloud/data/arno/files_encryption/keyfiles
/my/path/owncloud/data/arno/files_encryption/keyfiles/testdir
/my/path/owncloud/data/arno/files_encryption/keyfiles/testdir/h.txt.key
/my/path/owncloud/data/arno/files_encryption/keyfiles/testdir/g.txt.key
/my/path/owncloud/data/arno/files_encryption/keyfiles/testdir/j.txt.key
/my/path/owncloud/data/arno/files_encryption/keyfiles/testdir/d.txt.key
/my/path/owncloud/data/arno/files_encryption/keyfiles/testdir/a.txt.key
/my/path/owncloud/data/arno/files_encryption/keyfiles/testdir/l.txt.key
/my/path/owncloud/data/arno/files_encryption/keyfiles/testdir/m.txt.key
/my/path/owncloud/data/arno/files_encryption/keyfiles/testdir/f.txt.key
/my/path/owncloud/data/arno/files_encryption/keyfiles/testdir/b.txt.key
/my/path/owncloud/data/arno/files/testdir
/my/path/owncloud/data/arno/files/testdir/m.txt
/my/path/owncloud/data/arno/files/testdir/f.txt
/my/path/owncloud/data/arno/files/testdir/l.txt
/my/path/owncloud/data/arno/files/testdir/e.txt
/my/path/owncloud/data/arno/files/testdir/d.txt
/my/path/owncloud/data/arno/files/testdir/b.txt
/my/path/owncloud/data/arno/files/testdir/h.txt
/my/path/owncloud/data/arno/files/testdir/j.txt
/my/path/owncloud/data/arno/files/testdir/g.txt
/my/path/owncloud/data/arno/files/testdir/a.txt
/my/path/owncloud/data/arno/files/testdir/c.txt
/my/path/owncloud/data/arno/files/testdir/i.txt
/my/path/owncloud/data/arno/files/testdir/k.txt
/my/path/owncloud/data/arno/thumbnails
/my/path/owncloud/data/arno/thumbnails/5261
/my/path/owncloud/data/arno/thumbnails/5261/46-46.png
/my/path/owncloud/data/arno/thumbnails/5268
/my/path/owncloud/data/arno/thumbnails/5255
/my/path/owncloud/data/arno/thumbnails/5255/46-46.png
/my/path/owncloud/data/arno/thumbnails/5273
/my/path/owncloud/data/arno/thumbnails/5273/46-46.png
/my/path/owncloud/data/arno/thumbnails/5279
/my/path/owncloud/data/arno/thumbnails/5282
/my/path/owncloud/data/arno/thumbnails/5282/46-46.png
/my/path/owncloud/data/arno/thumbnails/5243
/my/path/owncloud/data/arno/thumbnails/5248
/my/path/owncloud/data/arno/thumbnails/5248/46-46.png
/my/path/owncloud/data/owncloud.log
/my/path/owncloud/config/config.php

more verbose information

root@www:~# grep -E "dbtype|version" /my/path/owncloud/config/config.php
  'dbtype' => 'sqlite3',
  'version' => '7.0.3.4',

root@www:~# sqlite3 /my/path/owncloud/data/owncloud.db .dump  |grep -i --color testdir
INSERT INTO "oc_activity" VALUES(2057,1416952417,40,'file_created','arno','arno','files','created_self','a:1:{i:0;s:8:"/testdir";}','','a:0:{}','/testdir','https://my.server.com/index.php/apps/files?dir=%2F');
INSERT INTO "oc_activity" VALUES(2058,1416953824,40,'file_created','arno','arno','files','created_self','a:1:{i:0;s:14:"/testdir/a.txt";}','','a:0:{}','/testdir/a.txt','https://my.server.com/index.php/apps/files?dir=%2Ftestdir');
INSERT INTO "oc_activity" VALUES(2059,1416953825,40,'file_created','arno','arno','files','created_self','a:1:{i:0;s:14:"/testdir/b.txt";}','','a:0:{}','/testdir/b.txt','https://my.server.com/index.php/apps/files?dir=%2Ftestdir');
INSERT INTO "oc_activity" VALUES(2060,1416953826,40,'file_created','arno','arno','files','created_self','a:1:{i:0;s:14:"/testdir/d.txt";}','','a:0:{}','/testdir/d.txt','https://my.server.com/index.php/apps/files?dir=%2Ftestdir');
INSERT INTO "oc_activity" VALUES(2061,1416953827,40,'file_created','arno','arno','files','created_self','a:1:{i:0;s:14:"/testdir/f.txt";}','','a:0:{}','/testdir/f.txt','https://my.server.com/index.php/apps/files?dir=%2Ftestdir');
INSERT INTO "oc_activity" VALUES(2062,1416953828,40,'file_created','arno','arno','files','created_self','a:1:{i:0;s:14:"/testdir/h.txt";}','','a:0:{}','/testdir/h.txt','https://my.server.com/index.php/apps/files?dir=%2Ftestdir');
INSERT INTO "oc_activity" VALUES(2063,1416953829,40,'file_created','arno','arno','files','created_self','a:1:{i:0;s:14:"/testdir/j.txt";}','','a:0:{}','/testdir/j.txt','https://my.server.com/index.php/apps/files?dir=%2Ftestdir');
INSERT INTO "oc_activity" VALUES(2064,1416953830,40,'file_created','arno','arno','files','created_self','a:1:{i:0;s:14:"/testdir/l.txt";}','','a:0:{}','/testdir/l.txt','https://my.server.com/index.php/apps/files?dir=%2Ftestdir');
INSERT INTO "oc_activity" VALUES(2065,1416953831,40,'file_created','arno','arno','files','created_self','a:1:{i:0;s:14:"/testdir/m.txt";}','','a:0:{}','/testdir/m.txt','https://my.server.com/index.php/apps/files?dir=%2Ftestdir');
INSERT INTO "oc_filecache" VALUES(5241,1,'files/testdir','a02c96afea6d850f30883ffeb9d76563',2,'testdir',2,1,1416953831,1416953830,0,'5474ffe765e19',31,115008,8192);
INSERT INTO "oc_filecache" VALUES(5242,2,'arno/files/testdir','46cbe25f01909c7d254e30b26521f626',16,'testdir',2,1,1416952417,1416952417,0,'5474fe64b482f',31,0,0);
INSERT INTO "oc_filecache" VALUES(5243,1,'files/testdir/a.txt','9a383962e7107af5e53d19d9eb42f66e',5241,'a.txt',11,10,1416953824,1416953824,1,'5474ffe041b01',27,9584,1024);
INSERT INTO "oc_filecache" VALUES(5244,1,'files_encryption/keyfiles/testdir','c60cede448e457f16ec62c411ac5741b',870,'testdir',2,1,1416953831,1416953831,0,'5474ffe744ef9',31,396,0);
INSERT INTO "oc_filecache" VALUES(5245,1,'files_encryption/keyfiles/testdir/a.txt.key','1afefd879490246447d722b719643857',5244,'a.txt.key',15,3,1416953824,1416953824,0,'5474ffe06a53c',27,44,0);
INSERT INTO "oc_filecache" VALUES(5246,1,'files_encryption/share-keys/testdir','dbeddcb8abb973cf3a0db4dcb1952aaa',873,'testdir',2,1,1416953831,1416953831,0,'5474ffe758a93',31,4096,0);
INSERT INTO "oc_filecache" VALUES(5247,1,'files_encryption/share-keys/testdir/a.txt.arno.shareKey','893307bb98ff9d05c53516834a5e4be4',5246,'a.txt.arno.shareKey',13,3,1416953824,1416953824,0,'5474ffe088775',27,512,0);
INSERT INTO "oc_filecache" VALUES(5248,1,'files/testdir/b.txt','e80bfc74fcf735df837b6e509f65238b',5241,'b.txt',11,10,1416953825,1416953825,1,'5474ffe11b5a5',27,9584,1024);
INSERT INTO "oc_filecache" VALUES(5249,1,'files_encryption/keyfiles/testdir/b.txt.key','2fedefa81299e1327c1a3ba3faff49d9',5244,'b.txt.key',15,3,1416953825,1416953825,0,'5474ffe133815',27,44,0);
INSERT INTO "oc_filecache" VALUES(5250,1,'files_encryption/share-keys/testdir/b.txt.arno.shareKey','15422c1095b77faab8b16d83ddd8f081',5246,'b.txt.arno.shareKey',13,3,1416953825,1416953825,0,'5474ffe14665d',27,512,0);
INSERT INTO "oc_filecache" VALUES(5251,1,'files/testdir/c.txt','afa3d58f39ab0e782e5d4e056e90f982',5241,'c.txt',11,10,1416953826,1416953826,0,'5474ffe204a4b',27,9584,0);
INSERT INTO "oc_filecache" VALUES(5255,1,'files/testdir/d.txt','94bed87d489c3f621801c4c786eacc3c',5241,'d.txt',11,10,1416953826,1416953826,1,'5474ffe2514ef',27,9584,1024);
INSERT INTO "oc_filecache" VALUES(5256,1,'files_encryption/keyfiles/testdir/d.txt.key','5fdbee9d43a51cbe6ab27aca22b7a0be',5244,'d.txt.key',15,3,1416953826,1416953826,0,'5474ffe26dc7b',27,44,0);
INSERT INTO "oc_filecache" VALUES(5257,1,'files_encryption/share-keys/testdir/d.txt.arno.shareKey','3b71952cb10237cabdc3e8295c425971',5246,'d.txt.arno.shareKey',13,3,1416953826,1416953826,0,'5474ffe27c855',27,512,0);
INSERT INTO "oc_filecache" VALUES(5258,1,'files/testdir/e.txt','c32fb88de6c40b8037b31448f272170e',5241,'e.txt',11,10,1416953827,1416953827,0,'5474ffe305f25',27,9584,0);
INSERT INTO "oc_filecache" VALUES(5261,1,'files/testdir/f.txt','935e44fa9685043d9a5db858f68d97a5',5241,'f.txt',11,10,1416953827,1416953827,1,'5474ffe3338b7',27,9584,1024);
INSERT INTO "oc_filecache" VALUES(5262,1,'files_encryption/keyfiles/testdir/f.txt.key','0595ab6ae83b47880956887d2dfae388',5244,'f.txt.key',15,3,1416953827,1416953827,0,'5474ffe351524',27,44,0);
INSERT INTO "oc_filecache" VALUES(5263,1,'files_encryption/share-keys/testdir/f.txt.arno.shareKey','3d7ad289202db7299aeff76dd16616c4',5246,'f.txt.arno.shareKey',13,3,1416953827,1416953827,0,'5474ffe3621fe',27,512,0);
INSERT INTO "oc_filecache" VALUES(5264,1,'files/testdir/g.txt','ccdb47827e69ea35f5d6648c7bc35da0',5241,'g.txt',11,10,1416953827,1416953827,0,'5474ffe3ceeed',27,0,0);
INSERT INTO "oc_filecache" VALUES(5266,1,'files_encryption/keyfiles/testdir/g.txt.key','5a96b6cf2a5c22cd925ad53ca1a2e670',5244,'g.txt.key',15,3,1416953827,1416953827,0,'5474ffe400706',27,44,0);
INSERT INTO "oc_filecache" VALUES(5268,1,'files/testdir/h.txt','320229db770a2fa7d7f319b78970ab9a',5241,'h.txt',11,10,1416953828,1416953828,1,'5474ffe44077a',27,9584,1024);
INSERT INTO "oc_filecache" VALUES(5269,1,'files_encryption/keyfiles/testdir/h.txt.key','5d2de6f7277f2e262c07ec473f343528',5244,'h.txt.key',15,3,1416953828,1416953828,0,'5474ffe458e52',27,44,0);
INSERT INTO "oc_filecache" VALUES(5270,1,'files_encryption/share-keys/testdir/h.txt.arno.shareKey','cdc8e1684a208097e1b7f775397eb6c6',5246,'h.txt.arno.shareKey',13,3,1416953828,1416953828,0,'5474ffe46a6b9',27,512,0);
INSERT INTO "oc_filecache" VALUES(5271,1,'files/testdir/i.txt','9fc84d9ecc538e5ffbe6108f500906c7',5241,'i.txt',11,10,1416953829,1416953829,0,'5474ffe509e38',27,9584,0);
INSERT INTO "oc_filecache" VALUES(5273,1,'files/testdir/j.txt','86598c6b9e4ff9304ea22172cfb69f01',5241,'j.txt',11,10,1416953829,1416953829,1,'5474ffe539967',27,9584,1024);
INSERT INTO "oc_filecache" VALUES(5274,1,'files_encryption/keyfiles/testdir/j.txt.key','af06ccae940135fba4bda6539022c413',5244,'j.txt.key',15,3,1416953829,1416953829,0,'5474ffe5536ac',27,44,0);
INSERT INTO "oc_filecache" VALUES(5275,1,'files_encryption/share-keys/testdir/j.txt.arno.shareKey','3f15ba2b72e4e66e6f1f0dd3b206844e',5246,'j.txt.arno.shareKey',13,3,1416953829,1416953829,0,'5474ffe566697',27,512,0);
INSERT INTO "oc_filecache" VALUES(5276,1,'files/testdir/k.txt','752c214cb6c90cfff3db92d8374815d6',5241,'k.txt',11,10,1416953830,1416953830,0,'5474ffe611f37',27,9584,0);
INSERT INTO "oc_filecache" VALUES(5279,1,'files/testdir/l.txt','f390d202befac2bd5a1ba0c355f4cdf0',5241,'l.txt',11,10,1416953830,1416953830,1,'5474ffe649187',27,9584,1024);
INSERT INTO "oc_filecache" VALUES(5280,1,'files_encryption/keyfiles/testdir/l.txt.key','8f109267328a00c5484e22ad5986df67',5244,'l.txt.key',15,3,1416953830,1416953830,0,'5474ffe665a4e',27,44,0);
INSERT INTO "oc_filecache" VALUES(5281,1,'files_encryption/share-keys/testdir/l.txt.arno.shareKey','4313b0dc25cfed376bfb86570311ff24',5246,'l.txt.arno.shareKey',13,3,1416953830,1416953830,0,'5474ffe679a9d',27,512,0);
INSERT INTO "oc_filecache" VALUES(5282,1,'files/testdir/m.txt','f2842cbfbe86c8eaac5639e0464bb334',5241,'m.txt',11,10,1416953831,1416953831,1,'5474ffe7268a0',27,9584,1024);
INSERT INTO "oc_filecache" VALUES(5284,1,'files_encryption/keyfiles/testdir/m.txt.key','da745ea4da1214c5791a70a15274046d',5244,'m.txt.key',15,3,1416953831,1416953831,0,'5474ffe7368e6',27,44,0);
INSERT INTO "oc_filecache" VALUES(5285,1,'files_encryption/share-keys/testdir/m.txt.arno.shareKey','2a59cd85ac8db23bce3170aa07c47041',5246,'m.txt.arno.shareKey',13,3,1416953831,1416953831,0,'5474ffe746474',27,512,0);
INSERT INTO "oc_jobs" VALUES(3,'OC\BackgroundJob\Legacy\QueuedJob','{"app":"search_lucene","klass":"OCA\\Search_Lucene\\Hooks","method":"doIndexFile","parameters":"{\"path\":\"\\\/testdir\\\/a.txt\",\"user\":\"arno\"}"}',0);
INSERT INTO "oc_jobs" VALUES(4,'OC\BackgroundJob\Legacy\QueuedJob','{"app":"search_lucene","klass":"OCA\\Search_Lucene\\Hooks","method":"doIndexFile","parameters":"{\"path\":\"\\\/testdir\\\/b.txt\",\"user\":\"arno\"}"}',0);
INSERT INTO "oc_jobs" VALUES(5,'OC\BackgroundJob\Legacy\QueuedJob','{"app":"search_lucene","klass":"OCA\\Search_Lucene\\Hooks","method":"doIndexFile","parameters":"{\"path\":\"\\\/testdir\\\/d.txt\",\"user\":\"arno\"}"}',0);
INSERT INTO "oc_jobs" VALUES(6,'OC\BackgroundJob\Legacy\QueuedJob','{"app":"search_lucene","klass":"OCA\\Search_Lucene\\Hooks","method":"doIndexFile","parameters":"{\"path\":\"\\\/testdir\\\/f.txt\",\"user\":\"arno\"}"}',0);
INSERT INTO "oc_jobs" VALUES(7,'OC\BackgroundJob\Legacy\QueuedJob','{"app":"search_lucene","klass":"OCA\\Search_Lucene\\Hooks","method":"doIndexFile","parameters":"{\"path\":\"\\\/testdir\\\/h.txt\",\"user\":\"arno\"}"}',0);
INSERT INTO "oc_jobs" VALUES(8,'OC\BackgroundJob\Legacy\QueuedJob','{"app":"search_lucene","klass":"OCA\\Search_Lucene\\Hooks","method":"doIndexFile","parameters":"{\"path\":\"\\\/testdir\\\/j.txt\",\"user\":\"arno\"}"}',0);
INSERT INTO "oc_jobs" VALUES(9,'OC\BackgroundJob\Legacy\QueuedJob','{"app":"search_lucene","klass":"OCA\\Search_Lucene\\Hooks","method":"doIndexFile","parameters":"{\"path\":\"\\\/testdir\\\/l.txt\",\"user\":\"arno\"}"}',0);
INSERT INTO "oc_jobs" VALUES(10,'OC\BackgroundJob\Legacy\QueuedJob','{"app":"search_lucene","klass":"OCA\\Search_Lucene\\Hooks","method":"doIndexFile","parameters":"{\"path\":\"\\\/testdir\\\/m.txt\",\"user\":\"arno\"}"}',0);
root@www:~# 

root@www:~# cat /my/path/owncloud/data/owncloud.log |grep '2014-11-25T22:17'
{"reqId":"5474ffe1a0427","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'thumbnails\/5243' is not readable !!!","level":0,"time":"2014-11-25T22:17:05+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fa.txt&c=5474ffe041b01&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe1a0427","app":"core","message":"Generating preview for \"\/testdir\/a.txt\" with \"OC\\Preview\\TXT\"","level":0,"time":"2014-11-25T22:17:05+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fa.txt&c=5474ffe041b01&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe1f2c55","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'thumbnails\/5248' is not readable !!!","level":0,"time":"2014-11-25T22:17:05+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fb.txt&c=5474ffe11b5a5&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe1f2c55","app":"core","message":"Generating preview for \"\/testdir\/b.txt\" with \"OC\\Preview\\TXT\"","level":0,"time":"2014-11-25T22:17:05+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fb.txt&c=5474ffe11b5a5&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe1a0427","app":"core","message":"OC_Image->fixOrientation() No readable file path set.","level":0,"time":"2014-11-25T22:17:06+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fa.txt&c=5474ffe041b01&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe1a0427","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T22:17:06+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fa.txt&c=5474ffe041b01&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe1a0427","app":"core","message":"An exception occurred while executing 'UPDATE \"oc_filecache\" SET \"unencrypted_size\"=? WHERE \"fileid\" = ?':\n\nSQLSTATE[HY000]: General error: 5 database is locked","level":0,"time":"2014-11-25T22:17:06+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fa.txt&c=5474ffe041b01&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe1f2c55","app":"core","message":"OC_Image->fixOrientation() No readable file path set.","level":0,"time":"2014-11-25T22:17:06+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fb.txt&c=5474ffe11b5a5&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe1f2c55","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T22:17:06+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fb.txt&c=5474ffe11b5a5&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe2ccac3","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'thumbnails\/5255' is not readable !!!","level":0,"time":"2014-11-25T22:17:06+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fd.txt&c=5474ffe2514ef&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe2ccac3","app":"core","message":"Generating preview for \"\/testdir\/d.txt\" with \"OC\\Preview\\TXT\"","level":0,"time":"2014-11-25T22:17:06+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fd.txt&c=5474ffe2514ef&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe2ccac3","app":"core","message":"OC_Image->fixOrientation() No readable file path set.","level":0,"time":"2014-11-25T22:17:07+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fd.txt&c=5474ffe2514ef&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe2ccac3","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T22:17:07+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fd.txt&c=5474ffe2514ef&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe3bb66f","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'thumbnails\/5261' is not readable !!!","level":0,"time":"2014-11-25T22:17:07+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Ff.txt&c=5474ffe3338b7&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe3bb66f","app":"core","message":"Generating preview for \"\/testdir\/f.txt\" with \"OC\\Preview\\TXT\"","level":0,"time":"2014-11-25T22:17:07+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Ff.txt&c=5474ffe3338b7&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe3bb66f","app":"core","message":"OC_Image->fixOrientation() No readable file path set.","level":0,"time":"2014-11-25T22:17:07+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Ff.txt&c=5474ffe3338b7&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe3bb66f","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T22:17:07+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Ff.txt&c=5474ffe3338b7&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe3bb66f","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-25T22:17:08+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Ff.txt&c=5474ffe3338b7&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe4c52b6","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'thumbnails\/5268' is not readable !!!","level":0,"time":"2014-11-25T22:17:08+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fh.txt&c=5474ffe44077a&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe4c52b6","app":"core","message":"Generating preview for \"\/testdir\/h.txt\" with \"OC\\Preview\\TXT\"","level":0,"time":"2014-11-25T22:17:08+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fh.txt&c=5474ffe44077a&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe4c52b6","app":"core","message":"OC_Image->fixOrientation() No readable file path set.","level":0,"time":"2014-11-25T22:17:08+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fh.txt&c=5474ffe44077a&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe4c52b6","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T22:17:08+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fh.txt&c=5474ffe44077a&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe4c52b6","app":"core","message":"An exception occurred while executing 'UPDATE \"oc_filecache\" SET \"unencrypted_size\"=? WHERE \"fileid\" = ?':\n\nSQLSTATE[HY000]: General error: 5 database is locked","level":0,"time":"2014-11-25T22:17:09+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fh.txt&c=5474ffe44077a&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe5c52be","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'thumbnails\/5273' is not readable !!!","level":0,"time":"2014-11-25T22:17:09+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fj.txt&c=5474ffe539967&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe5c52be","app":"core","message":"Generating preview for \"\/testdir\/j.txt\" with \"OC\\Preview\\TXT\"","level":0,"time":"2014-11-25T22:17:09+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fj.txt&c=5474ffe539967&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe5c52be","app":"core","message":"OC_Image->fixOrientation() No readable file path set.","level":0,"time":"2014-11-25T22:17:09+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fj.txt&c=5474ffe539967&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe5c52be","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T22:17:09+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fj.txt&c=5474ffe539967&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe6e2a02","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'thumbnails\/5279' is not readable !!!","level":0,"time":"2014-11-25T22:17:10+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fl.txt&c=5474ffe649187&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe6e2a02","app":"core","message":"Generating preview for \"\/testdir\/l.txt\" with \"OC\\Preview\\TXT\"","level":0,"time":"2014-11-25T22:17:10+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fl.txt&c=5474ffe649187&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe6e2a02","app":"core","message":"OC_Image->fixOrientation() No readable file path set.","level":0,"time":"2014-11-25T22:17:11+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fl.txt&c=5474ffe649187&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe6e2a02","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T22:17:11+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fl.txt&c=5474ffe649187&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe6e2a02","app":"core","message":"An exception occurred while executing 'UPDATE \"oc_filecache\" SET \"unencrypted_size\"=? WHERE \"fileid\" = ?':\n\nSQLSTATE[HY000]: General error: 5 database is locked","level":0,"time":"2014-11-25T22:17:11+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fl.txt&c=5474ffe649187&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe795577","app":"OC\\Files\\Cache\\Scanner","message":"!!! Path 'thumbnails\/5282' is not readable !!!","level":0,"time":"2014-11-25T22:17:11+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fm.txt&c=5474ffe7268a0&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe795577","app":"core","message":"Generating preview for \"\/testdir\/m.txt\" with \"OC\\Preview\\TXT\"","level":0,"time":"2014-11-25T22:17:11+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fm.txt&c=5474ffe7268a0&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe795577","app":"core","message":"OC_Image->fixOrientation() No readable file path set.","level":0,"time":"2014-11-25T22:17:11+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fm.txt&c=5474ffe7268a0&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474ffe795577","app":"core","message":"OC_Image->fixOrientation() Orientation: -1","level":0,"time":"2014-11-25T22:17:11+00:00","method":"GET","url":"\/index.php\/core\/preview.png?file=%2Ftestdir%2Fm.txt&c=5474ffe7268a0&x=46.956523418426514&y=46.956523418426514&forceIcon=0"}
{"reqId":"5474fff9d3f07","app":"remote","message":"Encryption key not found for \"\/arno\/files\/testdir\/c.txt\" during attempted read via stream","level":4,"time":"2014-11-25T22:17:29+00:00","method":"GET","url":"\/remote.php\/webdav\/testdir\/c.txt"}
{"reqId":"5474fff9d3f07","app":"PHP","message":"Session has been closed - no further changes to the session as allowed at \/usr\/local\/srv\/my.server.com\/owncloud\/lib\/private\/session\/memory.php#80","level":3,"time":"2014-11-25T22:17:29+00:00","method":"GET","url":"\/remote.php\/webdav\/testdir\/c.txt"}
{"reqId":"5474fffa907f9","app":"remote","message":"Encryption key not found for \"\/arno\/files\/testdir\/e.txt\" during attempted read via stream","level":4,"time":"2014-11-25T22:17:30+00:00","method":"GET","url":"\/remote.php\/webdav\/testdir\/e.txt"}
{"reqId":"5474fffa907f9","app":"PHP","message":"Session has been closed - no further changes to the session as allowed at \/usr\/local\/srv\/my.server.com\/owncloud\/lib\/private\/session\/memory.php#80","level":3,"time":"2014-11-25T22:17:30+00:00","method":"GET","url":"\/remote.php\/webdav\/testdir\/e.txt"}
{"reqId":"5474fffbf1ff3","app":"remote","message":"Encryption key not found for \"\/arno\/files\/testdir\/i.txt\" during attempted read via stream","level":4,"time":"2014-11-25T22:17:31+00:00","method":"GET","url":"\/remote.php\/webdav\/testdir\/i.txt"}
{"reqId":"5474fffbf1ff3","app":"PHP","message":"Session has been closed - no further changes to the session as allowed at \/usr\/local\/srv\/my.server.com\/owncloud\/lib\/private\/session\/memory.php#80","level":3,"time":"2014-11-25T22:17:31+00:00","method":"GET","url":"\/remote.php\/webdav\/testdir\/i.txt"}
{"reqId":"5474fffca7b39","app":"remote","message":"Encryption key not found for \"\/arno\/files\/testdir\/k.txt\" during attempted read via stream","level":4,"time":"2014-11-25T22:17:32+00:00","method":"GET","url":"\/remote.php\/webdav\/testdir\/k.txt"}
{"reqId":"5474fffca7b39","app":"PHP","message":"Session has been closed - no further changes to the session as allowed at \/usr\/local\/srv\/my.server.com\/owncloud\/lib\/private\/session\/memory.php#80","level":3,"time":"2014-11-25T22:17:32+00:00","method":"GET","url":"\/remote.php\/webdav\/testdir\/k.txt"}
root@www:~# 
arno01 commented 9 years ago

might be a good idea to keep an eye at this post, once this sqlite3 pb is resolved http://forum.owncloud.org/viewtopic.php?f=29&t=24219 (not sure if it's the same problem, but the user described a missing sharedKey file, having SQLite DB and a little older ownCloud v7.0.2)

arno01 commented 9 years ago

Meanwhile, until this bug is resolved, what would be a good way to clean-up those files which were created without the .shareKey file and thus inaccessible (=> impossible to remove them via web interface)?

Would it be enough to remove, for example for the e.txt file following: 1) delete /my/path/owncloud/data/arno/files/testdir/e.txt 2) remove records with "e.txt" from the /my/path/owncloud/data/owncloud.db

INSERT INTO "oc_filecache" VALUES(5258,1,'files/testdir/e.txt','c32fb88de6c40b8037b31448f272170e',5241,'e.txt',11,10,1416953827,1416953827,0,'5474ffe305f25',27,9584,0);

Shouldn't it bring any inconsistency/corrupt the DB ? I think that it would be also a good idea to stop the ownCloud client, remove local "ownCloud/.csync_journal.db" file, start the ownCloud..

UPDATE Probably the most easiest way is to move all "good" data out of the directory and then it was possible to recursively remove the directory with remaining "bad" data over web interface without a problem. At least this worked for me.

A quick check for the other SQLite users would be:

root@www:~# grep 'database is locked' /path/to/your/owncloud/data/owncloud.log
karlitschek commented 9 years ago

@schiesbn

arno01 commented 9 years ago

One of the possible solutions to the "General error: 5 database is locked" -> http://php.net/manual/en/ref.pdo-sqlite.php#115031

PVince81 commented 9 years ago

Please try if this https://github.com/owncloud/core/pull/13752 fixes for you

arno01 commented 9 years ago

@PVince81 probably good news, because I simply cannot simulate this error anymore. I mean without even applying #13752 .. maybe there was something in ownCloud v7.0.4 that fixed this issue? Or, another point is that I've migrated my servers from Debian 7.7 to NixOS 14.12; Not sure whether it could change something, but my nginx & php-fpm configs are quite same. Anyway, it's quite hard to tell what did really solve this issue. If someone can simulate the environment with Debian 7.7 and ownCloud 7.0.3, repeat this error, then upgrade to ownCloud 7.0.4 to see whether the problem still persists, and if yes, then go for #13752 ...

Please also find below version of sqlite & php in NixOS 14.12 currently:

SQLite version 3.8.7.1 2014-10-29 13:59:56
PHP 5.4.35 (cli) (built: Jan 01 1970 00:00:01)
PHP 5.4.35 (fpm-fcgi) (built: Jan 01 1970 00:00:01)
PVince81 commented 9 years ago

@arno01 you might probably just be lucky. That error is usually caused by concurrent requests and might depend on the speed of your server.

Anyway, that patch will be in 7.0.5 so once you'll upgrade you should be fine, too.

I'll close this ticket then. Thanks for the feedback :smile: