core icon indicating copy to clipboard operation
core copied to clipboard

OC7 - Duplicated folders after rename

Open christianrj opened this issue 11 years ago • 9 comments

Steps to reproduce

  1. Setup two user accounts (user1 and user2). Configure them in two different computers (or same computer with a VM);
  2. Share a folder from user1 to user 2 (for example: "TEST"). Wait for the sync to complete;
  3. Now, PAUSE the sync in both computers (do not close the clients, just pause the sync);
  4. Rename folder TEST to TEST2 for user1 (on computer);
  5. Rename folder TEST to TEST3 for user2 (again on computer);
  6. Restart sync for user1 then immediately for user2 too;
  7. Wait for the sync to complete;
  8. You now have TWO folders with the same exact content instead of just one;
  • This was tested using Mac Client for user1 and Windows client for user2.

Expected behaviour

The sync must complete and just one folder must remains

Actual behaviour

A duplicate of the renamed folder is created

Server configuration

Operating system: CentOS 6.6 x64

Web server: Apache 2.2.27

Database: MySQL 5.5.40

PHP version: 5.5.19

ownCloud version: 7.0.3

Updated from an older ownCloud or fresh install: Fresh install

List of activated apps:

The content of config/config.php:

  'instanceid' => 'R E M O V E D',
  'passwordsalt' => 'R E M O V E D',
  'trusted_domains' => 
  array (
    0 => 'R E M O V E D',
  ),
  'datadirectory' => '/oc/data',
  'overwrite.cli.url' => 'R E M O V E D',
  'dbtype' => 'mysql',
  'version' => '7.0.3.4',
  'dbname' => 'owncloud7',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'R E M O V E D',
  'dbpassword' => 'R E M O V E D',
  'installed' => true,
  'share_folder' => '/Shared',

Are you using external storage, if yes which one: local hdd.

Are you using encryption: no

Client configuration

Browser: Chrorme 39

Operating system: Windows 8.1 PRO x64

Logs

Web server error log

no relevant logs to show

ownCloud log (data/owncloud.log)

{"app":"PHP","message":"Undefined index: mime at \/var\/www\/html\/owncloud\/apps\/files\/ajax\/mimeicon.php#4","level":3,"time":"2014-11-21T12:36:55+00:00"}
{"app":"PHP","message":"Undefined index: mime at \/var\/www\/html\/owncloud\/apps\/files\/ajax\/mimeicon.php#4","level":3,"time":"2014-11-21T12:38:30+00:00"}
{"app":"PHP","message":"Undefined index: mime at \/var\/www\/html\/owncloud\/apps\/files\/ajax\/mimeicon.php#4","level":3,"time":"2014-11-21T12:39:05+00:00"}

Browser log

No relevant logs to show

christianrj avatar Dec 06 '14 15:12 christianrj

@dragotin @guruz how would this kind of change be detected on the client side ?

@christianrj if you close the clients instead of pausing, does the problem still happen ? If not, then I wonder what the difference is between pausing and closing.

PVince81 avatar Dec 08 '14 10:12 PVince81

Renames are detected through the file ids which are not supposed to change through renames.

I am a bit surprised by the outcome of this experiment. It would be good to see a client logfile and/or the apache access_log. Is that possible?

dragotin avatar Dec 08 '14 11:12 dragotin

@PVince81 Results are the same with owncloud client closed on both sides. I'm testing this with a Mac client for one user and a Windows client for the other user.

This is the same setup on our network. Our file server (Windows Server 2008 R2) has an Owncloud client, but our president, directors and managers all use Macs, then they use Mac clients.

@dragotin I will redo these tests today and try to provide more logs and infos as you requested. Thank you.

christianrj avatar Dec 08 '14 14:12 christianrj

As additional information , this problem also occurs with OC6.

christianrj avatar Dec 08 '14 14:12 christianrj

Any special server storage backend?

guruz avatar Dec 08 '14 15:12 guruz

@guruz

No. We use normal 7200rpm hard disks. Owncloud has it's own HDD for the data folder, mounted on /oc.

christianrj avatar Dec 08 '14 15:12 christianrj

Could be related to: https://github.com/owncloud/core/issues/13391 where the file cache update isn't fast enough.

PVince81 avatar Apr 13 '15 09:04 PVince81

@PVince81 I think this is maybe related with #12661. Hoping with a fix soon.

christianrj avatar Aug 26 '15 14:08 christianrj

This shouldn't happen any more in 8.2 thanks to transactional file locking which prevents such concurrency issues.

PVince81 avatar Oct 08 '15 12:10 PVince81