# Syncthing generates a lot of "sync-conflict" files

**URL:** https://forum.syncthing.net/t/syncthing-generates-a-lot-of-sync-conflict-files/5914
**Category:** Support
**Created:** [October 18, 2015, 3:17pm UTC](https://forum.syncthing.net/t/syncthing-generates-a-lot-of-sync-conflict-files/5914 "2015-10-18T15:17:05Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![FlashMustache](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/f/f1d935/32.png) [@FlashMustache](https://forum.syncthing.net/u/FlashMustache)
#### Post date: [October 18, 2015, 3:17pm UTC](https://forum.syncthing.net/t/syncthing-generates-a-lot-of-sync-conflict-files/5914/1 "2015-10-18T15:17:05Z")

</div>

So, today I made a backup of an SD card with dd (the Unix utility). This was on my laptop, whilst my desktop was powered with Syncthing running. I did not touch the backup file on my desktop as it was being synced, however Syncthing managed to create _ **6** _ sync-conflict files. 6! Whilst my desktop didn’t make any modifications to the file! It even made a sync-conflict for _another_ sync-conflict.

(File at the top is the original file)

![](https://forum-uploads.syncthingcdn.net/original/2X/4/43ee5644ab656add2d1e56adfbae8bb4be06dbd9.png)

This is not the first time I’ve seen this. Syncthing litters all my shared directories with “sync-conflict” files. I share some git projects between my devices with Syncthing and I have seen it create entire new branches with “sync-conflict” in the name, but this is by far the worst I have seen. I came from Btsync and it didn’t have these issues (it had other issues, however). So, basically I have two questions:

- How do I stop Syncthing from making sync-conflict files when there’s obviously no conflict?
- How do I get Syncthing to put its sync-conflict files in some other directory (like Btsync did/does), so that they do not interfere with special programs reading the files

I still want sync-conflict files when an actual concurrent modification occurred. I don’t wanna lose work.

Both my systems run Ubuntu. My laptop runs 14.04 LTS and my desktop 15.04, both x64. My file systems are ext4 everywhere and I haven’t done any special stuff like running a custom kernel.

Syncthing is awesome, and I would love it if this could be fixed. Thank you for your time.

---

<div class="post-metadata">

### Author: ![canton7](https://forum.syncthing.net/user_avatar/forum.syncthing.net/canton7/32/9528_2.png) [@canton7](https://forum.syncthing.net/u/canton7)
#### Post date: [October 18, 2015, 3:23pm UTC](https://forum.syncthing.net/t/syncthing-generates-a-lot-of-sync-conflict-files/5914/2 "2015-10-18T15:23:12Z")

</div>

> [@FlashMustache](#):
>
> How do I stop Syncthing from making sync-conflict files when there’s obviously no conflict?

I think you’ll actually have to show that there’s no conflict here - i.e. that the “Foo.sync-conflict.xxx” has exactly the same content as the corresponding “Foo” file.

---

<div class="post-metadata">

### Author: ![FlashMustache](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/f/f1d935/32.png) [@FlashMustache](https://forum.syncthing.net/u/FlashMustache)
#### Post date: [October 18, 2015, 3:34pm UTC](https://forum.syncthing.net/t/syncthing-generates-a-lot-of-sync-conflict-files/5914/3 "2015-10-18T15:34:36Z")

</div>

@canton7 thank you for your response

The contents of the various sync-conflict files are obviously not the same as the file sizes differ (by quite a bit). I think it made the files whilst the original file backup was growing to the size it is now. I think it went a bit like this:

- Sync the file with my desktop
- Notice the file on my desktop is no longer the same as the one on my laptop
- Create a sync-conflict copy on my laptop

However, it shouldn’t do that if the file on my desktop was never modified.

---

<div class="post-metadata">

### Author: ![canton7](https://forum.syncthing.net/user_avatar/forum.syncthing.net/canton7/32/9528_2.png) [@canton7](https://forum.syncthing.net/u/canton7)
#### Post date: [October 18, 2015, 3:38pm UTC](https://forum.syncthing.net/t/syncthing-generates-a-lot-of-sync-conflict-files/5914/4 "2015-10-18T15:38:54Z")

</div>

If it did do this, that would be a fairly large bug in the way that Syncthing’s versioning system works. You’ll have to provide some evidence / a reproducible case which shows that this is actually happening.

Until that point, it’s most likely that the file on your desktop was changed. Might git have done this? Were you using the git repo on your desktop?

---

<div class="post-metadata">

### Author: ![FlashMustache](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/f/f1d935/32.png) [@FlashMustache](https://forum.syncthing.net/u/FlashMustache)
#### Post date: [October 18, 2015, 3:43pm UTC](https://forum.syncthing.net/t/syncthing-generates-a-lot-of-sync-conflict-files/5914/5 "2015-10-18T15:43:05Z")

</div>

No, this was not inside a git repository (sorry for the confusion there). The only thing that I can think of that might have touched the file is Gnomes search indexing system, but it would never write to it. It could however read from it and with that change some timestamps?

Do you know what triggers a resync in Syncthing? Does it actually check the contents of the file (by MD5sum or something like that) or does it work based on timestamps?

---

<div class="post-metadata">

### Author: ![canton7](https://forum.syncthing.net/user_avatar/forum.syncthing.net/canton7/32/9528_2.png) [@canton7](https://forum.syncthing.net/u/canton7)
#### Post date: [October 18, 2015, 3:48pm UTC](https://forum.syncthing.net/t/syncthing-generates-a-lot-of-sync-conflict-files/5914/6 "2015-10-18T15:48:25Z")

</div>

I think it’s timestamp, backed up by a sha256 hash. Certainly once we get as far as [the protocol](http://docs.syncthing.net/specs/bep-v1.htm) everything’s done based on the sha256 hash of a 128 KiB block. Versioning is handled by [vector clocks](http://docs.syncthing.net/draft/localver.html), which correctly handles multiple changes by multiple devices, even when they are not directly connected.

It may be that an mtime update triggers a version bump, since the mtime is considered part of the metadata which is synced (I think?). @calmh?

---

<div class="post-metadata">

### Author: ![wweich](https://forum.syncthing.net/user_avatar/forum.syncthing.net/wweich/32/1063_2.png) [@wweich](https://forum.syncthing.net/u/wweich)
#### Post date: [October 18, 2015, 4:33pm UTC](https://forum.syncthing.net/t/syncthing-generates-a-lot-of-sync-conflict-files/5914/7 "2015-10-18T16:33:20Z")

</div>

Changing the mtime will cause a new version and a sync. _(This was a big problem for the Android version before we had virtual mtimes)._

But the search indexing should never change the mtime, but only the atime (if at all). So it cannot be the source of the conflicts.

---

<div class="post-metadata">

### Author: ![FlashMustache](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/f/f1d935/32.png) [@FlashMustache](https://forum.syncthing.net/u/FlashMustache)
#### Post date: [October 18, 2015, 4:44pm UTC](https://forum.syncthing.net/t/syncthing-generates-a-lot-of-sync-conflict-files/5914/8 "2015-10-18T16:44:50Z")

</div>

Thank you both for your in-depth responses!

So basically, what you are saying is that there’s no way that Syncthing syncs a file without a program actually modifying it. In other words, I need to go find whatever program felt like it had to write to the file? Is there any easy way to do that?

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [October 18, 2015, 6:32pm UTC](https://forum.syncthing.net/t/syncthing-generates-a-lot-of-sync-conflict-files/5914/9 "2015-10-18T18:32:03Z")

</div>

You can run with STTRACE=scanner env var set on the device which is supposedly not touching the file, to see it pick up the changes to prove the point that it is being modified by something.

Also, if you are syncthing git repos, you are begging for trouble. git is not a single file, it’s a collection of files, and suddenly syncing some files from two different locations of the same state will probably make you loose that repo in both locations, as you will get it corrupt.

---

<div class="post-metadata">

### Author: ![submarine](https://forum.syncthing.net/user_avatar/forum.syncthing.net/submarine/32/8722_2.png) [@submarine](https://forum.syncthing.net/u/submarine)
#### Post date: [November 15, 2015, 2:08pm UTC](https://forum.syncthing.net/t/syncthing-generates-a-lot-of-sync-conflict-files/5914/10 "2015-11-15T14:08:29Z")

</div>

I had a similar problem and wrote a little script to get rid of all the identical “conflict” files.[clean up syncting mess v2.ps1](https://forum-uploads.syncthingcdn.net/original/2X/8/84098d716485b6a179fa577663d8287ee801e1f0.ps1) (2.8 KB) It is a windows powershell script. It compares the hashes of all files in a folder and leaves only one. Then it renames the latest file to the original name. You can try it if you know what you do. It comes with no warranty whatsoever. You should know what you do. It delets files!

---

<div class="post-metadata">

### Author: ![system](https://forum-uploads.syncthingcdn.net/original/2X/0/0b50e0a202b22ae6a67190759e8c868805b8ed9f.png) [@system](https://forum.syncthing.net/u/system)
#### Post date: [December 15, 2015, 2:08pm UTC](https://forum.syncthing.net/t/syncthing-generates-a-lot-of-sync-conflict-files/5914/11 "2015-12-15T14:08:46Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

### Author: ![canton7](https://forum.syncthing.net/user_avatar/forum.syncthing.net/canton7/32/9528_2.png) [@canton7](https://forum.syncthing.net/u/canton7)
#### Post date: [October 15, 2019, 9:56am UTC](https://forum.syncthing.net/t/syncthing-generates-a-lot-of-sync-conflict-files/5914/13 "2019-10-15T09:56:32Z")

</div>

For anyone browsing, didi1357 wrote a python script which apparently does something similar to the powershell script above: [https://github.com/didi1357/SyncMessCleaner](https://github.com/didi1357/SyncMessCleaner)
