# Syncthing (sometimes) deletes files but not folders

**URL:** https://forum.syncthing.net/t/syncthing-sometimes-deletes-files-but-not-folders/5206
**Category:** Support
**Created:** [July 21, 2015, 1:28am UTC](https://forum.syncthing.net/t/syncthing-sometimes-deletes-files-but-not-folders/5206 "2015-07-21T01:28:43Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![An0](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/898d66/32.png) [@An0](https://forum.syncthing.net/u/An0)
#### Post date: [July 21, 2015, 1:28am UTC](https://forum.syncthing.net/t/syncthing-sometimes-deletes-files-but-not-folders/5206/1 "2015-07-21T01:28:43Z")

</div>

Hi guys,

Sometimes when I delete a folder with content, Syncthing deletes only the files and leaves the folder empty. This causes Syncthing to display that “Out of Sync” message:

> 02:14:03 INFO: Puller (folder “sync”, dir “New folder\test”): delete: remove \?\C:\Users\user\Sync\New folder\test: directory not empty.

Just to explain better this problem, let’s imagine we have:

> Syncthing folder
> 
> > folder 1
> > 
> > > file 1 file 2

When I delete “folder 1”, Syncthing only deletes “file 1” and “file 2” on the other computer:

> Syncthing folder
> 
> > folder 1

Anyone knows how to fix this?

I’m using Syncthing on Windows (1# SyncTrayzor v0.11.16) and OSX (2# Syncthing Bar v0.11.16)

Thanks in advance.

–

1# [SyncTrayzor: Windows host for Syncthing. Installer, auto-start, built-in browser, tray icon, folder watcher, and more](http://forum.syncthing.net/t/synctrayzor-windows-host-for-syncthing-installer-auto-start-built-in-browser-tray-icon-folder-watcher-and-more/2011) 2# [Syncthing Bar for OS-X](http://forum.syncthing.net/t/syncthing-bar-for-os-x/1582)

---

<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: [July 21, 2015, 6:47am UTC](https://forum.syncthing.net/t/syncthing-sometimes-deletes-files-but-not-folders/5206/2 "2015-07-21T06:47:20Z")

</div>

Well the directory is clearly not empty just as the error says.

---

<div class="post-metadata">

### Author: ![eyeson](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/e/b9bd4f/32.png) [@eyeson](https://forum.syncthing.net/u/eyeson)
#### Post date: [July 21, 2015, 12:14pm UTC](https://forum.syncthing.net/t/syncthing-sometimes-deletes-files-but-not-folders/5206/3 "2015-07-21T12:14:40Z")

</div>

I have been having a similar issue recently - I have many folders within a synced directoy (my music library) I have 6 peers connected in this share, occasionally when I’ve changed the music - renamed the album etc - some nodes complain that the directory isn’t empty. I then have to manually delete the files on that node before it will delete the directory. Other times it will work as expected

---

<div class="post-metadata">

### Author: ![An0](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/898d66/32.png) [@An0](https://forum.syncthing.net/u/An0)
#### Post date: [July 21, 2015, 3:17pm UTC](https://forum.syncthing.net/t/syncthing-sometimes-deletes-files-but-not-folders/5206/4 "2015-07-21T15:17:51Z")

</div>

Well, looking at the folders, they are empty. I don’t think is some hidden file because I have the “show hidden files” option active on Windows.

---

<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: [July 21, 2015, 5:09pm UTC](https://forum.syncthing.net/t/syncthing-sometimes-deletes-files-but-not-folders/5206/5 "2015-07-21T17:09:37Z")

</div>

Then syncthing will remove it after the next pull.

---

<div class="post-metadata">

### Author: ![An0](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/898d66/32.png) [@An0](https://forum.syncthing.net/u/An0)
#### Post date: [July 21, 2015, 10:32pm UTC](https://forum.syncthing.net/t/syncthing-sometimes-deletes-files-but-not-folders/5206/6 "2015-07-21T22:32:34Z")

</div>

Nope. I already rebooted both computers, restarted and updated syncthing… and the only way to fix it is by manually deleting the folder or to remove the main folder from syncthing and start again.

Let me give you an example, I have this folder “out of sync” for 4-5 days now. Aparently the problem is on the “Camera” folder, which is empty and was deleted on my other computer:

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

No hidden files:

 ![](https://forum-uploads.syncthingcdn.net/original/2X/b/bce3458a7b24ec027921774538323b4ecfc8607c.png) 

Yet, the main folder is out of sync:

 ![](https://forum-uploads.syncthingcdn.net/original/2X/9/9548d8666e17d0846d106bd878e26056e7a0e1b3.png) 

 ![](https://forum-uploads.syncthingcdn.net/original/2X/e/ed6b3c94447ea0ca860995a41f4cfd714ff60941.png) 

The error is always the same:

 ![](https://forum-uploads.syncthingcdn.net/original/2X/a/a7d893bdc11573ff31968d2f8e80cc2a5ef635f3.png)

---

<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: [July 21, 2015, 10:45pm UTC](https://forum.syncthing.net/t/syncthing-sometimes-deletes-files-but-not-folders/5206/7 "2015-07-21T22:45:35Z")

</div>

Can you cd into the directory using the command prompt and run `attrib` and `dir /ah` Otherwise it sounds like a Go bug.

If you can hack up a few lines of code, I’d be interested what Go returns when it walks the directory.

---

<div class="post-metadata">

### Author: ![An0](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/898d66/32.png) [@An0](https://forum.syncthing.net/u/An0)
#### Post date: [July 21, 2015, 11:34pm UTC](https://forum.syncthing.net/t/syncthing-sometimes-deletes-files-but-not-folders/5206/8 "2015-07-21T23:34:19Z")

</div>

Ahh… 😛 you’re right. There is content inside the folder (for some reason windows doesn’t display them, sorry!).

`attrib`:

> C:\Users\Celso\Sync\Camera\>attrib A SH C:\Users\Celso\Sync\Camera\desktop.ini A SH I C:\Users\Celso\Sync\Camera\Thumbs.db

`dir /ah`:

> C:\Users\Celso\Sync\Camera\>dir /ah Volume in drive C has no label. Volume Serial Number is CC52-3B4C

> Directory of C:\Users\Celso\Sync\Camera

> 22/07/2015 00:14 104 desktop.ini 22/07/2015 00:14 77,824 Thumbs.db 2 File(s) 77,928 bytes 0 Dir(s) 147,447,742,464 bytes free

So, now my question is… how to avoid this? Can this be related to the fact that I have both “desktop.ini” and “Thumbs.db” on my `.stignore` file?

---

<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: [July 21, 2015, 11:35pm UTC](https://forum.syncthing.net/t/syncthing-sometimes-deletes-files-but-not-folders/5206/9 "2015-07-21T23:35:55Z")

</div>

Yes it’s due to ignores, this is a known problem, and there currently isn’t a solution around it, apart from syncing these files.

---

<div class="post-metadata">

### Author: ![An0](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/a/898d66/32.png) [@An0](https://forum.syncthing.net/u/An0)
#### Post date: [July 21, 2015, 11:46pm UTC](https://forum.syncthing.net/t/syncthing-sometimes-deletes-files-but-not-folders/5206/10 "2015-07-21T23:46:49Z")

</div>

I understand. Thank you for your time and help!

---

<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: [May 12, 2017, 12:59pm UTC](https://forum.syncthing.net/t/syncthing-sometimes-deletes-files-but-not-folders/5206/11 "2017-05-12T12:59:13Z")

</div>


