Federated sharing: create/change permissions in 9.1 cause an exception when upload #26173

Closed
jesmrec opened this Issue Sep 21, 2016 · 11 comments

Projects

None yet

2 participants

@jesmrec
jesmrec commented Sep 21, 2016 edited

Steps to reproduce

1.Share a folder with a user in a different server. Set the following permissions:

screen shot 2016-09-21 at 17 37 48

or

screen shot 2016-09-21 at 17 37 29

2.Login with the sharee and accept the share
3.Try to upload content to the shared folder

Expected behaviour

Create permission is granted, so that content is uploaded correctly

Actual behaviour

Error uploading file "FILE": Server error response [url] http://xxxx.xxxx.xxxx.xx:XXXX/public.php/webdav/FILE [status code] 500 [reason phrase] Internal Server Error

Server configuration

Shared from: {"installed":true,"maintenance":false,"version":"9.1.1.3","versionstring":"9.1.1","edition":"Enterprise"}
and
{"installed":true,"maintenance":false,"version":"9.1.0.15","versionstring":"9.1.0","edition":"Enterprise"}

Shared to:
{"installed":true,"maintenance":false,"version":"9.1.1.3","versionstring":"9.1.1","edition":"Enterprise"}
and also:
{"installed":true,"maintenance":false,"version":"8.2.8.0","versionstring":"8.2.8 RC1","edition":"Enterprise"}

Checked also with mobile clients, with the following webdav logs:

Exception: {"Message":"HTTP/1.1 500 Server error response [url] http://xxxx.xxx.xxxx.xx:XXXX/public.php/webdav/FILE [status code] 500 [reason phrase] Internal Server Error","Exception":"Sabre\DAV\Exception","Code":0,"Trace":"#0 /opt/owncloud/apps/dav/lib/Connector/Sabre/File.php(157): OCA\DAV\Connector\Sabre\File->convertToSabreException(Object(GuzzleHttp\Exception\ServerException))\n#1 /opt/owncloud/apps/dav/lib/Connector/Sabre/Directory.php(136): OCA\DAV\Connector\Sabre\File->put(Resource id #160)\n#2 /opt/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php(1036): OCA\DAV\Connector\Sabre\Directory->createFile('FILE', Resource id #160)\n#3 /opt/owncloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php(523): Sabre\DAV\Server->createFile('shared_folder/FILE', Resource id #160, NULL)\n#4 [internal function]: Sabre\DAV\CorePlugin->httpPut(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#5 /opt/owncloud/3rdparty/sabre/event/lib/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#6 /opt/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php(459): Sabre\Event\EventEmitter->emit('method:PUT', Array)\n#7 /opt/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php(248): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#8 /opt/owncloud/apps/dav/appinfo/v1/webdav.php(56): Sabre\DAV\Server->exec()\n#9 /opt/owncloud/remote.php(164): require_once('/opt/owncloud/a...')\n#10 {main}","File":"/opt/owncloud/apps/dav/lib/Connector/Sabre/File.php","Line":556,"User":"user1"}

LOGS in share from's server

{"reqId":"3aiD7qBGYspeld4CNMtW","remoteAddr":"xx.xx.xx.xx","app":"webdav","message":"Exception: {"Message":"HTTP\/1.1 500 Could not rename part file to final file","Exception":"Sabre\DAV\Exception","Code":0,"Trace":"#0 \/opt\/owncloud\/apps\/dav\/lib\/Connector\/Sabre\/Directory.php(136): OCA\DAV\Connector\Sabre\File->put(Resource id #187)\n#1 \/opt\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(1036): OCA\DAV\Connector\Sabre\Directory->createFile('FILE', Resource id #187)\n#2 \/opt\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php(523): Sabre\DAV\Server->createFile('FILE', Resource id #187, NULL)\n#3 [internal function]: Sabre\DAV\CorePlugin->httpPut(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#4 \/opt\/owncloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#5 \/opt\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(459): Sabre\Event\EventEmitter->emit('method:PUT', Array)\n#6 \/opt\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(248): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))\n#7 \/opt\/owncloud\/apps\/dav\/appinfo\/v1\/publicwebdav.php(87): Sabre\DAV\Server->exec()\n#8 \/opt\/owncloud\/public.php(74): require_once('\/opt\/owncloud\/a...')\n#9 {main}","File":"\/opt\/owncloud\/apps\/dav\/lib\/Connector\/Sabre\/File.php","Line":186,"User":false}","level":4,"time":"2016-09-21T16:22:14+00:00","method":"PUT","url":"/public.php/webdav/FILE","user":"--"}

@ghost
ghost commented Sep 21, 2016

HTTP/1.1 500 Server error response

The logfiles from the server giving the 500 / internal server error response might be also useful here.

@jesmrec
jesmrec commented Sep 21, 2016

@RealRancor

added now to the first message

@jesmrec
jesmrec commented Sep 22, 2016

Also happens in 9.1.0 -> regression

@jesmrec jesmrec added the regression label Sep 22, 2016
@PVince81 PVince81 added this to the 9.1.2 milestone Sep 22, 2016
@PVince81
Collaborator

@jesmrec you mean "didn't happen in 8.2.8 -> regression" ? A regression is when it worked before and now it stopped working.

@jesmrec
jesmrec commented Sep 22, 2016 edited

@in versions 8.2.x this feature was not available, so that "Can Edit" permission in federated shares does not have subpermissions. I checked it in 9.1.1 and after that in 9.1.0. Both the bug is reproduceable. I meant regression as not only in 9.1.1, also 9.1.0. So, never worked -> not regression. Sorry for the inconvenience.

@jesmrec jesmrec closed this Sep 22, 2016
@jesmrec jesmrec reopened this Sep 22, 2016
@jesmrec jesmrec closed this Sep 22, 2016
@jesmrec jesmrec reopened this Sep 22, 2016
@jesmrec jesmrec removed the regression label Sep 22, 2016
@jesmrec
jesmrec commented Sep 22, 2016 edited

(sorry for the closing - reopening, my touch pad got crazy)

@PVince81 PVince81 modified the milestone: 9.1.3, 9.1.2 Oct 20, 2016
@PVince81
Collaborator
PVince81 commented Nov 9, 2016

This PR is likely to fix this issue: #26561

Because uploading creates a part file and that part file needs to be renamed so need to bypass the permissions.

@PVince81
Collaborator
PVince81 commented Nov 9, 2016

Just tested and #26561 only fixes the case for "can create".

@PVince81 PVince81 referenced this issue Nov 9, 2016
Merged

Allow renaming part files on perm masked storage #26561

6 of 10 tasks complete
@PVince81
Collaborator
PVince81 commented Nov 9, 2016

PR updated, now fixes both cases: #26561

@jesmrec
jesmrec commented Nov 9, 2016 edited

Thanks @PVince81 👍

I have checked the scenario described in first message and works with the fix as expected.

@jesmrec
jesmrec commented Nov 11, 2016

Fix merged. Closing...

@jesmrec jesmrec closed this Nov 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment