500 Error by overriding an existing file which is >10MB

Steps to reproduce

  1. Create a folder(over Webinterface or desktop client) and upload a file whose size more than 10MB, for example an image file.
  2. Try to upload the same file and then you will get a pop up window showing two options.
  3. 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}"
}

Where do you see this? Web UI or desktop sync client?

1 Like

I see in both Web UI and desktop sync client.
I am using Plesk installation in my server package. When I use OwnCloud Docker then I do not see this error. I think OwnCloud names chunked files as 113231.file (with .file extension) and somehow those files are not allowed with apache or nginx.

I dont know how to allow those .file extension on the server. Any Idea?

I moved the post to the Server category because I don’t think it can be solved in the desktop client alone.

1 Like

@Mesut I have a question about the step 2, I can see in the webUI the question from rewrite, but how are you doing in the desktop client?, if you replace the file will be removed and created again.

1 Like

I never saw files named *.file in the uploads folder of a user. Normally it should look like this (captured with a 17MB upload, almost complete):

# du -ah uploads/
6.3M	uploads/web-file-upload-ef914a51e4d5c433539d722b1820d857-1690900777422/10485760
10M	uploads/web-file-upload-ef914a51e4d5c433539d722b1820d857-1690900777422/0

I cannot reproduce this issue. Overwriting large files works fine here.

That was a bare metal installation. Not sure why docker or plesk (what is that?) would differ in these internal names.

1 Like

Thanks for your interest @jnweiger

I think it removes the *.file extension part files if the upload successful.

Here is an error output shows *.file extension in my case:

"user":"admin","app":"webdav","method":"MOVE","url":"\/remote.php\/dav\/uploads\/admin\/web-file-upload-4a5fe4ba03874559e005a3a2c6e0302f-1690903784472\/.file","message":"Exception: Call to a member function getId() on null:

Plesk is a server administration tool. For example you can configure the domains, subdomains, PHP, nginx and apache settings through a web ui.

If I configure the server without Plesk then OwnCloud works properly by overriding large files without error.

I have also opened a ticket to Plesk forum and no solution yet:

They say that I have to open a ticket in central.owncloud.org :slight_smile:

Es ist echt seltsam.

Thanks @cdamken ,
in desktop client I just override on local machine and I say replace the existing file and then I get the same error during desktop client syncs like I get through web ui:

Probleme       ,Datei                                                           ,Ordner                        ,Größe ,Benutzerkonto       ,Zeit                ,Status              ,
Der Server hat "500 Internal Server Error" auf "MOVE https://cloud-geli.de/remote.php/dav/uploads/XXXX/2491902491/.file" geantwortet (Call to a member function getId() on null),

Hey,

i think there could be some wrong / insufficient configuration from Plesk side in place which prevents overwriting this file. From my knowledge such environments are always a little bit problematic as they often have non-standard configuration for the web server or PHP.

Maybe the following documentation from the ownCloud people could help:

If not then i think maybe the support forum of Plesk could give additional guidance?

1 Like

Hi,
thanks for your kind interest.
You are right, some Plesk config create this problem.
I have tried the suggestions on those links, Big File Upload and some other stuff.
I have also created ticket in support forum of Plesk and they say it can be a OwnCloud problem.
I will try to search for a solution on Plesk side.

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.

2 Likes

Hey,

i’m also using Nginx as a reverse proxy and never faced any issue like this. I still think that this could be something Plesk specific related to the configuration within it (my Nginx is running on a bare Debian installation) and not ownCloud specific so i’m not sure if the ownCloud community is much of a help :-/

Addition:

After my posting i found 500 Error by overriding an existing file which is >10MB · Issue #40869 · owncloud/core · GitHub and a comment within it seems to indeed points towards environmental issues on the underlying operating system:

Unfortunately my buffering file space had permission errors, after I fixed those the synchroinisation started flowing again.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.