core icon indicating copy to clipboard operation
core copied to clipboard

Error sharing a Shared Folder

Open daorte opened this issue 10 years ago • 18 comments

Hi! I think this issue is related to 704 on iOS project (don´t know hot to relate this with an issue located on other project) @nasli

After upgrading to 9.0.3.2 there is another problem sharing shared resources.

Steps to reproduce

  1. i have two users, userOne and userTwo
  2. userOne shares a folder with full permissions to userTwo
  3. userTwo tries to create a share link on a file of his shared folder using the web UI
  4. the 'loading' icon never stops, the link is never created
  5. in the UI the 'shared link' icon apprears but the link doesn't exists

Expected behaviour

The link of the shared resource should be created

Actual behaviour

  1. the 'loading' icon never stops, the link is never created
  2. after refreshing the page (f5) in the UI the 'shared link' icon apprears but the link doesn't exists

Server configuration

Web server: Apache 2.4 Database: MySQL PHP version: 7 OwnCloud: 9.0.3.2 upgraded from 9.0.2.2

Client configuration

Browser: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0

Operating system: Windows 8.1

Logs

ownCloud log (data/owncloud.log)

{"reqId":"sS6ysMKz2\/KHpqweRGG3","remoteAddr":"192.168.1.73","app":"PHP","message":"OCP\\Files\\NotFoundException: at \/var\/www\/owncloud\/apps\/files_sharing\/api\/share20ocs.php#110","level":3,"time":"2016-07-13T07:27:34+00:00","method":"POST","url":"\/owncloud\/ocs\/v2.php\/apps\/files_sharing\/api\/v1\/shares?format=json","user":"userTwo"}

daorte avatar Jul 13 '16 07:07 daorte

https://github.com/owncloud/ios/issues/704 could you check it @mcastroSG ? thanks!

nasli avatar Jul 13 '16 08:07 nasli

@daorte @nasli unable to reproduce on a server 9.0.3 maybe

mcastroSG avatar Jul 13 '16 08:07 mcastroSG

It happens to me on a 9.0.3 server upgraded from 9.0.2 in web ui, not tested on mobile clients. In my 9.0.2 i already had the folder share from userOne to userTwo. In the migrated 9.0.3 i try to create the share link as userTwo on the folder shared by userOne.

daorte avatar Jul 13 '16 09:07 daorte

Maybe try setting "loglevel" to 0 and see if you get more messages in owncloud.log

PVince81 avatar Jul 14 '16 07:07 PVince81

Is the shared file/folder originally on an external storage ?

PVince81 avatar Jul 14 '16 07:07 PVince81

Hi @PVince81, the original folder is on external storage, sorry i forgot to mention it. Let me change the log level and see if i can get more info

daorte avatar Jul 14 '16 07:07 daorte

@daorte please also give us more details about that external storage. The more info the better to be able to reproduce this.

PVince81 avatar Jul 14 '16 07:07 PVince81

Ok Ok, Let me explain the whole whole picture

1- In filesystem i have a folder with this structure: /home/ubuntu/data_disk1 + data_user_one - 1.tar - 2.tar + data_user_two

The folder is owned by www-data and the group is www-data

2- With the admin account, configure an external storage with this params: - Folder Name: DATA - External Storage: Local - Authentication: None - Configuration: /home/ubuntu/data_disk1 - Available for: userOne (only oserOne can see this mount point) - Enable sharing is selected

3- Log on with userOne, and can see the DATA folder, select it and share with UserTwo with all privileges

4- Log on with userTwo, and can see the DATA folder too (with the shared icon) 5- Navigate to DATA/data_user_one/1.tar 6- Try to create a share link for 1.tar

I did change the log configuration and the message is the same: {"reqId":"qRm1xQiuJbDHjfP\/g7uX","remoteAddr":"192.168.3.144","app":"PHP","message":"OCP\\Files\\NotFoundException: at \/var\/www\/owncloud\/apps\/files_sharing\/api\/share20ocs.php#110","level":3,"time":"2016-07-14T07:47:56+00:00","method":"POST","url":"\/owncloud\/ocs\/v2.php\/apps\/files_sharing\/api\/v1\/shares?format=json","user":"userTwo"}

daorte avatar Jul 14 '16 07:07 daorte

Hi! any news here?

daorte avatar Jul 25 '16 08:07 daorte

Just upgraded my test server to 9.0.4 and got the same bahavior.

regards

daorte avatar Jul 25 '16 09:07 daorte

Server upgraded to 9.1 and still the same issue, i think it could be related to the ownership of the file, because it happens with a shared external storage.

This is the log message in 9.1

{"reqId":"RqfQRSITpd4RUnSoXGf6","remoteAddr":"192.168.3.144","app":"PHP","message":"OCP\\Files\\NotFoundException: at \/var\/www\/owncloud\/apps\/files_sharing\/lib\/API\/Share20OCS.php#123","level":3,"time":"2016-07-26T12:34:49+00:00","method":"POST","url":"\/owncloud\/ocs\/v2.php\/apps\/files_sharing\/api\/v1\/shares?format=json","user":"userTwo"}

daorte avatar Jul 26 '16 12:07 daorte

More information: I just put some logs on method formatShareon Share20OCS.php and i found something.

When sharing a link on a shared folder, the uid_owner and displayname_owner is the orginal owner of the file/folder, in this case userOne and then, when looking the node over user folder $userFolder = $this->rootFolder->getUserFolder($this->currentUser->getUID()); and sending userTwo as the argument, there is no existent node, i presume because the file/folder owner is userOne and no userTwo, am i right?

If i create a link with userTwo in a regular file/folder (not shared) the the uid_owner and displayname_owner is userTwo and then it can find the nodes correctly.

daorte avatar Jul 27 '16 10:07 daorte

Also observed here:

Steps to reproduce

  1. Having a CIFS share mounted at the OS level and then mounted into oC as "local" mount point via the External Storage app
  2. As LDAP user who received the shared folder, create a new subfolder under the root folder and try to share it via public link
  3. The public link is not generated and the loading wheel keeps spinning
  4. Observed with all LDAP users and for every newly created subfolder under the root of the local mount point. Also with different browsers: FF, IE11.
  5. With 9.0.2 everything was working correctly

pako81 avatar Jul 28 '16 14:07 pako81

Follow-up: this is reproducible with Database users as well and not only LDAP ones

pako81 avatar Jul 28 '16 14:07 pako81

this was working in 9.0.2 - stopped working in 9.0.3

DeepDiver1975 avatar Aug 03 '16 13:08 DeepDiver1975

@SergioBertolinSG may I ask you to write an integration test for this?

   0. as user 1 mount local folder as 'Local'
   1. as user create a folder inside 'Local' named 'foo'
   2. as user 1 share 'Local' with user 2
   3. as user 2 share 'Local/foo' by link
   4. expect a link share to be returned

DeepDiver1975 avatar Aug 05 '16 07:08 DeepDiver1975

@daorte @nasli @mcastroSG please help testing https://github.com/owncloud/core/pull/25703

DeepDiver1975 avatar Aug 05 '16 11:08 DeepDiver1975

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Aug 03 '19 20:08 lock[bot]