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
Recurring change of file_target in oc_share #10678
I have a folder shared with two people and the file_target in oc_share gets incremented:
/Shared File
/Shared File (2)
This name is visible for the user aswell. I can change this by SQL and if works for roughly a day and the gets automatically renamed. The share is not altered by myself, it's automatically. The SQL i used is this (PostgreSQL):
update oc_share set file_target = replace( file_target, ' (2)','');
Problem was spotted on a client machine with desktop sync while the very folder was synchronized (instead of /). Therefore it works one day and on the other day it stars complaining.
I do not know it this bug is already known, yet I didn't found something related in the search.
Another problem with this is, that if I share a folder with a user A for rw and a group G for r (user A also in group G) this user will see the folder and it's (2) folder.
I encounter this on 7.0.2 on two different owncloud installations. If you need further information, don't hesitate to ask.
Share Folder with more than one person (via multiple share, not via group)
Folder is not shared with the same name for all persons (SQL: file_target column), ownCloud 7 added (2) to the name
Also look at the database
Alternative approach
Share Folder with Person A and share also with Group B where Person A is also member of
look at shared folders, Person A will see two shares, one with (2)
Expected behaviour
Name should be the same for all users which see the share.
Actual behaviour
Name is incremented by (number)
Server configuration
I tested it on two different systems Operating system:
Debian Wheezy, amd64 (both) Web server:
Apache 2.2 (both) Database:
PostgreSQL 9.2 and 9.3 PHP version:
PHP 5.4.4-14+deb7u14 ownCloud version: (see ownCloud admin page)
ownCloud 7.0.2 (stable) - Installed via Debian-Repository Updated from an older ownCloud or fresh install:
One yes, other no List of activated apps:
LDAP, Activity, External Site, Share Files, Picture, Text Editor, PDF Viewer, Full Text Search The content of config/config.php:
Hi, since the update of the server to version 7 last week we have the same issue.
The main folder in Shared is automatically renamed, seemingly on a daily basis.
/Shared/Folder/
/Shared/Folder (2)/
/Shared/Folder (2) (2)/
etc. this causes large traffic and path problems!
Apparently the owner of the shared folder has not such an behavior.
I hope you can trace the problem.
This behavior already existed in OC 6. When a file is shared multiple times with the same user through multiple groups, the file will appear multiple times.
There is work in progress that tries to properly group them: #10107
But if you guys say that the target name changes in the database multiple times (auto-rename from "folder" to "folder (2)" then later back to "folder") then this is a bug and shouldn't happen.
Is the latter what you are observing ?
The auto-renaming should only happen once.
@PVince81: In OC6 I never noticed multiple share paths yielding in multi display. It worked as it should be - shown once with the most permissions possible (rw in my case). I had a folder shared to big group in OC (ro) and reshared to a group of admins - subset of the former group - (rw) and the folder only appeared once. This is the same in OC7 if I rename the file_target by hand to the same name, it workes as it has in OC6 and IMHO and should be in general.
I rechecked: If I share the folder with a third person, the file_target is correct. Let's see when it gets changed. I tried several cron.php executions by hand and it does not get changed.
Currently, it's bugging me big time, therefore this database side fix for my problem (PostgreSQL):
CREATE OR REPLACE FUNCTION tf_modify_file_target()
RETURNS TRIGGER AS $$
BEGIN
/* Remove ' (2)' from string */
NEW.file_target := REPLACE( NEW.file_target, ' (2)', '' );
RETURN NEW;
END;
$$ LANGUAGE plpgsql
;
DROP TRIGGER IF EXISTS tr_modify_file_target ON oc_share;
CREATE TRIGGER tr_modify_file_target
BEFORE INSERT OR UPDATE ON oc_share
FOR EACH ROW EXECUTE PROCEDURE tf_modify_file_target();
@lnxbil just re-checked OC 6.0.5 and you're right, the multiple shares get merged into a single entry.
So this could be considered as a regression introduced by the new sharing approach in OC 7.
This PR #10107 should hopefully fix it when it's done.
@laubblatt if you're getting "(2)" multiple times like "Test (2) (2) (2).txt" then you're having another issue, see #10736 and try disabling 3rd party apps.
Activity
karlitschek commentedon Aug 28, 2014
@schiesbn
PVince81 commentedon Aug 28, 2014
@lnxbil thanks for the report. I also haven't heard of such issue before.
Would you mind using the issue template to provide more information about your setup ?
https://raw.github.com/owncloud/core/master/issue_template.md
Would be good to know whether you had encryption enabled and maybe using external storage ?
lnxbil commentedon Aug 28, 2014
Steps to reproduce
Alternative approach
Expected behaviour
Name should be the same for all users which see the share.
Actual behaviour
Name is incremented by (number)
Server configuration
I tested it on two different systems
Operating system:
Debian Wheezy, amd64 (both)
Web server:
Apache 2.2 (both)
Database:
PostgreSQL 9.2 and 9.3
PHP version:
PHP 5.4.4-14+deb7u14
ownCloud version: (see ownCloud admin page)
ownCloud 7.0.2 (stable) - Installed via Debian-Repository
Updated from an older ownCloud or fresh install:
One yes, other no
List of activated apps:
LDAP, Activity, External Site, Share Files, Picture, Text Editor, PDF Viewer, Full Text Search
The content of config/config.php:
Are you using external storage, if yes which one: local/smb/sftp/...
First: configured, but not used
Second: DropBox
Are you using encryption: yes/no
Both times, but using selective redirects in Apache to allow anonymous sharing without SSL, everything else only SSL
Client configuration
Browser:
Current Chrome and Firefox ESR
Operating system:
Windows 7, Debian Wheezy
Logs
Web server error log
ownCloud log (data/owncloud.log)
Browser log
laubblatt commentedon Aug 28, 2014
Hi, since the update of the server to version 7 last week we have the same issue.
The main folder in Shared is automatically renamed, seemingly on a daily basis.
/Shared/Folder/
/Shared/Folder (2)/
/Shared/Folder (2) (2)/
etc. this causes large traffic and path problems!
Apparently the owner of the shared folder has not such an behavior.
I hope you can trace the problem.
PVince81 commentedon Aug 29, 2014
This behavior already existed in OC 6. When a file is shared multiple times with the same user through multiple groups, the file will appear multiple times.
There is work in progress that tries to properly group them: #10107
But if you guys say that the target name changes in the database multiple times (auto-rename from "folder" to "folder (2)" then later back to "folder") then this is a bug and shouldn't happen.
Is the latter what you are observing ?
The auto-renaming should only happen once.
lnxbil commentedon Aug 29, 2014
@PVince81: In OC6 I never noticed multiple share paths yielding in multi display. It worked as it should be - shown once with the most permissions possible (rw in my case). I had a folder shared to big group in OC (ro) and reshared to a group of admins - subset of the former group - (rw) and the folder only appeared once. This is the same in OC7 if I rename the
file_targetby hand to the same name, it workes as it has in OC6 and IMHO and should be in general.I rechecked: If I share the folder with a third person, the
file_targetis correct. Let's see when it gets changed. I tried severalcron.phpexecutions by hand and it does not get changed.lnxbil commentedon Sep 4, 2014
Currently, it's bugging me big time, therefore this database side fix for my problem (PostgreSQL):
CREATE OR REPLACE FUNCTION tf_modify_file_target() RETURNS TRIGGER AS $$ BEGIN /* Remove ' (2)' from string */ NEW.file_target := REPLACE( NEW.file_target, ' (2)', '' ); RETURN NEW; END; $$ LANGUAGE plpgsql ; DROP TRIGGER IF EXISTS tr_modify_file_target ON oc_share; CREATE TRIGGER tr_modify_file_target BEFORE INSERT OR UPDATE ON oc_share FOR EACH ROW EXECUTE PROCEDURE tf_modify_file_target();PVince81 commentedon Sep 4, 2014
@lnxbil just re-checked OC 6.0.5 and you're right, the multiple shares get merged into a single entry.
So this could be considered as a regression introduced by the new sharing approach in OC 7.
This PR #10107 should hopefully fix it when it's done.
@laubblatt if you're getting "(2)" multiple times like "Test (2) (2) (2).txt" then you're having another issue, see #10736 and try disabling 3rd party apps.
PVince81 commentedon Sep 4, 2014
Similar issue: #9724