Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File wont synchronize, 500 Error "MOVE" happens instead #31832

Closed
FelixBehr opened this issue Jun 19, 2018 · 11 comments
Closed

File wont synchronize, 500 Error "MOVE" happens instead #31832

FelixBehr opened this issue Jun 19, 2018 · 11 comments

Comments

@FelixBehr
Copy link

FelixBehr commented Jun 19, 2018

Steps to reproduce

I honestly don't really know what the steps to reproduce are. It happens very randomly.

Expected behaviour

Every File should sync as usual

Actual behaviour

Some files are not synced. Instead owncloud Client on Mac and windows report a 500 "MOVE" Error

Server configuration

Operating system:
Linux Ubuntu 16.04

Web server:
Apache

Database:
Mysql
PHP version:
7.1
ownCloud version: (see ownCloud admin page)
10.0.0.8

Updated from an older ownCloud or fresh install:
fresh install

Where did you install ownCloud from:
download the production .tar.gz, uploaded to our server via ftp

Signing status (ownCloud 9.0 and above):

https://gist.github.com/FelixBehr/0fee24759cbb0e1b8619882234a9e6c7

https://gist.github.com/FelixBehr/676e4dcabeb3b00dff61ccdf25c26953

Are you using external storage, if yes which one: local/smb/sftp/...
no

Are you using encryption: yes/no
not sure

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
no

Client configuration

Browser:
using the latest native client on MacOS 10.12, MacOS 10.13 and Windows 7. All report the same problem

Operating system:
see above

Logs

ownCloud log (data/owncloud.log)

just posting the relevant data here

