You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Resharing via Link appears to be broken after Update to 7.0.3 #12475
1.Share a File that has been shared with you via link
2. Try to Open the Link
Expected behaviour
Link should open the Download Page for the shared file
Actual behaviour
Link leads to a error message saying this link does not exist
Server configuration
Operating system:
Debian 7
Web server:
Apache2
Database:
MariaDB 10.0
PHP version:
5.4.35
ownCloud version:
7.0.3
Updated from an older ownCloud or fresh install:
Updated from 7.0.2
List of activated apps:
Activity, Delete Files, Documents, First Run Wizard, Full Text Search, PDF Viewer, Share Files, Text Editor, Updater, Files Move
Are you using external storage, if yes which one:
No
Are you using encryption:
No
Client configuration
Browser:
Firefox
Operating system:
Windows 7
Web server error log
Nothing
ownCloud log (data/owncloud.log)
{"reqId":"547739393b36c","app":"share","message":"could not resolve linkItem","level":0,"time":"2014-11-27T14:46:17+00:00","method":"GET","url":"/public.php?service=files&t=
If that Helps: I'm forcing the use of a Password and expiry Date for Link sharing.
{"reqId":"547739393b36c","app":"share","message":"could not resolve linkItem","level":0,"time":"2014-11-27T14:46:17+00:00","method":"GET","url":"/public.php?service=files&t=
Can the share still be found in the DB in the "oc_share" table?
A small "maybe me too"
This seems to occur to me for any file that is inside a folder that was shared to me with the share function directly (not from a link). However, I can re-share with a valid link the folder itself.
ie.: As part of membership in a group, I'm shared the folder "Folder A". I can create a valid link to "Folder A", but not to any file or folder inside that folder.
However, the owner of the share can generate valid link from these shares (and they both create 2 different links). Here's both entries in the oc_cache table. The second one is from the owner and works:
We see the same problem here in 7.0.4 (Worked some versions past (6.x?))
We see this message in the server log file:
{"reqId":"54aaac69c1905","app":"share","message":"could not resolve linkItem","level":0,"time":"2015-01-05T15:23:21+00:00","method":"GET","url":"/public.php?service=files&t=11a2866bada7d831a25cccfdc7202b60"}
Just saw that thread, I think the same Issue as this: #12802
As mentioned I noticed that the link I see under the section "Shared by Link" when I reshare a file is not working either.
Not sure it's the same as #12802, since here we share via token (t=xxxxxxxxx) and in the other issue it is shared in another way.
But perhaps related somewhere deeper in the code base.
Probably due to the code refactoring done here with this commit: 988c85d
Basically, if you group share a folder in version >= 7.0.3 and someone makes a link in a sub-folder, it will work as expected (which might explain how this passed testing).
However, if you group share a folder in version <= 7.0.2 and then upgrade to version >= 7.0.3, the share links of subfolders won't work.
Looking at oc_share in the database, I can see that folders created in version <= 7.0.2 have one entry per group. However, folders created after 7.0.2 have an entry per group and per person in each group (with the parent column referring to the group entry), probably because of #10107 to allow for cumulative permissions if the folder is shared to more than one group.
I didn't look at the code directly (having to look at both stable7 and the refactored version in master when I'm not familiar with the project turned me off...), but the permission verification step in a shared link probably checks for the user permission only, and not the corresponding groups anymore (since it's what it should be expecting from a folder created at version >= 7.0.3).
Possible solutions would be to fall back to group checking if the user isn't there or have an upgrade script to add the users of the group in each group share of the db, thus having consistency in group shares between versions.
When the user has more than one group, the string concatenation will make the query fail to find results.
Because (?) is then replaced by ('g1,g2') instead of ('g1', 'g2')
There is a slight chance that the fix will also fix @GreenArchon's issue, but I'm not sure whether the group shared need to be manually re-created for the folder grouping to work.
The issue itself appears in the following situation:
the share is a reshare
the use to whom it is reshared has more than one group assigned
and possibly many other cases where a user has more than one group...
@PVince81 Thanks for the fix, I can confirm it makes links work again.
It doesn't resolve my issue with the multiple entries when on multiple groups. If you think it'd be wiser to open another issue I can do it, but otherwise I can live with the bug, since shares created at version >= 7.0.3 don't have this behaviour.
If you think it'd be wiser to open another issue I can do it, but otherwise I can live with the bug, since shares created at version >= 7.0.3 don't have this behaviour.
Please create a new issues for that. If you experience this issue others might as well and they might not be able to live with this limitation.
Activity
LukasReschke commentedon Nov 28, 2014
Can the share still be found in the DB in the "oc_share" table?
viasys commentedon Nov 28, 2014
Yes
GreenArchon commentedon Nov 29, 2014
A small "maybe me too"
This seems to occur to me for any file that is inside a folder that was shared to me with the share function directly (not from a link). However, I can re-share with a valid link the folder itself.
ie.: As part of membership in a group, I'm shared the folder "Folder A". I can create a valid link to "Folder A", but not to any file or folder inside that folder.
However, the owner of the share can generate valid link from these shares (and they both create 2 different links). Here's both entries in the oc_cache table. The second one is from the owner and works:
(
id,share_type,share_with,uid_owner,parent,item_type,item_source,item_target,file_source,file_target,permissions,stime,accepted,expiration,token,mail_send)(1655, 3, NULL, 'frederic.fortier', NULL, 'file', '425060', '/425060', 425060, '/cc1101.pdf', 1, 1417227458, 0, '2014-12-29 00:00:00', 'cb187e7def9a600fd2dae67695f74f2f', 0)
(1656, 3, NULL, 'oronos.polytechnique', NULL, 'file', '425060', '/425060', 425060, '/cc1101.pdf', 1, 1417227511, 0, '2014-12-29 00:00:00', 'fc14e015b352fac7493cc0b5a47f44d8', 0)
LukasReschke commentedon Nov 29, 2014
@schiesbn @icewind1991 Ideas?
arielvb commentedon Dec 5, 2014
I've the same behaviour as @GreenArchon
But if user1 (the owner of the folder) shares the same file with the share link it works.
jbonor commentedon Dec 11, 2014
Me too, upgraded from 7.0.2 to 7.0.3 and 7.0.4 and I can no longer share files with links from folders shared with me. Anyone have a solution?
a-schild commentedon Jan 5, 2015
We see the same problem here in 7.0.4 (Worked some versions past (6.x?))
We see this message in the server log file:
{"reqId":"54aaac69c1905","app":"share","message":"could not resolve linkItem","level":0,"time":"2015-01-05T15:23:21+00:00","method":"GET","url":"/public.php?service=files&t=11a2866bada7d831a25cccfdc7202b60"}
viasys commentedon Jan 5, 2015
For me it was working in 7.0.2.
Do-D commentedon Jan 5, 2015
Just saw that thread, I think the same Issue as this: #12802
As mentioned I noticed that the link I see under the section "Shared by Link" when I reshare a file is not working either.
a-schild commentedon Jan 5, 2015
Not sure it's the same as #12802, since here we share via token (t=xxxxxxxxx) and in the other issue it is shared in another way.
But perhaps related somewhere deeper in the code base.
Probably due to the code refactoring done here with this commit: 988c85d
GreenArchon commentedon Jan 5, 2015
Pretty sure it isn't 988c85d since it isn't in owncloud 7.0.3/7.0.4 ;)
Wherever the bug is, it was introduced between 7.0.2 and 7.0.3
LukasReschke commentedon Jan 6, 2015
Yup. That refactoring is only in master (aka up-coming 8.0)
If some of you feel advantageous and want to have it sooner resolved I can highly recommend doing a small
git bisectcrash-course.With
git bisectyou can find out which commit introduced the broken behaviour, for that you just need to know a commit where it last worked and step by step you will rush through the commits and try to find the bad one. A somewhat more verbose description can be found at http://webchick.net/node/99(otherwise you might need to wait once the responsible persons are back from holiday and have time etc… - usual story ;-))
GreenArchon commentedon Jan 6, 2015
Alright, it's a bit trickier than anticipated. ;)
Basically, if you group share a folder in version >= 7.0.3 and someone makes a link in a sub-folder, it will work as expected (which might explain how this passed testing).
However, if you group share a folder in version <= 7.0.2 and then upgrade to version >= 7.0.3, the share links of subfolders won't work.
Looking at oc_share in the database, I can see that folders created in version <= 7.0.2 have one entry per group. However, folders created after 7.0.2 have an entry per group and per person in each group (with the parent column referring to the group entry), probably because of #10107 to allow for cumulative permissions if the folder is shared to more than one group.
I didn't look at the code directly (having to look at both stable7 and the refactored version in master when I'm not familiar with the project turned me off...), but the permission verification step in a shared link probably checks for the user permission only, and not the corresponding groups anymore (since it's what it should be expecting from a folder created at version >= 7.0.3).
Possible solutions would be to fall back to group checking if the user isn't there or have an upgrade script to add the users of the group in each group share of the db, thus having consistency in group shares between versions.
29 remaining items
PVince81 commentedon Jan 16, 2015
And... here it is: https://github.com/owncloud/core/blob/stable7/lib/private/share/share.php#L343
When the user has more than one group, the string concatenation will make the query fail to find results.
Because
(?)is then replaced by('g1,g2')instead of('g1', 'g2')PVince81 commentedon Jan 16, 2015
Fix is here: #13423
There is a slight chance that the fix will also fix @GreenArchon's issue, but I'm not sure whether the group shared need to be manually re-created for the folder grouping to work.
The issue itself appears in the following situation:
and possibly many other cases where a user has more than one group...
GreenArchon commentedon Jan 16, 2015
@PVince81 Thanks for the fix, I can confirm it makes links work again.
It doesn't resolve my issue with the multiple entries when on multiple groups. If you think it'd be wiser to open another issue I can do it, but otherwise I can live with the bug, since shares created at version >= 7.0.3 don't have this behaviour.
LukasReschke commentedon Jan 16, 2015
Please create a new issues for that. If you experience this issue others might as well and they might not be able to live with this limitation.
Thanks for testing the patch!
GreenArchon commentedon Jan 16, 2015
No problem. Issue created at #13429
PVince81 commentedon Jan 19, 2015
@karlitschek @DeepDiver1975 tagging this bug as showstopper as it breaks reshares, a fix is already there to review: #13423
viasys commentedon Jan 19, 2015
@PVince81 Sorry it took so long but i tested your Workaround and it worked, thanks for working that out with me and I'm looking forward for the fix!