Conflict files after network outage

Syncthing version: syncthing v1.2.2 “Fermium Flea” (go1.12.9 linux-amd64) deb@build.syncthing.net 2019-08-15 13:51:09 UTC

I found out that if two nodes are performing a change locally on there files during a network outage no sync files are getting generated.

Simulation of network issue: I crated iptables rule on node2 to disallow inbound/outbound connections for syncthing at 13:27 and flushed the rules at 13:48 During that time, I changed the same file on both nodes with different values

node1 logs: [NODE1] 13:27:49.939797 /opt/tcagent/syncthing-1-work/174e136266f8a219/lib/model/model.go:1434: INFO: Connection to NODE2XX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX at 192.168.0.197:22000-192.168.0.198:33302/tcp-server/TLS1.2-TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 closed: read timeout
[NODE1] 13:48:57.145423 /opt/tcagent/syncthing-1-work/174e136266f8a219/lib/connections/service.go:318: INFO: Established secure connection to NODE2XX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX at 192.168.0.199:54623-192.168.0.197:22000/tcp-client/TLS1.2-TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 [NODE1] 13:48:57.146522 /opt/tcagent/syncthing-1-work/174e136266f8a219/lib/model/model.go:1864: INFO: Device NODE2XX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX client is “syncthing v1.2.2” named “node2” at 192.168.0.199:54623-192.168.0.197:22000/tcp-client/TLS1.2-TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384

node2 logs: [NODE2] 13:27:49.948873 /opt/tcagent/syncthing-1-work/174e136266f8a219/lib/model/model.go:1434: INFO: Connection to NODE1XX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX at 192.168.0.198:33302-192.168.0.197:22000/tcp-client/TLS1.2-TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 closed: read timeout [NODE2] 13:48:57.158603 /opt/tcagent/syncthing-1-work/174e136266f8a219/lib/connections/service.go:318: INFO: Established secure connection to NODE1XX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX at 192.168.0.197:22000-192.168.0.199:54623/tcp-server/TLS1.2-TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 [NODE2] 13:48:57.158670 /opt/tcagent/syncthing-1-work/174e136266f8a219/lib/model/model.go:1864: INFO: Device NODE1XX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX client is “syncthing v1.2.2” named “node1” at 192.168.0.197:22000-192.168.0.199:54623/tcp-server/TLS1.2-TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384

Nothing in the logs mentioned after the re-joins that a file was change or better a conflict was created/detected (no conflict file was generated).

Changes at the same time on both nodes: node1 logs: [NODE1] 13:58:13.741390 /opt/tcagent/syncthing-1-work/174e136266f8a219/lib/model/folder_sendrecv.go:1775: INFO: Puller (folder “mysyncthingtestfolder” (mysyncthingtestfolder), item “blafu”): handling file: file modified but not rescanned; will try again later [NODE1] 13:58:13.774286 /opt/tcagent/syncthing-1-work/174e136266f8a219/lib/model/folder_sendrecv.go:1775: INFO: Puller (folder “mysyncthingtestfolder” (mysyncthingtestfolder), item “blafu”): handling file: file modified but not rescanned; will try again later [NODE1] 13:58:13.799102 /opt/tcagent/syncthing-1-work/174e136266f8a219/lib/model/folder_sendrecv.go:1775: INFO: Puller (folder “mysyncthingtestfolder” (mysyncthingtestfolder), item “blafu”): handling file: file modified but not rescanned; will try again later [NODE1] 13:58:13.800025 /opt/tcagent/syncthing-1-work/174e136266f8a219/lib/model/folder.go:142: INFO: Folder “mysyncthingtestfolder” (mysyncthingtestfolder) isn’t making sync progress - retrying in 1m0.081608811s.

node2 logs: no logs generated

In this case, syncthing created as expected the conflict file.

Maybe this is something which would be good to have, because a network outage can happen.

Conflict files have no dependency on network connectivity.

Try to reproduce it again, and if you can, write up a detailed step by step guide (not random blob of text) how to reproduce it.

Hi, i tried it already some times and its always the same.

For reproducing:

  1. Disallow the connectivity between the nodes over the network (e.g. I did it with iptables on node2) ssh node2 > become root and placed iptables rules iptables -A INPUT -s -j DROP iptables -A OUTPUT -d -j DROP

  2. After some minutes you will see in the syncthing log that the connections are timeing out

  3. connect (ssh) to both nodes and change the same file but with differnt conntent

  4. wait some minutes (I waited for 20min)

  5. allow again the networc conectivity between the nodes (e.g. I just flushed the iptable ruleset with iptables -F) and stay connected to the nodes

  6. after the next sync happens the files are getting synced but without generating a conflict file

I presume you rescanned the folders after the modification?