500 Error by overriding an existing file which is >10MB
Steps to reproduce
- Create a folder(over Webinterface or desktop client) and upload a file whose size more than 10MB, for example an image file.
- Try to upload the same file and then you will get a pop up window showing two options.
- Choose option one: new file (not keep the existing file)
If the file for example 1MB is then it is not a problem, it works and replaced the existing file without error.
Expected behaviour
The existing file should be replaced with the new file.
Actual behaviour
It throws Call to a member function getId() on null
Server configuration
Ubuntu 20.04 Nginx PHP 7.3.44 OwnCloud 10.12.1
Here is the error output:
{
"reqId": "ea92d097-1e16-44a1-a8a7-386a3b31e75f",
"level": 4,
"time": "2023-07-11T10:48:54+00:00",
"remoteAddr": "xxxx,
"user": "Admin",
"app": "webdav",
"method": "MOVE",
"url": "\/remote.php\/dav\/uploads\/Admin\/2300811004\/.file",
"message": "Exception: Call to a member function getId() on null: {\"Exception\":\"Error\",\"Message\":\"Call to a member function getId() on null\",\"Code\":0,\"Trace\":\"#0 \\\/\\\/httpdocs\\\/lib\\\/private\\\/Files\\\/FileInfo.php(210): OC\\\\Files\\\\FileInfo->isShared()\\n#1 \\\/\\\/httpdocs\\\/lib\\\/private\\\/Files\\\/FileInfo.php(235): OC\\\\Files\\\\FileInfo->getPermissions()\\n#2 \\\/\\\/httpdocs\\\/lib\\\/private\\\/Files\\\/FileInfo.php(249): OC\\\\Files\\\\FileInfo->checkPermissions()\\n#3 \\\/\\\/httpdocs\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/File.php(141): OC\\\\Files\\\\FileInfo->isUpdateable()\\n#4 \\\/\\\/httpdocs\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/Directory.php(172): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\File->put()\\n#5 \\\/\\\/httpdocs\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Tree.php(307): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Directory->createFile()\\n#6 \\\/\\\/httpdocs\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Tree.php(133): Sabre\\\\DAV\\\\Tree->copyNode()\\n#7 \\\/\\\/httpdocs\\\/apps\\\/dav\\\/lib\\\/Tree.php(113): Sabre\\\\DAV\\\\Tree->copy()\\n#8 \\\/\\\/httpdocs\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Tree.php(163): OCA\\\\DAV\\\\Tree->copy()\\n#9 \\\/\\\/httpdocs\\\/apps\\\/dav\\\/lib\\\/Upload\\\/ChunkingPlugin.php(78): Sabre\\\\DAV\\\\Tree->move()\\n#10 \\\/\\\/httpdocs\\\/apps\\\/dav\\\/lib\\\/Upload\\\/ChunkingPlugin.php(57): OCA\\\\DAV\\\\Upload\\\\ChunkingPlugin->performMove()\\n#11 \\\/\\\/httpdocs\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/WildcardEmitterTrait.php(89): OCA\\\\DAV\\\\Upload\\\\ChunkingPlugin->beforeMove()\\n#12 \\\/\\\/httpdocs\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(603): Sabre\\\\DAV\\\\Server->emit()\\n#13 \\\/\\\/httpdocs\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/WildcardEmitterTrait.php(89): Sabre\\\\DAV\\\\CorePlugin->httpMove()\\n#14 \\\/\\\/httpdocs\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(472): Sabre\\\\DAV\\\\Server->emit()\\n#15 \\\/\\\/httpdocs\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(253): Sabre\\\\DAV\\\\Server->invokeMethod()\\n#16 \\\/\\\/httpdocs\\\/apps\\\/dav\\\/lib\\\/Server.php(348): Sabre\\\\DAV\\\\Server->start()\\n#17 \\\/\\\/httpdocs\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#18 \\\/\\\/httpdocs\\\/remote.php(165): require_once('\\\/var\\\/www\\\/vhosts...')\\n#19 {main}\",\"File\":\"\\\/\\\/httpdocs\\\/lib\\\/private\\\/Files\\\/FileInfo.php\",\"Line\":281}"
}
Any update to this ? I believe I have the same issue, I updated to 10.12.1 and now all updates I make to files locally fail to sync with the server.
Hi @czwama , Welcome to the club. I have been dealing with this issue since 1,5 months and still no solution. I have created ticket to central.owncloud.org: https://central.owncloud.org/t/500-error-by-overriding-an-existing-file-which-is-10mb/44650/8
I am using an Ubuntu server with Plesk installation. My problem is related with Plesk Server configuration. I have tested OwnCloud local and with Docker. This problem does not occur there.
That's why I have also created a ticket to Plesk: https://talk.plesk.com/threads/owncloud-overwriting-an-existing-file-whose-size-10mb.370883/
Plesk says the problem is related to OwnCloud and OwnCloud says it is related to Plesk.
It is really an annoying error. I have tried many things without luck.
We can maybe help each others.
Ah this is good info, I was hoping it was an owncloud issue that would be corrected in next release, but now it seems I need to look at other sources. I am running owncloud in lxc container on proxmox, using a template turnkey-owncloud, I will check with the provider of that template now, will keep you posted
Thanks @czwama , It would be great if you could find a solution and if this solution would give me a hint to my issue :)
Hello,
I have found the source of the problem. I am using Plesk. Plesk installs default Nginx and Apache together and uses Nginx as proxy. Nginx has problem to deal with chunked file as it is also commented on SabreDav source code:
lib/composer/sabre/dav/lib/DAV/Server.php
Line 243 - 248
When I uninstall Nginx through Plesk Admin panel then it uses only Apache and the error goes away.
I do not know to who from OwnCloud should I reach this issue?
It should be somehow documented on system requirements or in README.md that using Nginx as proxy will lead to this issue by overriding existing file which is bigger than 10MB.
Thanks to everybody who took time to show me a direction on this thread.
FYI @czwama
Thanks for the update, however I am not convinced this is the rootcause:
I looked up the sourcecode and the comments are as follows :
public function start()
{
try {
// If nginx (pre-1.2) is used as a proxy server, and SabreDAV as an
// origin, we must make sure we send back HTTP/1.0 if this was
// requested.
// This is mainly because nginx doesn't support Chunked Transfer
// Encoding, and this forces the webserver SabreDAV is running on,
// to buffer entire responses to calculate Content-Length.
$this->httpResponse->setHTTPVersion($this->httpRequest->getHTTPVersion());
It mentions an issue with nginx pre 1.2, I am using nginx version: openresty/1.21.4.2 as reverse proxy.
Owncloud itself runs under apache2.
I rebuilt a new lxc from scratch and still getting the same sync errors. It started after upgrade to 1.12.
I will need to do some debugging, but if I cannot find it, I will try to setup a docker container instead.
I will laso start looking into OCIS.
Cees
.
Van: phpweb @.> Verzonden: maandag 4 september 2023 11:54 Aan: owncloud/core @.> CC: czwama @.>; Mention @.> Onderwerp: Re: [owncloud/core] 500 Error by overriding an existing file which is >10MB (Issue #40869)
Hello,
I have found the source of the problem. I am using Plesk as I had mentioned earlier. Plesk installs default Nginx and Apache together and uses Nginx as proxy. Nginx has problem to deal with chunked file as it is also commented on SabreDav source code:
lib/composer/sabre/dav/lib/DAV/Server.php Line 243 - 248
When I uninstall Nginx through Plesk Admin panel then it uses only Apache and the error goes away.
I do not know to who from OwnCloud should I reach this issue?
It should be somehow documented on system requirements or in README.md that using Nginx as proxy will lead to this issue by overriding existing file which is bigger than 10MB.
Thanks to everybody who took time to show me a direction on this thread.
FYI @czwama https://github.com/czwama
— Reply to this email directly, view it on GitHub https://github.com/owncloud/core/issues/40869#issuecomment-1704965537 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACBRCS4PWSMOCTZF6623S2LXYWQMRANCNFSM6AAAAAA2F2EFRU . You are receiving this because you were mentioned. https://github.com/notifications/beacon/ACBRCS6ZQDPH3P45Q7YNPRLXYWQMRA5CNFSM6AAAAAA2F2EFRWWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTFT622C.gif Message ID: @.***>
Hi ,
After your update I started shifting focus to my nginx reverse proxy and found the issue there.
It seems something in the OC update caused bigger http requests, and npm started buffering them. Unfortunately my buffering file space had permission errors, after I fixed those the synchroinisation started flowing again.
Thanks for pointing me in the right direction !
Regards
Van: phpweb @.> Verzonden: maandag 4 september 2023 11:54 Aan: owncloud/core @.> CC: czwama @.>; Mention @.> Onderwerp: Re: [owncloud/core] 500 Error by overriding an existing file which is >10MB (Issue #40869)
Hello,
I have found the source of the problem. I am using Plesk as I had mentioned earlier. Plesk installs default Nginx and Apache together and uses Nginx as proxy. Nginx has problem to deal with chunked file as it is also commented on SabreDav source code:
lib/composer/sabre/dav/lib/DAV/Server.php Line 243 - 248
When I uninstall Nginx through Plesk Admin panel then it uses only Apache and the error goes away.
I do not know to who from OwnCloud should I reach this issue?
It should be somehow documented on system requirements or in README.md that using Nginx as proxy will lead to this issue by overriding existing file which is bigger than 10MB.
Thanks to everybody who took time to show me a direction on this thread.
FYI @czwama https://github.com/czwama
— Reply to this email directly, view it on GitHub https://github.com/owncloud/core/issues/40869#issuecomment-1704965537 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACBRCS4PWSMOCTZF6623S2LXYWQMRANCNFSM6AAAAAA2F2EFRU . You are receiving this because you were mentioned. https://github.com/notifications/beacon/ACBRCS6ZQDPH3P45Q7YNPRLXYWQMRA5CNFSM6AAAAAA2F2EFRWWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTFT622C.gif Message ID: @.*** @.***> >