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

Error sharing a Shared Folder #25464

Closed
daorte opened this Issue Jul 13, 2016 · 17 comments

Comments

Projects
None yet
6 participants
@daorte

daorte commented Jul 13, 2016

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"}

@nasli

This comment has been minimized.

Show comment
Hide comment
@nasli

nasli Jul 13, 2016

Member

owncloud/ios#704 could you check it @mcastroSG ? thanks!

Member

nasli commented Jul 13, 2016

owncloud/ios#704 could you check it @mcastroSG ? thanks!

@mcastroSG

This comment has been minimized.

Show comment
Hide comment
@mcastroSG

mcastroSG Jul 13, 2016

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

mcastroSG commented Jul 13, 2016

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

@daorte

This comment has been minimized.

Show comment
Hide comment
@daorte

daorte Jul 13, 2016

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 commented Jul 13, 2016

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.

@PVince81

This comment has been minimized.

Show comment
Hide comment
@PVince81

PVince81 Jul 14, 2016

Member

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

Member

PVince81 commented Jul 14, 2016

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

@PVince81

This comment has been minimized.

Show comment
Hide comment
@PVince81

PVince81 Jul 14, 2016

Member

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

Member

PVince81 commented Jul 14, 2016

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

@daorte

This comment has been minimized.

Show comment
Hide comment
@daorte

daorte Jul 14, 2016

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 commented Jul 14, 2016

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

@PVince81

This comment has been minimized.

Show comment
Hide comment
@PVince81

PVince81 Jul 14, 2016

Member

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

Member

PVince81 commented Jul 14, 2016

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

@daorte

This comment has been minimized.

Show comment
Hide comment
@daorte

daorte Jul 14, 2016

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 commented Jul 14, 2016

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

This comment has been minimized.

Show comment
Hide comment
@daorte

daorte Jul 25, 2016

Hi!
any news here?

daorte commented Jul 25, 2016

Hi!
any news here?

@daorte

This comment has been minimized.

Show comment
Hide comment
@daorte

daorte Jul 25, 2016

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

regards

daorte commented Jul 25, 2016

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

regards

@daorte

This comment has been minimized.

Show comment
Hide comment
@daorte

daorte Jul 26, 2016

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 commented Jul 26, 2016

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

This comment has been minimized.

Show comment
Hide comment
@daorte

daorte Jul 27, 2016

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 commented Jul 27, 2016

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.

@pako81

This comment has been minimized.

Show comment
Hide comment
@pako81

pako81 Jul 28, 2016

Member

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
Member

pako81 commented Jul 28, 2016

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

This comment has been minimized.

Show comment
Hide comment
@pako81

pako81 Jul 28, 2016

Member

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

Member

pako81 commented Jul 28, 2016

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

@DeepDiver1975 DeepDiver1975 self-assigned this Aug 3, 2016

@DeepDiver1975 DeepDiver1975 added this to the 9.2 milestone Aug 3, 2016

@DeepDiver1975

This comment has been minimized.

Show comment
Hide comment
@DeepDiver1975

DeepDiver1975 Aug 3, 2016

Member

this was working in 9.0.2 - stopped working in 9.0.3

Member

DeepDiver1975 commented Aug 3, 2016

this was working in 9.0.2 - stopped working in 9.0.3

@DeepDiver1975

This comment has been minimized.

Show comment
Hide comment
@DeepDiver1975

DeepDiver1975 Aug 5, 2016

Member

@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
Member

DeepDiver1975 commented Aug 5, 2016

@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 added a commit that referenced this issue Aug 5, 2016

@DeepDiver1975

This comment has been minimized.

Show comment
Hide comment
@DeepDiver1975
Member

DeepDiver1975 commented Aug 5, 2016

@daorte @nasli @mcastroSG please help testing #25703

@PVince81 PVince81 modified the milestones: 9.0.5, 9.2 Aug 8, 2016

DeepDiver1975 added a commit that referenced this issue Aug 9, 2016

getJailedPath expects $path to have a trailing / (#25703)
* getJailedPath expects $path to have a trailing / - fixes #25464

* Adding test case for getPathById including a jailed cache where root is just empty

DeepDiver1975 added a commit that referenced this issue Aug 9, 2016

[stable9.1] getJailedPath expects $path to have a trailing / (#25703)
* getJailedPath expects $path to have a trailing / - fixes #25464

* Adding test case for getPathById including a jailed cache where root is just empty

DeepDiver1975 added a commit that referenced this issue Aug 9, 2016

[stable9] getJailedPath expects $path to have a trailing / (#25703)
* getJailedPath expects $path to have a trailing / - fixes #25464

* Adding test case for getPathById including a jailed cache where root is just empty

PVince81 added a commit that referenced this issue Aug 11, 2016

[stable9] getJailedPath expects $path to have a trailing / (#25703)
* getJailedPath expects $path to have a trailing / - fixes #25464

* Adding test case for getPathById including a jailed cache where root is just empty

DeepDiver1975 added a commit that referenced this issue Aug 12, 2016

[stable9] getJailedPath expects $path to have a trailing / (#25703) (#…
…25738)

* getJailedPath expects $path to have a trailing / - fixes #25464

* Adding test case for getPathById including a jailed cache where root is just empty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment