{"action":"created","issue":{"url":"https://api.github.com/repos/syncthing/syncthing/issues/1221","labels_url":"https://api.github.com/repos/syncthing/syncthing/issues/1221/labels{/name}","comments_url":"https://api.github.com/repos/syncthing/syncthing/issues/1221/comments","events_url":"https://api.github.com/repos/syncthing/syncthing/issues/1221/events","html_url":"https://github.com/syncthing/syncthing/issues/1221","id":53875775,"number":1221,"title":"Entire folder contents disappearing","user":{"login":"ropeladder","id":6224065,"avatar_url":"https://avatars.githubusercontent.com/u/6224065?v=3","gravatar_id":"","url":"https://api.github.com/users/ropeladder","html_url":"https://github.com/ropeladder","followers_url":"https://api.github.com/users/ropeladder/followers","following_url":"https://api.github.com/users/ropeladder/following{/other_user}","gists_url":"https://api.github.com/users/ropeladder/gists{/gist_id}","starred_url":"https://api.github.com/users/ropeladder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ropeladder/subscriptions","organizations_url":"https://api.github.com/users/ropeladder/orgs","repos_url":"https://api.github.com/users/ropeladder/repos","events_url":"https://api.github.com/users/ropeladder/events{/privacy}","received_events_url":"https://api.github.com/users/ropeladder/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-09T14:58:16Z","updated_at":"2015-01-14T23:52:37Z","closed_at":null,"body":"I have recently had two synced folders inexplicably empty themselves of all contents on two of my three nodes. (the nodes with the issue were on the same home network; the third node is a computer in a remote location)\r\n\r\nPossibly related, since I hadn't made any other recent configuration changes:\r\nI was having an issue similar to [885](https://github.com/syncthing/syncthing/issues/885) in two folders that were being synchronized. There were several temp files with long hashtag filenames that I deleted in several subfolders in one of the synced folders, which I don't think helped. I then tried the solution [mentioned by AudriusButkevicius](https://github.com/syncthing/syncthing/issues/885#issuecomment-68633368), which appeared to work. I used it for two different synced folders since I was getting errors for both of them, and the long filename puller errors stopped.\r\n\r\nHowever, I later noticed I was getting another error for one of the folders, something about not being able to delete a file. Going back into the directory it appeared that the one of them (but not the other) was now entirely emptied of contents. I filled it back up using a backup and took out the \"\\\\?\\\" prefix from the file headers. (in fact I think I had to recreate the folder info since I was having trouble clicking the \"save\" button for no reason)\r\n\r\nI later realized that another directory had been emptied as well, although I had never tried the \"\\\\?\\\" trick for this one. This directory was similarly emptied on two computers but not the remote third computer."},"comment":{"url":"https://api.github.com/repos/syncthing/syncthing/issues/comments/70016442","html_url":"https://github.com/syncthing/syncthing/issues/1221#issuecomment-70016442","issue_url":"https://api.github.com/repos/syncthing/syncthing/issues/1221","id":70016442,"user":{"login":"AudriusButkevicius","id":1144861,"avatar_url":"https://avatars.githubusercontent.com/u/1144861?v=3","gravatar_id":"","url":"https://api.github.com/users/AudriusButkevicius","html_url":"https://github.com/AudriusButkevicius","followers_url":"https://api.github.com/users/AudriusButkevicius/followers","following_url":"https://api.github.com/users/AudriusButkevicius/following{/other_user}","gists_url":"https://api.github.com/users/AudriusButkevicius/gists{/gist_id}","starred_url":"https://api.github.com/users/AudriusButkevicius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AudriusButkevicius/subscriptions","organizations_url":"https://api.github.com/users/AudriusButkevicius/orgs","repos_url":"https://api.github.com/users/AudriusButkevicius/repos","events_url":"https://api.github.com/users/AudriusButkevicius/events{/privacy}","received_events_url":"https://api.github.com/users/AudriusButkevicius/received_events","type":"User","site_admin":false},"created_at":"2015-01-14T23:52:37Z","updated_at":"2015-01-14T23:52:37Z","body":"Each change that syncthing detects is versioned. The fact that it wants to delete something means that I has seen some node delete it and is trying to get to that version of that particular set of files/folders.\r\n\r\nI guess there are a two possible causes.\r\n\r\nLets call node A the node getting the errors and some other node B.\r\n\r\nOne of them could happen if there is a `folder master` involved, and it goes like this:\r\nB is the folder master\r\nThere is an existing folder X with some files which both A and B have and agree to be in sync\r\nA adds new files to folder X and scans them\r\nA announces that to B but B refuses the announcements as he is folder master.\r\nNow B deletes folder X all together.\r\nB sends the deletion announcement to A\r\nA deletes all files that they agreed with B (including the folder, but not the files that A added recently)\r\nA cannot delete the folder B announced as deleted, as A itself added some files to it which B is not aware off.\r\n\r\nSecond case involves a large rescan interval at A:\r\nA adds new files to folder X, but doesn't scan them because the rescan interval hasn't yet passed\r\nA announces nothing B as he himself is not yet aware of the new files.\r\nNow B deletes folder X all together.\r\nB sends the deletion announcement to A\r\nA deletes all files that they agreed with B (including the folder, but not the files that A added recently)\r\nA cannot delete the folder B announced as deleted, as A itself added some files to it which neither A nor B is not aware off since the rescan interval hasn't happened yet.\r\n\r\nYou can trigger to dispatch updates by renaming the folder, which will cause files to be downloaded or renamed. Wait for it to get in sync and then you can rename it back.\r\n\r\nOr if you are a bit more skilled, you can bump the mtimes of the files causing them to look \"updated\".\r\n"}}