{"reqId":"fb9b0d51-70cc-4d63-a3f5-2700c65c8ef0","level":3,"time":"2018-06-19T12:12:03+00:00","remoteAddr":"24.134.1.113","user":"--","app":"PHP","method":"MOVE","url":"\/remote.php\/dav\/uploads\/Admin\/138404073\/.file","message":"ini_set(): A session is active. You cannot change the session module's ini settings at this time at \/homepages\/27\/d623187127\/htdocs\/cloud\/lib\/base.php#596"}
{"reqId":"fb9b0d51-70cc-4d63-a3f5-2700c65c8ef0","level":3,"time":"2018-06-19T12:12:03+00:00","remoteAddr":"24.134.1.113","user":"Admin","app":"PHP","method":"MOVE","url":"\/remote.php\/dav\/uploads\/Admin\/138404073\/.file","message":"Undefined index: permissions at \/homepages\/27\/d623187127\/htdocs\/cloud\/lib\/private\/Files\/FileInfo.php#209"}
{"reqId":"fb9b0d51-70cc-4d63-a3f5-2700c65c8ef0","level":3,"time":"2018-06-19T12:12:03+00:00","remoteAddr":"24.134.1.113","user":"Admin","app":"remote","method":"MOVE","url":"\/remote.php\/dav\/uploads\/Admin\/138404073\/.file","message":"Exception: {\"Exception\":\"Error\",\"Message\":\"Call to a member function getId() on null\",\"Code\":0,\"Trace\":\"
#0 \\\/homepages\\\/27\\\/d623187127\\\/htdocs\\\/cloud\\\/lib\\\/private\\\/Files\\\/FileInfo.php(210): OC\\\\Files\\\\FileInfo->isShared()\\n
#1 \\\/homepages\\\/27\\\/d623187127\\\/htdocs\\\/cloud\\\/lib\\\/private\\\/Files\\\/FileInfo.php(235): OC\\\\Files\\\\FileInfo->getPermissions()\\n
#2 \\\/homepages\\\/27\\\/d623187127\\\/htdocs\\\/cloud\\\/lib\\\/private\\\/Files\\\/FileInfo.php(249): OC\\\\Files\\\\FileInfo->checkPermissions(2)\\n
#3 \\\/homepages\\\/27\\\/d623187127\\\/htdocs\\\/cloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/File.php(116): OC\\\\Files\\\\FileInfo->isUpdateable()\\n
#4 \\\/homepages\\\/27\\\/d623187127\\\/htdocs\\\/cloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/Directory.php(172): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\File->put(Resource id #574)\\n
#5 \\\/homepages\\\/27\\\/d623187127\\\/htdocs\\\/cloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Tree.php(314): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Directory->createFile('immobilien-bild...', Resource id #574)\\n
#6 \\\/homepages\\\/27\\\/d623187127\\\/htdocs\\\/cloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Tree.php(130): Sabre\\\\DAV\\\\Tree->copyNode(Object(OCA\\\\DAV\\\\Upload\\\\FutureFile), Object(OCA\\\\DAV\\\\Connector\\\\Sabre\\\\Directory), 'immobilien-bild...')\\n
#7 \\\/homepages\\\/27\\\/d623187127\\\/htdocs\\\/cloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Tree.php(161): Sabre\\\\DAV\\\\Tree->copy('uploads\\\/Admin\\\/1...', 'files\\\/Admin\\\/01_...')\\n
#8 \\\/homepages\\\/27\\\/d623187127\\\/htdocs\\\/cloud\\\/apps\\\/dav\\\/lib\\\/Upload\\\/ChunkingPlugin.php(81): Sabre\\\\DAV\\\\Tree->move('uploads\\\/Admin\\\/1...', 'files\\\/Admin\\\/01_...')\\n
#9 \\\/homepages\\\/27\\\/d623187127\\\/htdocs\\\/cloud\\\/apps\\\/dav\\\/lib\\\/Upload\\\/ChunkingPlugin.php(60): OCA\\\\DAV\\\\Upload\\\\ChunkingPlugin->performMove('uploads\\\/Admin\\\/1...', 'files\\\/Admin\\\/01_...')\\n
#10 [internal function]: OCA\\\\DAV\\\\Upload\\\\ChunkingPlugin->beforeMove('uploads\\\/Admin\\\/1...', 'files\\\/Admin\\\/01_...')\\n
#11 \\\/homepages\\\/27\\\/d623187127\\\/htdocs\\\/cloud\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n
#12 \\\/homepages\\\/27\\\/d623187127\\\/htdocs\\\/cloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(633): Sabre\\\\Event\\\\EventEmitter->emit('beforeMove', Array)\\n
#13 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpMove(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n
#14 \\\/homepages\\\/27\\\/d623187127\\\/htdocs\\\/cloud\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n
#15 \\\/homepages\\\/27\\\/d623187127\\\/htdocs\\\/cloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:MOVE', Array)\\n
#16 \\\/homepages\\\/27\\\/d623187127\\\/htdocs\\\/cloud\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n
#17 \\\/homepages\\\/27\\\/d623187127\\\/htdocs\\\/cloud\\\/apps\\\/dav\\\/lib\\\/Server.php(278): Sabre\\\\DAV\\\\Server->exec()\\n
#18 \\\/homepages\\\/27\\\/d623187127\\\/htdocs\\\/cloud\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n
#19 \\\/homepages\\\/27\\\/d623187127\\\/htdocs\\\/cloud\\\/remote.php(165): require_once('\\\/homepages\\\/27\\\/d...')\\n
#20 {main}\",\"File\":\"\\\/homepages\\\/27\\\/d623187127\\\/htdocs\\\/cloud\\\/lib\\\/private\\\/Files\\\/FileInfo.php\",\"Line\":281}"}
@ownclouders
Copy link
Contributor

GitMate.io thinks the contributor most likely able to help you is @PVince81.

Possibly related issues are #26902 (error), #28840 (-Error-), #3325 (Problem to synchronize files), #29082 (a Error), and #481 (moving files).

@PVince81
Copy link
Contributor

From reading the exception it looks like the storage instance of the target location is null.
And then later it tries to read permissions from inside the FileInfo object but the $this->data seems to be empty.

For some reason an empty FileInfo was produced for the target location.

First thing to try: repair the file index with this command: https://doc.owncloud.org/server/10.0/admin_manual/configuration/server/occ_command.html#the-repair-option

@FelixBehr
Copy link
Author

@PVince81 is there any possibility to trigger the repair via an URL? Problem is that the owncloud installation is located on a shared hoster with no ssh remote.

@sagamusix
Copy link

sagamusix commented Nov 25, 2019

I seem to have run into the same issue on a current 10.3.1.1 server and 2.6.0 client.

{"reqId":"b199cf17-6921-497a-a670-4f042297d897","level":0,"time":"2019-11-25T18:36:23+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"johannes","app":"OC\\Authentication\\Token\\DefaultTokenProvider::updateToken","method":"MOVE","url":"\/owncloud/remote.php\/dav\/uploads\/johannes\/1545613843\/.file","message":"updating token 19930, last check is now 1574706491"}
{"reqId":"b199cf17-6921-497a-a670-4f042297d897","level":0,"time":"2019-11-25T18:36:23+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"johannes","app":"OC\\Authentication\\Token\\DefaultTokenProvider::getToken","method":"MOVE","url":"\/owncloud/remote.php\/dav\/uploads\/johannes\/1545613843\/.file","message":"token bb65171c026f70a838b172c1df28936d68483cdcde6b08b7bdf7e7bb5956944ccbb96566da1cf75e573a87aa1c39b48f073fe1a74e53bcf2929f97891317d3c1 does not exist"}
{"reqId":"b199cf17-6921-497a-a670-4f042297d897","level":3,"time":"2019-11-25T18:36:24+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"johannes","app":"PHP","method":"MOVE","url":"\/owncloud/remote.php\/dav\/uploads\/johannes\/1545613843\/.file","message":"Undefined index: permissions at \/var\/www\/owncloud\/lib\/private\/Files\/FileInfo.php#209"}
{"reqId":"b199cf17-6921-497a-a670-4f042297d897","level":4,"time":"2019-11-25T18:36:24+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"johannes","app":"webdav","method":"MOVE","url":"\/owncloud/remote.php\/dav\/uploads\/johannes\/1545613843\/.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 /var/www/owncloud/lib/private/Files/FileInfo.php(210): OC\Files\FileInfo->isShared()
#1 /var/www/owncloud/lib/private/Files/FileInfo.php(235): OC\Files\FileInfo->getPermissions()
#2 /var/www/owncloud/lib/private/Files/FileInfo.php(249): OC\Files\FileInfo->checkPermissions(2)
#3 /var/www/owncloud/apps/dav/lib/Connector/Sabre/File.php(139): OC\Files\FileInfo->isUpdateable()
#4 /var/www/owncloud/apps/dav/lib/Connector/Sabre/Directory.php(172): OCA\DAV\Connector\Sabre\File->put(Resource id #32)
#5 /var/www/owncloud/lib/composer/sabre/dav/lib/DAV/Tree.php(311): OCA\DAV\Connector\Sabre\Directory->createFile('OpenMPT.pdb', Resource id #32)
#6 /var/www/owncloud/lib/composer/sabre/dav/lib/DAV/Tree.php(135): Sabre\DAV\Tree->copyNode(Object(OCA\DAV\Upload\FutureFile), Object(OCA\DAV\Connector\Sabre\Directory), 'OpenMPT.pdb')
#7 /var/www/owncloud/apps/dav/lib/Tree.php(113): Sabre\DAV\Tree->copy('uploads/johanne...', 'files/johannes/...')
#8 /var/www/owncloud/lib/composer/sabre/dav/lib/DAV/Tree.php(167): OCA\DAV\Tree->copy('uploads/johanne...', 'files/johannes/...')
#9 /var/www/owncloud/apps/dav/lib/Upload/ChunkingPlugin.php(79): Sabre\DAV\Tree->move('uploads/johanne...', 'files/johannes/...')
#10 /var/www/owncloud/apps/dav/lib/Upload/ChunkingPlugin.php(58): OCA\DAV\Upload\ChunkingPlugin->performMove('uploads/johanne...', 'files/johannes/...')
#11 /var/www/owncloud/lib/composer/sabre/event/lib/WildcardEmitterTrait.php(96): OCA\DAV\Upload\ChunkingPlugin->beforeMove('uploads/johanne...', 'files/johannes/...')
#12 /var/www/owncloud/lib/composer/sabre/dav/lib/DAV/CorePlugin.php(632): Sabre\DAV\Server->emit('beforeMove', Array)
#13 /var/www/owncloud/lib/composer/sabre/event/lib/WildcardEmitterTrait.php(96): Sabre\DAV\CorePlugin->httpMove(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
#14 /var/www/owncloud/lib/composer/sabre/dav/lib/DAV/Server.php(464): Sabre\DAV\Server->emit('method:MOVE', Array)
#15 /var/www/owncloud/lib/composer/sabre/dav/lib/DAV/Server.php(241): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
#16 /var/www/owncloud/apps/dav/lib/Server.php(326): Sabre\DAV\Server->start()
#17 /var/www/owncloud/apps/dav/appinfo/v2/remote.php(31): OCA\DAV\Server->exec()
#18 /var/www/owncloud/remote.php(165): require_once('/var/www/ownclo...')
#19 {main}\",\"File\":\"/var/www/owncloud/lib/private/Files/FileInfo.php\",\"Line\":281}"}

I have this happening only with some specific files, and so far I can determine that

  1. one file was being rewritten by another application while it was uploading
  2. another file was a VeraCrypt container that was open and locked while it was tried to be uploaded

Not sure if that's the root cause or if it contributed. I have done a full scan with the --repair option since then but the files still fail to upload.

@fmkaiser
Copy link

Maybe this helps, though I suspect the issue could have different root causes.

We recently had the same issue on our servers:

  • ownCloud 10.2.1, PHP-FPM 7.2.24, Nginx 1.16.1
  • versioning enabled
  • different affected desktop client versions and operating systems, but no web clients
  • initial upload succeeds, subsequent uploads after file is changed on the client fail
Nov  5 10:15:12 web2 ownCloud[8584]: [remote][MOVE][/remote.php/dav/uploads/testuser/2915872046/.file]
Exception: {"Exception":"Error","Message":"Call to a member function getId() on null","Code":0,"Trace":"
#0 \/var\/www\/html\/owncloud\/lib\/private\/Files\/FileInfo.php(210): OC\\Files\\FileInfo->isShared()
#1 \/var\/www\/html\/owncloud\/lib\/private\/Files\/FileInfo.php(235): OC\\Files\\FileInfo->getPermissions()
#2 \/var\/www\/html\/owncloud\/lib\/private\/Files\/FileInfo.php(249): OC\\Files\\FileInfo->checkPermissions(2)
#3 \/var\/www\/html\/owncloud\/apps\/dav\/lib\/Connector\/Sabre\/File.php(139): OC\\Files\\FileInfo->isUpdateable()
#4 \/var\/www\/html\/owncloud\/apps\/dav\/lib\/Connector\/Sabre\/Directory.php(172): OCA\\DAV\\Connector\\Sabre\\File->put(Resource id #17)
#5 \/var\/www\/html\/owncloud\/lib\/composer\/sabre\/dav\/lib\/DAV\/Tree.php(316): OCA\\DAV\\Connector\\Sabre\\Directory->createFile('zotero.sqlite', Resource id #17)
#6 \/var\/www\/html\/owncloud\/lib\/composer\/sabre\/dav\/lib\/DAV\/Tree.php(130): Sabre\\DAV\\Tree->copyNode(Object(OCA\\DAV\\Upload\\FutureFile), Object(OCA\\DAV\\Connector\\Sabre\\Directory), 'zotero.sqlite')
#7 \/var\/www\/html\/owncloud\/lib\/composer\/sabre\/dav\/lib\/DAV\/Tree.php(161): Sabre\\DAV\\Tree->copy('uploads\/testuser\/291...', 'files\/testuser\/liter...')
#8 \/var\/www\/html\/owncloud\/apps\/dav\/lib\/Upload\/ChunkingPlugin.php(79): Sabre\\DAV\\Tree->move('uploads\/testuser\/291...', 'files\/testuser\/liter...')
#9 \/var\/www\/html\/owncloud\/apps\/dav\/lib\/Upload\/ChunkingPlugin.php(58): OCA\\DAV\\Upload\\ChunkingPlugin->performMove('uploads\/testuser\/291...', 'files\/testuser\/liter...')
#10 [internal function]: OCA\\DAV\\Upload\\ChunkingPlugin->beforeMove('uploads\/testuser\/291...', 'files\/testuser\/liter...')
#11 \/var\/www\/html\/owncloud\/lib\/composer\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)
#12 \/var\/www\/html\/owncloud\/lib\/composer\/sabre\/dav\/lib\/DAV\/CorePlugin.php(633): Sabre\\Event\\EventEmitter->emit('beforeMove', Array)
#13 [internal function]: Sabre\\DAV\\CorePlugin->httpMove(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))
#14 \/var\/www\/html\/owncloud\/lib\/composer\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)
#15 \/var\/www\/html\/owncloud\/lib\/composer\/sabre\/dav\/lib\/DAV\/Server.php(479): Sabre\\Event\\EventEmitter->emit('method:MOVE', Array)
#16 \/var\/www\/html\/owncloud\/lib\/composer\/sabre\/dav\/lib\/DAV\/Server.php(254): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))
#17 \/var\/www\/html\/owncloud\/apps\/dav\/lib\/Server.php(294): Sabre\\DAV\\Server->exec()
#18 \/var\/www\/html\/owncloud\/apps\/dav\/appinfo\/v2\/remote.php(31): OCA\\DAV\\Server->exec()
#19 \/var\/www\/html\/owncloud\/remote.php(165): require_once('\/var\/www\/html\/o...')
#20 {main}","File":"\/var\/www\/html\/owncloud\/lib\/private\/Files\/FileInfo.php","Line":281}

We were able to eventually trace it back to the CVE-2019-11043 mitigation described in https://nextcloud.com/blog/urgent-security-issue-in-nginx-php-fpm/, specifically

try_files $fastcgi_script_name =404

This lead to the following change of environment variables being passed to PHP/ownCloud:

var ok failing (with try_files)
PATH_INFO /remote.php/dav/uploads/test-fek/41929080/.file ""
DOCUMENT_URI /remote.php/dav/uploads/test-fek/41929080/.file remote.php

Rolling the change to the nginx configuration back fixed the issue for us.

@sagamusix
Copy link

While your solution didn't work for me (I was using a different configuration), I was still able to fix the problem thanks to it - I adjusted my configuration to be close to https://docs.nextcloud.com/server/17/admin_manual/installation/nginx.html and now those uploads do work again.

@ChristianJohn-Softwareentwicklung

sagamusix, can you please give me some more information about your changes. we have the same problem, but I use apache + owncloud,

@sagamusix
Copy link

Sorry, all the changes I made are specific to nginx, I cannot tell you what you would have to change for Apache.

@rokdd
Copy link

rokdd commented Sep 7, 2021

@sagamusix : But would be great also to know your changes for nginx. Because I have the same problem - and using nginx.

@sagamusix
Copy link

@rokdd any changes are made are specific to my configuration and not part of fixing the issue (e.g. I have ownCloud in a custom path so I had to customize that part of the config). If you have trouble adjusting the example configuration to your needs, I'm probably the wrong person to ask because I'm not an nginx expert.

@stale
Copy link

stale bot commented Sep 20, 2021

This issue has been automatically closed.

@stale stale bot closed this as completed Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants