You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Investigate/test parallel chunking "Internal Server Error" #2724
ii apache2 2.4.7-1ubuntu4 amd64 Apache HTTP Server
ii owncloud 7.0.4-3 all ownCloud Server - Private file sync and share server
what i do in order to get this error
i start the owncloud client 'master' (qt5 program on nixos)
it connects to the virtual machine (ubuntu 14.04 with 7.0.4-3 owncloud)
i paste a 160Mb linux image into ~/owncloud
the qt program starts the sync
the progress bar runs until it reaches 100%
then the server replies 'internal server error'
the upload is then repatet if i restart the client
the problem
with git bisect i isolated the problematic commit to this one:
commit 6a0c9fdd34c9058849a77307af7879fa238a085a
Author: Olivier Goffart <[email protected]>
Date: Wed Jan 14 11:20:09 2015 +0100
Propagate upload: Change the default chunk size to 5MiB and make chunk upload parallel
The server is slow to process each chunk. As a result the time between
the chunks is not neglectible. Therefore we gain a lot of time by
uploading the chunks in parallel. So the bandwitdh is used when the
server is waiting between chunks.
src/libsync/propagateupload.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
i was discussing this on irc with ogoffart already, he told me to test OWNCLOUD_PARALLEL_CHUNK=0 among other things.
After a bunch of successfully uploaded chunks, the server replies with 500:
01-22 00:29:07:569 0x156edd0 networkjobs.cpp:158 void OCC::AbstractNetworkJob::slotFinished() 299
"Error downloading https://owncloud.myhost/remote.php/webdav/archlinux-2010.05-netinstall-x86_64.iso-chunking-1658172428-34-29 -
server replied: Internal Server Error"
On the server:
{"reqId":"54c04453841f8","app":"remote",
"message":"An exception occurred while executing 'UPDATE \"oc_filecache\" SET \"size\"=? WHERE \"fileid\" = ?':\n\n
SQLSTATE[HY000]: General error: 5 database is locked",
"level":4,"time":"2015-01-22T00:29:07+00:00","method":"PUT",
"url":"\/remote.php\/webdav\/archlinux-2010.05-netinstall-x86_64.iso-chunking-1658172428-34-29"}
{"reqId":"54c04453841f8","app":"PHP",
"message":"Uncaught exception 'Exception' with message 'Session has been closed - no further changes to the session as allowed' in \/var\/www\/owncloud\/lib\/private\/session\/memory.php:80
Stack trace:
#0 \/var\/www\/owncloud\/lib\/private\/session\/memory.php(31): OC\\Session\\Memory->validateSession()
#1 \/var\/www\/owncloud\/lib\/private\/template.php(111): OC\\Session\\Memory->set('formfactor', 'default')
#2 \/var\/www\/owncloud\/lib\/private\/template.php(53): OC_Template::getFormFactorExtension()
#3 \/var\/www\/owncloud\/lib\/private\/template.php(256): OC_Template->__construct('', 'error', 'error')
#4 \/var\/www\/owncloud\/lib\/private\/template.php(290): OC_Template::printErrorPage('Session has bee...', '<pre>#0 \/var\/ww...')
#5 [internal function]: OC_Template::printExceptionErrorPage(Object(Exception))\n#6 {main}\n thrown at \/var\/www\/owncloud\/lib\/private\/session\/memory.php#80","level":3,"time":"2015-01-22T00:29:07+00:00","method":"PUT",
"url":"\/remote.php\/webdav\/archlinux-2010.05-netinstall-x86_64.iso-chunking-1658172428-34-29"}
changed the title [-](Placeholder) Investigate/test parallel chunking problem[/-][+](Placeholder) Investigate/test parallel chunking "Internal Server Error"[/+]on Jan 22, 2015
changed the title [-](Placeholder) Investigate/test parallel chunking "Internal Server Error"[/-][+]Investigate/test parallel chunking "Internal Server Error"[/+]on Jan 22, 2015
{"reqId":"54c04453841f8","app":"remote", "message":"An exception occurred while executing 'UPDATE "oc_filecache" SET "size"=? WHERE "fileid" = ?':\n\n SQLSTATE[HY000]: General error: 5 database is locked", "level":4,"time":"2015-01-22T00:29:07+00:00","method":"PUT", "url":"/remote.php/webdav/archlinux-2010.05-netinstall-x86_64.iso-chunking-1658172428-34-29"}
this is the wellknown limitation of sqlite - use mysql or postgres or oci - but not sqlite
We do not want to have special treatment for special databases, especially as this problem is not sqlite only. We'd rather need owncloud/core#10566 fixed.
With the current situation we have now, it should only enable parallel chunking in OC >= 8.0.
If the backport to OC 7 goes in later, then it would be OC >= 7.0.5 (not sure if it's good to rely on a minor version though)
Activity
qknight commentedon Jan 22, 2015
software i use:
what i do in order to get this error
the upload is then repatet if i restart the client
the problem
with git bisect i isolated the problematic commit to this one:
i was discussing this on irc with ogoffart already, he told me to test OWNCLOUD_PARALLEL_CHUNK=0 among other things.
the solution
when started with:
the problem does not occur. instead the owncloud.log shows this:
owncloud --logfile /tmp/log
owncloud.log
ckamm commentedon Jan 22, 2015
After a bunch of successfully uploaded chunks, the server replies with 500:
On the server:
guruz commentedon Jan 22, 2015
CC @PVince81 @DeepDiver1975 ... This is about parallel chunk upload.
ogoffart commentedon Jan 22, 2015
@DeepDiver1975 So does that mean we should not enable parallel chunk uploads? (see previous message)
[-](Placeholder) Investigate/test parallel chunking problem[/-][+](Placeholder) Investigate/test parallel chunking "Internal Server Error"[/+]guruz commentedon Jan 22, 2015
@PVince81 @DeepDiver1975 I don't really understand the server log.
Why would it write to the session again?
Why would SQL being locked be a problem? sqlite should have a busy-retry handler set? @qknight which DB do you use in the server?
There is also something about
Sabre\\DAV\\Exception\\BadRequestin the log[-](Placeholder) Investigate/test parallel chunking "Internal Server Error"[/-][+]Investigate/test parallel chunking "Internal Server Error"[/+]DeepDiver1975 commentedon Jan 22, 2015
this is the wellknown limitation of sqlite - use mysql or postgres or oci - but not sqlite
DeepDiver1975 commentedon Jan 22, 2015
honestly we shall disallow sync with sqlite on the server - parallel request execution can result in database locks
guruz commentedon Jan 22, 2015
@DeepDiver1975 Are you not doing something like
client/src/libsync/ownsql.cpp
Line 65 in b50475b
Also activateable via SQL.. https://www.sqlite.org/pragma.html#pragma_busy_timeout
1 remaining item
PVince81 commentedon Jan 22, 2015
Not really. But the WebDAV plugin could detect the sync client's headers (or user-agent?) and return some error code ?
guruz commentedon Jan 22, 2015
I see
somewhere in the old versions of ownCloud server.
Related: owncloud/core#10566 (comment)
dragotin commentedon Feb 5, 2015
We do not want to have special treatment for special databases, especially as this problem is not sqlite only. We'd rather need owncloud/core#10566 fixed.
PVince81 commentedon Feb 5, 2015
We should close cursor everywhere ideally, yes. But touching all the code at once means retesting everything. It should be fine to do so in 8.1.
I was hoping that the existing cursor fixes (which are in 8.0) were already good enough for parallel upload with sqlite.
ogoffart commentedon Feb 5, 2015
So then what do we do? When do we disable or enable chunk parallelism?
moscicki commentedon Feb 5, 2015
Hello,
Would it be possible to enable such (backwards incompatible) features only if the server replies that it supports it in the response to status.php?
This is very easy to implement and will keep everyone on the safe side.
kuba
On Feb 5, 2015, at 3:36 PM, Olivier Goffart [email protected] wrote:
ogoffart commentedon Feb 5, 2015
@moscicki that was the idea behind owncloud/core#13628
PVince81 commentedon Feb 5, 2015
With the current situation we have now, it should only enable parallel chunking in OC >= 8.0.
If the backport to OC 7 goes in later, then it would be OC >= 7.0.5 (not sure if it's good to rely on a minor version though)
ogoffart commentedon Feb 6, 2015
It would be interesting to do benchmak trying to upload a large file:
OWNCLOUD_CHUNK_SIZEenvironement variable (size in bytes) )OWNCLOUD_MAX_PARALLEL=1orOWNCLOUD_PARALLEL_CHUNK=0And see what the optimal parametters should be
luciamaestro commentedon Feb 9, 2015
It is still happening in oc 8 ("version":"8.0.0.7","versionstring":"8.0").
ogoffart commentedon Feb 9, 2015
@lmaestro: do you have the server logs showing the error?
luciamaestro commentedon Feb 9, 2015
Owncloud.log
This the logs from my console https://gist.github.com/lmaestro/d3a89814f7746a9a6299
dragotin commentedon Feb 23, 2015
@ogoffart as discussed, the decision on how much parallel requests we do was:
dragotin commentedon Feb 23, 2015
This was implemented by @ogoffart in 063271e