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
Improved Conflict Handling: Save Conflict Files to Server #4557
The clients conflict file handling is not optimal currently because we decided to always prefer the server version over the local changes. That makes us moving the local changed file aside with a conflict file name and download the server version in place.
For the user that means that the local changes of the file are never synced to the server. #3222#4079
Under the assumption that we want to stick with the server version wins policy we could improve this by supporting version branches in the servers versions app as described here: owncloud/core#23002
Once the client detects a conflict file, it uploads the current local version to the servers version app along with the ETag of the file's predecessor, which is known to the client. That way, the local file version would be saved on the server and data loss would be avoided.
Is there a way to globally check if there are unsynced conflict files? Other than asking every user individually for logfiles or local directory listing ;-)
I think this would help to understand if there is a practical problem or not and maybe this could be a first step to tackling this issue. Would this information be stored in the syncdb journal file (in which case we could try to recall it to the server and analyze the whole bunch automatically)?
I tried to count 412 PUT responses in our http log files but then I realized it is only a subset of conflict cases (and I do not have any feeling how representative this subset is). So I still do not have a solid data point to reason about this issue for our system.
Dropbox does sync conflict files and probably there is a good reason to it. I am not sure if "99.99% of all users seems to be happy" is a good indicator in general because for example "99.99% of all users" did not notice the corruption problem that was actually a serious one (and statistically significant if you have above 10^7-10^8 files in the system).
I like this idea but I have a concern in how the average, IT illiterate user, would be able to understand what's happening. If you can have two versions of the same file on two users computers with the same name, that's very bad.
In the event of a conflict, I think a conflict file should be generated and the server copy sync down just as it is now (that tells the user something really, really needs their attention because they always take notice of notifications and messages from the ownCloud app). But the client syncs the conflict file back to the server as a branched version.
This allows the switching of the branch easily. If the branch switches, then the local conflict file goes away as it then becomes a dupe.
One edge case that would need to be considered. User 1 makes an edit that results in a conflict file. A new branch is created. The branch is switched server side so now the official version is the previously conflicted version. User 2 has been offline all this time but has edited the file. They've been working on the now non-current branch. What happens when they come back online. Does their current version sync to the non-current branch and then get replaced by the current branch of the file? How does the software inform User 2 of what has happened? Do the other users get informed that there's now an additional version in the other branch?
Branching is a fairly easy concept to grasp as a developer but I think it's going to take a lot of explanation get that light bulb moment for many non technical users. This is not easy to do in user friendly way. It will take some special UI to make this intuitive.
LibreOffice Online when they implement live collaborative editing + richdocuments is a better solution to this problem IMHO. Avoid the creation of conflicts entirely, then you don't have to deal with them, branching, etc.
We are currently running into this problem.
If the client was shut off for like a day, because something happened, or the user accidently turned it off or windows didn't boot the client, when turning it back on, it just overrides all the newer files and generates conflict files.
Maybe instead of doing this, let the user decide who wins, server or client.
Like the QNap QSync client does, everytime there is a conflict it asks what to do, save server version, save client version or generate conflict file.
It also has the option to check a checkbox to have it do the chosen action everytime it has a conflict.
So simply said, let the user choose who wins, the server or the client instead of chosing it for them.
@guruz@ogoffart Could we start with a lightweight approach? Just upload with filename and adding _conflict-$username-XXXX before extension? So everybody can see, there is something that needs to be resolved. I think this requires only minimal or no server-side changes. (Perhaps parameter in config.php and a capability /cc @PVince81@DeepDiver1975 )
From an end user perspective, everyone needs/must see that there is a conflicted version. Otherwise, folks will continue to work on their version of the document, rather than get with other document users to resolve the issue.
Just upload with filename and adding _conflict-$username-XXXX before extension?
Users like our organization, who have used Dropbox in the past, are very used to this happening and have internal processes for resolving these issues between user versions if they do happen.
If the client was shut off for like a day because something happened, or the user accidentally turned it off or windows didn't boot the client, when turning it back on, it just overrides all the newer files and generates conflict files.
Our organization is a relatively large workgroup and have never encountered this issue.
I don't think we should guess what users must experience (99.99%). Instead, why not make this an admin decision? Perhaps make this a selection in the admin console, or if that's not feasible, as a client setting?
I can not really read from the dropbox text above if they have the conflict files all on the server. We did not do that initially as we did not want to spread all conflicts that somebody might create for whatever reason to the harddisks of each and every user of a share. That would probably also confuse people.
I think the only good solution is to do it via the versions app.
@jnweiger: your test can easily be automated with smashbox and thus effortlessly rerun at will until the end of world. we can have a look at this together.
@jnweiger in your testcase where you modify both on server and client (to actually create the conflict), which version is the file with the original file name after the whole conflict sync happened?
It is probably still the server version, as it was before?
Maybe that really should be changed now and make it the latest version, ie the one that was modified last? Is that what user expect?
BAD: OC-ConflictBasePath is 'documented' in the issue, but missing
Can you please open an issue for that?
BAD: username is missing in the conflict files that were generated before the feature is enabled.
I suppose that's fine.
BAD: The tab 'not synced' now talks about a nicely synced (conflict) file.
Right.... Although it is still nice to have this information there since we want to act upon this.
There is code for this condition that explicitly add the conflict files there even though they are sync'ed.
Maybe a better UI is needed (another tab?)
@dragotin Yes in all cases of conflict tested, the version from the server was kept in place, versions from the local client were renamed.
Assuming nobody edits on the web interface, but all changes come through syncing clients, the client that syncs first would win. Which is the opposite of your suggestion "last client should win".
A strong reason for "last edit wins" would be if we could assume that later authors have seen, considered and rejected (or merged) earlier changes. In our case they cannot see each other until after the conflict.
A weaker reason is its simpler overall logic compared with 'first sync to server wins'.
The timestamp should be the modify timestamp of the file on the client. Not the moment when it got successfully synced to the server. Right?
There's a great little program called "allwaysync" that has a lovely conflict resolution tool. The key to the program's utility is that the conflict list is provided for in-program resolution. I have a folder with a lot of meta information modifications which generate conflicts with the server. The local files have the latest data, but they were all renamed. Now there's no straight-forward way to, say, select all of these conflicts and specify that the local file wins, please delete the copied down server file, un-rename the local file, and sync back to the server. That is, how about a UI tool that allows straight forward manual selection of which file should win and then executing that directive?
It seems that if you rename the conflict file to overwrite the original, it then takes precedence over the server file and the next sync will overwrite the server without generating a conflict report.. So the problem of deconflicting client precedence is only to bulk rename all the conflict files overwriting the copies downloaded from the sever like:
This will recurse through directories below where the command is executed, so be warned if some conflicts should be resolved with the server file taking precedence.
Note that all my conflicts seem to have "2016" as the prefix, YMMV on that. If the years vary, something like
The worst thing in all this is, that there is really no SANE way to resolve the conflict. The only way which works is to open the server version file and the local one (renamed to conflict file) and copy the contents of the local file into the server one). This might be possible with simple text files, but it is nearly impossible with more complex data, like graphics files, databases, etc. etc.
This should work (and does NOT):
delete the server file
rename the local "conflict" file to the original name.
After these asctions synchronization should understand that the user wants to keep local changes and upload them to the server. However it does not work now. It sais, that the server responded that the file is LOCKED. I use client 2.5.1 on Linux Mint
Am I missing an obvious "bulk resolve" to select local versions of all files currently in conflict? My server was down for a while; now all of applications are loading stale data from the server because my fresher local files have been renamed.
@lowlyocean There's currently no bulk-resolve option. #5896 is an issue about providing more conflict resolution ui help but that's not yet scheduled or even fully thought through. Until then, check out the renaming console commands mentioned above.
The client tries hard to avoid creating unnecessary conflict files. For example it'll only ever do it in situations where the server reports a file change (i.e. the server file's etag differs from the locally recorded etag). If you still have information about the situation that caused conflict files to be created in a "pure backup" situation that'd be very much worth a report.
Optionally limiting client behavior for "pure backup" operation may be a worthwhile discussion to have.
It concerns me that conflict resolution is proposed as a server-side task. I'm running on a raspberry pi and try to avoid the web interface as much as possible because it is slow to load. The more the client can do, the better.
If I'm not using nextCloud for collaboration, I shouldn't see any conflicts. It should be assumed my local copies are the most recent and back them up to the server.
I agree that conflict resolution is usually a local task, that ticket is about giving users better support for resolving conflicts locally through the sync client.
Activity
karlitschek commentedon Mar 9, 2016
Hmm. 99.99% of all users seems to be happy with the current conflict files handling.
But a good idea to consider of course.
moscicki commentedon Mar 9, 2016
Is there a way to globally check if there are unsynced conflict files? Other than asking every user individually for logfiles or local directory listing ;-)
I think this would help to understand if there is a practical problem or not and maybe this could be a first step to tackling this issue. Would this information be stored in the syncdb journal file (in which case we could try to recall it to the server and analyze the whole bunch automatically)?
I tried to count 412 PUT responses in our http log files but then I realized it is only a subset of conflict cases (and I do not have any feeling how representative this subset is). So I still do not have a solid data point to reason about this issue for our system.
Dropbox does sync conflict files and probably there is a good reason to it. I am not sure if "99.99% of all users seems to be happy" is a good indicator in general because for example "99.99% of all users" did not notice the corruption problem that was actually a serious one (and statistically significant if you have above 10^7-10^8 files in the system).
scolebrook commentedon Mar 15, 2016
I like this idea but I have a concern in how the average, IT illiterate user, would be able to understand what's happening. If you can have two versions of the same file on two users computers with the same name, that's very bad.
In the event of a conflict, I think a conflict file should be generated and the server copy sync down just as it is now (that tells the user something really, really needs their attention because they always take notice of notifications and messages from the ownCloud app). But the client syncs the conflict file back to the server as a branched version.
This allows the switching of the branch easily. If the branch switches, then the local conflict file goes away as it then becomes a dupe.
One edge case that would need to be considered. User 1 makes an edit that results in a conflict file. A new branch is created. The branch is switched server side so now the official version is the previously conflicted version. User 2 has been offline all this time but has edited the file. They've been working on the now non-current branch. What happens when they come back online. Does their current version sync to the non-current branch and then get replaced by the current branch of the file? How does the software inform User 2 of what has happened? Do the other users get informed that there's now an additional version in the other branch?
Branching is a fairly easy concept to grasp as a developer but I think it's going to take a lot of explanation get that light bulb moment for many non technical users. This is not easy to do in user friendly way. It will take some special UI to make this intuitive.
LibreOffice Online when they implement live collaborative editing + richdocuments is a better solution to this problem IMHO. Avoid the creation of conflicts entirely, then you don't have to deal with them, branching, etc.
ThaDaVos commentedon May 15, 2017
We are currently running into this problem.
If the client was shut off for like a day, because something happened, or the user accidently turned it off or windows didn't boot the client, when turning it back on, it just overrides all the newer files and generates conflict files.
Maybe instead of doing this, let the user decide who wins, server or client.
Like the QNap QSync client does, everytime there is a conflict it asks what to do, save server version, save client version or generate conflict file.
It also has the option to check a checkbox to have it do the chosen action everytime it has a conflict.
So simply said, let the user choose who wins, the server or the client instead of chosing it for them.
michaelstingl commentedon Jun 9, 2017
@guruz @ogoffart Could we start with a lightweight approach? Just upload with filename and adding
_conflict-$username-XXXXbefore extension? So everybody can see, there is something that needs to be resolved. I think this requires only minimal or no server-side changes. (Perhaps parameter inconfig.phpand a capability /cc @PVince81 @DeepDiver1975 )CJR2 commentedon Jun 26, 2017
From an end user perspective, everyone needs/must see that there is a conflicted version. Otherwise, folks will continue to work on their version of the document, rather than get with other document users to resolve the issue.
Agree with @michaelstingl.
Users like our organization, who have used Dropbox in the past, are very used to this happening and have internal processes for resolving these issues between user versions if they do happen.
Our organization is a relatively large workgroup and have never encountered this issue.
I don't think we should guess what users must experience (99.99%). Instead, why not make this an admin decision? Perhaps make this a selection in the admin console, or if that's not feasible, as a client setting?
michaelstingl commentedon Jun 26, 2017
Dropbox's approach is pretty straightforward:
https://www.dropbox.com/help/syncing-uploads/conflicted-copy
dragotin commentedon Jun 26, 2017
I can not really read from the dropbox text above if they have the conflict files all on the server. We did not do that initially as we did not want to spread all conflicts that somebody might create for whatever reason to the harddisks of each and every user of a share. That would probably also confuse people.
I think the only good solution is to do it via the versions app.
39 remaining items
moscicki commentedon Aug 9, 2018
@jnweiger: your test can easily be automated with smashbox and thus effortlessly rerun at will until the end of world. we can have a look at this together.
dragotin commentedon Aug 9, 2018
@jnweiger in your testcase where you modify both on server and client (to actually create the conflict), which version is the file with the original file name after the whole conflict sync happened?
It is probably still the server version, as it was before?
Maybe that really should be changed now and make it the latest version, ie the one that was modified last? Is that what user expect?
ogoffart commentedon Aug 9, 2018
Can you please open an issue for that?
I suppose that's fine.
Right.... Although it is still nice to have this information there since we want to act upon this.
There is code for this condition that explicitly add the conflict files there even though they are sync'ed.
Maybe a better UI is needed (another tab?)
@moscicki : We also have automated testing for this feature here: https://github.com/owncloud/client/blob/master/test/testsyncconflict.cpp But of course, this does not replace real testing on a real server.
jnweiger commentedon Aug 9, 2018
@dragotin Yes in all cases of conflict tested, the version from the server was kept in place, versions from the local client were renamed.
Assuming nobody edits on the web interface, but all changes come through syncing clients, the client that syncs first would win. Which is the opposite of your suggestion "last client should win".
A strong reason for "last edit wins" would be if we could assume that later authors have seen, considered and rejected (or merged) earlier changes. In our case they cannot see each other until after the conflict.
A weaker reason is its simpler overall logic compared with 'first sync to server wins'.
The timestamp should be the modify timestamp of the file on the client. Not the moment when it got successfully synced to the server. Right?
jnweiger commentedon Aug 9, 2018
@ogoffart right, those other 'BAD' items are acceptable for me too. Thanks to your review, one of them is now an issue: #6702.
jnweiger commentedon Aug 10, 2018
Enhancement idea: environment variable OWNCLOUD_UPLOAD_CONFLICT_FILES=1 should be a config file setting.
zippytiff commentedon Oct 15, 2018
Agreed, make this a config file setting and corresponding gui setting
ZT
gessel commentedon Nov 22, 2018
There's a great little program called "allwaysync" that has a lovely conflict resolution tool. The key to the program's utility is that the conflict list is provided for in-program resolution. I have a folder with a lot of meta information modifications which generate conflicts with the server. The local files have the latest data, but they were all renamed. Now there's no straight-forward way to, say, select all of these conflicts and specify that the local file wins, please delete the copied down server file, un-rename the local file, and sync back to the server. That is, how about a UI tool that allows straight forward manual selection of which file should win and then executing that directive?
gessel commentedon Nov 22, 2018
It seems that if you rename the conflict file to overwrite the original, it then takes precedence over the server file and the next sync will overwrite the server without generating a conflict report.. So the problem of deconflicting client precedence is only to bulk rename all the conflict files overwriting the copies downloaded from the sever like:
find -iname *_conflict-2016* -type f -exec rename -n -f 's/_conflict-2016[0-9]{4}-[0-9]{6}//' {} \;as a dry run, then removing the "-n" flag to really do it like:
find -iname *_conflict-2016* -type f -exec rename -f 's/_conflict-2016[0-9]{4}-[0-9]{6}//' {} \;This will recurse through directories below where the command is executed, so be warned if some conflicts should be resolved with the server file taking precedence.
Note that all my conflicts seem to have "2016" as the prefix, YMMV on that. If the years vary, something like
find -iname *_conflict-* -type f -exec rename -n -f 's/_conflict-[0-9]{8}-[0-9]{6}//' {} \;should do the trick, as long as "_conflict-" isn't used
gorn commentedon Dec 10, 2018
The worst thing in all this is, that there is really no SANE way to resolve the conflict. The only way which works is to open the server version file and the local one (renamed to conflict file) and copy the contents of the local file into the server one). This might be possible with simple text files, but it is nearly impossible with more complex data, like graphics files, databases, etc. etc.
This should work (and does NOT):
After these asctions synchronization should understand that the user wants to keep local changes and upload them to the server. However it does not work now. It sais, that the server responded that the file is LOCKED. I use client 2.5.1 on Linux Mint
lowlyocean commentedon Jan 28, 2019
Am I missing an obvious "bulk resolve" to select local versions of all files currently in conflict? My server was down for a while; now all of applications are loading stale data from the server because my fresher local files have been renamed.
ckamm commentedon Jan 29, 2019
@lowlyocean There's currently no bulk-resolve option. #5896 is an issue about providing more conflict resolution ui help but that's not yet scheduled or even fully thought through. Until then, check out the renaming console commands mentioned above.
The client tries hard to avoid creating unnecessary conflict files. For example it'll only ever do it in situations where the server reports a file change (i.e. the server file's etag differs from the locally recorded etag). If you still have information about the situation that caused conflict files to be created in a "pure backup" situation that'd be very much worth a report.
Optionally limiting client behavior for "pure backup" operation may be a worthwhile discussion to have.
lowlyocean commentedon Jan 29, 2019
It concerns me that conflict resolution is proposed as a server-side task. I'm running on a raspberry pi and try to avoid the web interface as much as possible because it is slow to load. The more the client can do, the better.
If I'm not using nextCloud for collaboration, I shouldn't see any conflicts. It should be assumed my local copies are the most recent and back them up to the server.
ckamm commentedon Jan 29, 2019
I agree that conflict resolution is usually a local task, that ticket is about giving users better support for resolving conflicts locally through the sync client.
lowlyocean commentedon Jan 29, 2019
locally through the sync clientYes, this is good. I should clarify that I was concerned about suggestion in #5896 (comment)Good work so far, I've noticed lots of improvements like reduced time for client scan for changes. Very much looking forward to DeltaSync feature