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

Setting permissions to 16 (OCS_PERMISSIONS_SHARE) causes a sync error #2779

Closed
jnfrmarks opened this issue Feb 4, 2015 · 7 comments
Closed
Labels
ReadyToTest QA, please validate the fix/enhancement Server Involved

Comments

@jnfrmarks
Copy link

(Starting with client - not sure if this is ultimately a server issue. I have log files for each step and will email them to @danimo )

Steps to reproduce

  1. Install owncloud
  2. create user1 and user2
  3. Install owncloud client on a different system
  4. Create a local .txt file, edit it to put in some content, and sync the file to the server

/usr/bin/owncloudcmd --trust /jrm/smashbox/results/test_shareFile/sharer/ owncloud://user1:@x.x.x.x/owncloud/remote.php/webdav/

  1. run a curl command to share the file with user 2, with only share permissions (I do not get this error when using "ALL" permissions)

curl -u : --data "path=somefile.txt&shareType=0&shareWith=user2&permissions=16" http://:@x.x.x.x/owncloud/ocs/v1.php/apps/files_sharing/api/v1/shares

  1. user 2 Syncs

/usr/bin/owncloudcmd --trust /root/jrm/smashbox/results/test_shareFile/shareeOne/ owncloud://user2:@x.x.x.x/owncloud/remote.php/webdav/

  1. User 2 edits the file locally and makes a change
  2. User 2 syncs again

/usr/bin/owncloudcmd --trust /root/jrm/smashbox/results/test_shareFile/shareeOne/ owncloud://user2:@x.x.x.x/owncloud/remote.php/webdav/

The sync fails with an internal server error

  1. User 2 syncs for a third time. This time the the sync works.

Expected behaviour

The file should be synced the first time after editing the file.

Actual behaviour

The file fails to sync the first time after editing the file.

Server log file:


{"reqId":"a0d319d3ba7b57067f372f809c9c7481","remoteAddr":"x.x.x.x","app":"PHP","message":"fclose() expects parameter 1 to be resource, boolean given at \/var\/www\/html\/owncloud\/lib\/private\/files\/view.php#527","level":3,"time":"2015-02-04T19:46:15+00:00"}
{"reqId":"a0d319d3ba7b57067f372f809c9c7481","remoteAddr":"x.x.x.x","app":"webdav","message":"\\OC\\Files\\Filesystem::rename() failed","level":3,"time":"2015-02-04T19:46:15+00:00"}
{"reqId":"a0d319d3ba7b57067f372f809c9c7481","remoteAddr":"x.x.x.x","app":"webdav","message":"Exception: {\"Message\":\"Could not rename part file to final file\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/html\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Server.php(888): OC_Connector_Sabre_File->put(Resource id #527)\\n#1 [internal function]: Sabre\\\\DAV\\\\Server->httpPut('somefile.txt')\\n#2 \\\/var\\\/www\\\/html\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Server.php(474): call_user_func(Array, 'somefile.txt')\\n#3 \\\/var\\\/www\\\/html\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Server.php(214): Sabre\\\\DAV\\\\Server->invokeMethod('PUT', 'somefile.txt')\\n#4 \\\/var\\\/www\\\/html\\\/owncloud\\\/apps\\\/files\\\/appinfo\\\/remote.php(61): Sabre\\\\DAV\\\\Server->exec()\\n#5 \\\/var\\\/www\\\/html\\\/owncloud\\\/remote.php(54): require_once('\\\/var\\\/www\\\/html\\\/o...')\\n#6 {main}\",\"File\":\"\\\/var\\\/www\\\/html\\\/owncloud\\\/lib\\\/private\\\/connector\\\/sabre\\\/file.php\",\"Line\":142}","level":4,"time":"2015-02-04T19:46:15+00:00"}



Server Host info:

Ubuntu 14.04
PHP 5.5.9
mysql

Server configuration

ownCloud Enterprise Edition 8.0 beta 2 (daily) Build:2015-01-30T04:20:37+00:00 24fc1c7

Client Configuration

owncloudcmd version 1.7.1

@jnfrmarks
Copy link
Author

Just as an FYI, I ran the test a second time setting the permissions to 17 (
OCS_PERMISSION_READ | OCS_PERMISSION_SHARE) and got the same results.

See owncloud/core#13867 (comment)

@ckamm
Copy link
Contributor

ckamm commented Feb 26, 2015

Sounds like a server bug. Sanitized server log messages:

fclose() expects parameter 1 to be resource, boolean given at /var/www/html/owncloud/lib/private/files/view.php#527

OCFilesFilesystem::rename() failed

Exception: {"Message":"Could not rename part file to final file","Code":0,"Trace":"#0
/var/www/html/owncloud/3rdparty/sabre/dav/lib/Sabre/DAV/Server.php(888): OC_Connector_Sabre_File->put(Resource id #527)
n#1 [internal function]: SabreDAVServer->httpPut('somefile.txt')
n#2 /var/www/html/owncloud/3rdparty/sabre/dav/lib/Sabre/DAV/Server.php(474): call_user_func(Array, 'somefile.txt')
n#3 /var/www/html/owncloud/3rdparty/sabre/dav/lib/Sabre/DAV/Server.php(214): SabreDAVServer->invokeMethod('PUT', 'somefile.txt')
n#4 /var/www/html/owncloud/apps/files/appinfo/remote.php(61): SabreDAVServer->exec()
n#5 /var/www/html/owncloud/remote.php(54): require_once('/var/www/html/o...')
n#6 {main}",
"File":"/var/www/html/owncloud/lib/private/connector/sabre/file.php","Line":142}","level":4,"time":"2015-02-04T19:46:15+00:00"}

@dragotin
Copy link
Contributor

@PVince81 please

@PVince81
Copy link
Contributor

Are you guys also setting 17 ? (READ + SHARE)

SHARE alone isn't enough, one needs to explicitly pass the "READ" permission, or else... here be dragons.

In general the API should either set READ automatically or throw 400 Bad request if it's missing. (CC @schiesbn)

@ogoffart
Copy link
Contributor

ogoffart commented Mar 3, 2015

Same exception as in #2234

@PVince81
Copy link
Contributor

PVince81 commented Mar 3, 2015

Are you guys passing 16 (SHARE alone) or 17 (READ + SHARE) ?
Please confirm.

@PVince81
Copy link
Contributor

PVince81 commented Mar 3, 2015

If it's about passing 16 (SHARE alone) it was fixed on master: owncloud/core#14570

@ogoffart ogoffart added the ReadyToTest QA, please validate the fix/enhancement label Mar 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ReadyToTest QA, please validate the fix/enhancement Server Involved
Projects
None yet
Development

No branches or pull requests

6 participants