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

Error sharing a Shared Folder #25464

Closed
daorte opened this issue Jul 13, 2016 · 18 comments · Fixed by #25703
Closed

Error sharing a Shared Folder #25464

daorte opened this issue Jul 13, 2016 · 18 comments · Fixed by #25703
Assignees
Milestone

Comments

@daorte
Copy link

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
Copy link

nasli commented Jul 13, 2016

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

@mcastroSG
Copy link

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

@daorte
Copy link
Author

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
Copy link
Contributor

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

@PVince81
Copy link
Contributor

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

@daorte
Copy link
Author

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
Copy link
Contributor

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

@daorte
Copy link
Author

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
Copy link
Author

daorte commented Jul 25, 2016

Hi!
any news here?

@daorte
Copy link
Author

daorte commented Jul 25, 2016

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

regards

@daorte
Copy link
Author

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
Copy link
Author

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
Copy link

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
Copy link

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
Copy link
Member

this was working in 9.0.2 - stopped working in 9.0.3

@DeepDiver1975
Copy link
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

@DeepDiver1975
Copy link
Member

@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 / - 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
* 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
* getJailedPath expects $path to have a trailing / - fixes #25464

* Adding test case for getPathById including a jailed cache where root is just empty
PVince81 pushed a commit that referenced this issue Aug 11, 2016
* 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
…25738)

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

* Adding test case for getPathById including a jailed cache where root is just empty
@lock
Copy link

lock bot commented Aug 3, 2019

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 lock bot locked as resolved and limited conversation to collaborators Aug 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants