# Directory deletion on remote computer

**URL:** https://forum.syncthing.net/t/directory-deletion-on-remote-computer/15941
**Category:** Support
**Created:** [November 28, 2020, 1:05pm UTC](https://forum.syncthing.net/t/directory-deletion-on-remote-computer/15941 "2020-11-28T13:05:56Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![dbf22](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/d/b487fb/32.png) [@dbf22](https://forum.syncthing.net/u/dbf22)
#### Post date: [November 28, 2020, 1:05pm UTC](https://forum.syncthing.net/t/directory-deletion-on-remote-computer/15941/1 "2020-11-28T13:05:56Z")

</div>

Hello,

Perhaps a basic question here but I couldn’t find an answer on other posts, and first time posting here.

A lot of directories have been deleted along with the files within them on a computer that had sync in pause. We’re talking several 10000’s files. Upon restarting to sync with other computers, I get : _syncing: delete dir: directory has been deleted on a remote device but is not empty; the contents are probably ignored on that remote device, but not locally_

Is there a way I can let those directories now be deleted locally?

Thanks!

---

<div class="post-metadata">

### Author: ![imsodin](https://forum.syncthing.net/user_avatar/forum.syncthing.net/imsodin/32/3317_2.png) [@imsodin](https://forum.syncthing.net/u/imsodin)
#### Post date: [November 28, 2020, 1:43pm UTC](https://forum.syncthing.net/t/directory-deletion-on-remote-computer/15941/2 "2020-11-28T13:43:16Z")

</div>

What the error says, is that the directory contains valid files, and Syncthing won’t delete those files on it’s own. Thus it can’t delete the directory itself. You either need to delete the files in those directories manually, or you need to add them to your ignore patterns with a (?d) prefix to allow Syncthing to delete them.

@AudriusButkevicius @calmh Shouldn’t we just resurrect that directory? I mean if it was deleted on a remote because it is empty there due to ignores, but there’s valid (not ignored) files inside the directory locally, re-creating the directory leads to a more consistent end result. We already do that the other way around: If locally the directory was deleted, and we pull a valid file inside that directory, we recreate it.

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [November 28, 2020, 4:45pm UTC](https://forum.syncthing.net/t/directory-deletion-on-remote-computer/15941/3 "2020-11-28T16:45:16Z")

</div>

It’d be kind of weird on the other side though, you delete a directory and _pop_ it reappears again, every time.

---

<div class="post-metadata">

### Author: ![imsodin](https://forum.syncthing.net/user_avatar/forum.syncthing.net/imsodin/32/3317_2.png) [@imsodin](https://forum.syncthing.net/u/imsodin)
#### Post date: [November 28, 2020, 5:13pm UTC](https://forum.syncthing.net/t/directory-deletion-on-remote-computer/15941/4 "2020-11-28T17:13:35Z")

</div>

True. Neither solution is particularly good. As it is now, it isn’t only causing confusion, there’s also no simple way forward to keep the directory. You have to touch every affected directory to get it rescanned. However in most situations differing ignore patterns will be the culprit, in which case fixing that is the way forward. So yeah, I guess keep it as is and explain it in a support request every now and then 🙂

---

<div class="post-metadata">

### Author: ![terry](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/t/b9e5f3/32.png) [@terry](https://forum.syncthing.net/u/terry)
#### Post date: [December 9, 2020, 12:52pm UTC](https://forum.syncthing.net/t/directory-deletion-on-remote-computer/15941/5 "2020-12-09T12:52:13Z")

</div>

i’m getting the same thing, however i’m leaning slightly towards a bug.

On the send only end, one of the St folders has “(?d) rentals.pst” in the ignore. Nothing else. However the folders which are saying they can’t be deleted locally (RO end) do not contain this file, nor anything close to this file.

The PST is buried in a totally unrelated windows folder, but St seems to be globally deciding that all windows folders can’t be deleted because there is an ‘ignore’ in place regardless of whether or not the ignored file is in there.

SO end

 ![image](https://forum-uploads.syncthingcdn.net/original/2X/6/67bb2f259dd5e68813835f5ca7a2222585a9c920.png)

 ![image](https://forum-uploads.syncthingcdn.net/original/2X/f/f927dd743ca408cedcaa8882ff6b0e9885c56bfa.png)

 ![image](https://forum-uploads.syncthingcdn.net/original/2X/c/c39cac228c60d7bef310dbfaab03d42dbe0210f2.png)

RO end

 ![image](https://forum-uploads.syncthingcdn.net/original/2X/3/3da226cec997bca8cc36805514f3b8fddc8694ef.png)

 ![image](https://forum-uploads.syncthingcdn.net/original/2X/0/0295901ecc3c7dd760c1f2ca1426c393008d889a.png)

There’s also a discrepancy in the RO ends local state. Apparently the receiving end is showing 829 more files yet the SO end says it’s all fine. Don’t know if the mismatch is related.

1.12.1-rc-1 both ends

---

<div class="post-metadata">

### Author: ![imsodin](https://forum.syncthing.net/user_avatar/forum.syncthing.net/imsodin/32/3317_2.png) [@imsodin](https://forum.syncthing.net/u/imsodin)
#### Post date: [December 9, 2020, 1:24pm UTC](https://forum.syncthing.net/t/directory-deletion-on-remote-computer/15941/6 "2020-12-09T13:24:01Z")

</div>

> [@terry](#):
>
> “(?d) rentals.pst”

I guess it’s just a typo here on the foru, but that space looks spurious.

> [@terry](#):
>
> The PST is buried in a totally unrelated windows folder, but St seems to be globally deciding that all windows folders can’t be deleted because there is an ‘ignore’ in place regardless of whether or not the ignored file is in there.

What’s the error you get? The one in the OP `syncing: delete dir: directory has been deleted on a remote device but is not empty; the contents are probably ignored on that remote device, but not locally` is about not having ignores, not about having “wrong” ignores.  
If you did get the same error: Did you check in the filesystem what it is that exists within those directories?

---

<div class="post-metadata">

### Author: ![terry](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/t/b9e5f3/32.png) [@terry](https://forum.syncthing.net/u/terry)
#### Post date: [December 9, 2020, 1:47pm UTC](https://forum.syncthing.net/t/directory-deletion-on-remote-computer/15941/7 "2020-12-09T13:47:06Z")

</div>

typo

im seeing

 ![image](https://forum-uploads.syncthingcdn.net/original/2X/6/68e1a6aa28539c3994ee8dce70c1077497986e43.png)

if the snip is too small..

syncing: delete dir: directory has been deleted on a remote device but is not empty; the contents are probably ignored on that remote device, but not locally

essentially the SO end’s directory have been removed (probably renamed looking at the file name), however on the RO end they still exist, for example…

SO

![image](https://forum-uploads.syncthingcdn.net/original/2X/8/8299e25a588be35e0d46fc5101e136306e1b254d.png)

RO

![image](https://forum-uploads.syncthingcdn.net/original/2X/3/3ac68324c2234809616ef9aa39d076e7ec06fb15.png)

The others are also the same, directories no longer existing on the SO end are not being deleted on the RO end

---

<div class="post-metadata">

### Author: ![terry](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/t/b9e5f3/32.png) [@terry](https://forum.syncthing.net/u/terry)
#### Post date: [December 9, 2020, 1:59pm UTC](https://forum.syncthing.net/t/directory-deletion-on-remote-computer/15941/8 "2020-12-09T13:59:58Z")

</div>

Looking at some of the other directories that are not syncing, they were either renamed (as above) or moved to another sub directory. Therefore I wonder if St knows the file / directory does exist in the database but rather than updating the receive only structure to reflect the changes, it stops with the error

edit - I done a couple of tests, both in folders with and without ignores and St is working as expected. so not really sure why it’s refusing to update the local directories. I wonder if I need to force a reindex?

---

<div class="post-metadata">

### Author: ![imsodin](https://forum.syncthing.net/user_avatar/forum.syncthing.net/imsodin/32/3317_2.png) [@imsodin](https://forum.syncthing.net/u/imsodin)
#### Post date: [December 9, 2020, 2:39pm UTC](https://forum.syncthing.net/t/directory-deletion-on-remote-computer/15941/9 "2020-12-09T14:39:49Z")

</div>

My question is: Is there anything in that directory on RO, i.e. if you open “3 Oak Court\Originals” or “2008” what is in there? Syncthing believes there’s still stuff in there and thus refuses to remove those directories.

---

<div class="post-metadata">

### Author: ![terry](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/t/b9e5f3/32.png) [@terry](https://forum.syncthing.net/u/terry)
#### Post date: [December 9, 2020, 2:49pm UTC](https://forum.syncthing.net/t/directory-deletion-on-remote-computer/15941/10 "2020-12-09T14:49:25Z")

</div>

Yes, the query RO end directories all have the original files.

I would expect them to mirror what’s happened at the SO end, renames / moves etc. But in my test, the moves and renames worked, I don’t understand why random directories should fail to update.

I wonder if the error is ambiguous as

_directory has been deleted on a remote device but is not empty; the contents are probably ignored on that remote device, but not locally_

isn’t exactly whats happened. The directory on the remote device no longer exists, therefore ‘is’ empty

---

<div class="post-metadata">

### Author: ![imsodin](https://forum.syncthing.net/user_avatar/forum.syncthing.net/imsodin/32/3317_2.png) [@imsodin](https://forum.syncthing.net/u/imsodin)
#### Post date: [December 9, 2020, 2:57pm UTC](https://forum.syncthing.net/t/directory-deletion-on-remote-computer/15941/11 "2020-12-09T14:57:03Z")

</div>

The error is about the local situation, the situation in your RO folder. It doesn’t matter if it’s empty on the remote/SO.

Are the files that are contained there-in ignored on SO? Folder types don’t matter if the file is ignored: RO can’t mirror SO when it comes to stuff that SO has ignored (_not_ deleted). Or differently put a folder only deletes items when it is commanded to, and your remote ignores those items, which means it doesn’t command anything regarding those items.

Example:

A and B have `foo/bar`. Then A ignores `bar` and renames `foo` to `notfoo`. Thus A tells B to delete `foo`, create `notfoo` and `notfoo/bar` and that it doesn’t care about `foo/bar` anymore. B reacts by attempting to remove `foo`, noticing there’s `foo/bar` that exists and is supposed to exist (noone ever told B to remove it), thus it tells the user that it can’t delete `foo` and needs help to know what is the correct way forward (delete `foo/bar` or recreate `foo`).

---

<div class="post-metadata">

### Author: ![terry](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/t/b9e5f3/32.png) [@terry](https://forum.syncthing.net/u/terry)
#### Post date: [December 9, 2020, 3:07pm UTC](https://forum.syncthing.net/t/directory-deletion-on-remote-computer/15941/12 "2020-12-09T15:07:09Z")

</div>

> The error is about the local situation, the situation in your RO folder. It doesn’t matter if it’s empty on the remote/SO.

ok, I misread that, it makes sense now

> Are the files that are contained there-in ignored on SO? Folder types don’t matter if the file is ignored: RO can’t mirror SO when it comes to stuff that SO has ignored ( _not_ deleted). Or differently put a folder only deletes items when it is commanded to, and your remote ignores those items, which means it doesn’t command anything regarding those items.

no, the only ignore that’s in place on the folder was to stop one pst file being synced to me constantly as it’s a live outlook archive. The files that are in question comprise mainly of jpgs and docs

![image](https://forum-uploads.syncthingcdn.net/original/2X/3/3e4d1cad99124c47713991fd89fa6bea6be8e217.png)

I only added the (?d) recently based on your earlier reply to the OP. It didn’t make a difference.

---

<div class="post-metadata">

### Author: ![imsodin](https://forum.syncthing.net/user_avatar/forum.syncthing.net/imsodin/32/3317_2.png) [@imsodin](https://forum.syncthing.net/u/imsodin)
#### Post date: [December 9, 2020, 3:18pm UTC](https://forum.syncthing.net/t/directory-deletion-on-remote-computer/15941/13 "2020-12-09T15:18:13Z")

</div>

Just to be sure: You don’t have any ignores except that one on both RO and SO, and there’s no `rental.pst` in any of the directories mentioned in the errors?

---

<div class="post-metadata">

### Author: ![terry](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/t/b9e5f3/32.png) [@terry](https://forum.syncthing.net/u/terry)
#### Post date: [December 9, 2020, 3:28pm UTC](https://forum.syncthing.net/t/directory-deletion-on-remote-computer/15941/14 "2020-12-09T15:28:15Z")

</div>

Ignore only on SO, no ignore on RO - I didn’t think it would be necessary to have the same ignore on both sides.

the ignored pst is in a totally different folder

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

whereas the other directories that are not in sync in different locations, eg

SO

![image](https://forum-uploads.syncthingcdn.net/original/2X/6/680784c7091aa6ea4ed864bbfd40840903366b67.png)

RO

![image](https://forum-uploads.syncthingcdn.net/original/2X/1/1228d7c5f25db2e975de4eeabe6ed2a50614aca8.png)

---

<div class="post-metadata">

### Author: ![imsodin](https://forum.syncthing.net/user_avatar/forum.syncthing.net/imsodin/32/3317_2.png) [@imsodin](https://forum.syncthing.net/u/imsodin)
#### Post date: [December 9, 2020, 3:59pm UTC](https://forum.syncthing.net/t/directory-deletion-on-remote-computer/15941/15 "2020-12-09T15:59:29Z")

</div>

Do the ignores on SO match any of the files present in the directories that create an error on RO? Or somewhat equivalently: If you add the same ignore patterns on RO as on SO, does the problem go away?

---

<div class="post-metadata">

### Author: ![terry](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/t/b9e5f3/32.png) [@terry](https://forum.syncthing.net/u/terry)
#### Post date: [December 9, 2020, 4:36pm UTC](https://forum.syncthing.net/t/directory-deletion-on-remote-computer/15941/16 "2020-12-09T16:36:07Z")

</div>

The ignore does not match to any file in the affected directories. It’s only for one file thats located in the zzITfiles - as shown on the snips

I added the same ignore “(?d)rentals.pst” to the RO end, it took a while to scan but no change.

---

<div class="post-metadata">

### Author: ![imsodin](https://forum.syncthing.net/user_avatar/forum.syncthing.net/imsodin/32/3317_2.png) [@imsodin](https://forum.syncthing.net/u/imsodin)
#### Post date: [December 9, 2020, 4:41pm UTC](https://forum.syncthing.net/t/directory-deletion-on-remote-computer/15941/17 "2020-12-09T16:41:53Z")

</div>

> [@terry](#):
>
> Ignore only on SO, no ignore on RO - I didn’t think it would be necessary to have the same ignore on both sides.

I misinterpreted this as meaning "there’s more than just (?d)rentals.pst in SO’s patterns. Then it’s unclear what is going on here.

Could you grab the output of [GET /rest/db/file — Syncthing documentation](https://docs.syncthing.net/rest/db-file-get.html) (or even better `/rest/debug/file` which works the same but has more info) for any of the files inside the directories that cause the errors please.

---

<div class="post-metadata">

### Author: ![terry](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/t/b9e5f3/32.png) [@terry](https://forum.syncthing.net/u/terry)
#### Post date: [December 9, 2020, 4:44pm UTC](https://forum.syncthing.net/t/directory-deletion-on-remote-computer/15941/18 "2020-12-09T16:44:06Z")

</div>

> [@imsodin](#):
>
> Could you grab the output of [GET /rest/db/file — Syncthing documentation](https://docs.syncthing.net/rest/db-file-get.html) (or even better `/rest/debug/file` which works the same but has more info) for any of the files inside the directories that cause the errors please.

On the SO or RO side?

---

<div class="post-metadata">

### Author: ![imsodin](https://forum.syncthing.net/user_avatar/forum.syncthing.net/imsodin/32/3317_2.png) [@imsodin](https://forum.syncthing.net/u/imsodin)
#### Post date: [December 9, 2020, 4:48pm UTC](https://forum.syncthing.net/t/directory-deletion-on-remote-computer/15941/19 "2020-12-09T16:48:26Z")

</div>

RO or both 🙂

---

<div class="post-metadata">

### Author: ![terry](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/t/b9e5f3/32.png) [@terry](https://forum.syncthing.net/u/terry)
#### Post date: [December 9, 2020, 5:48pm UTC](https://forum.syncthing.net/t/directory-deletion-on-remote-computer/15941/20 "2020-12-09T17:48:24Z")

</div>

I struggle (and panic) at the sight of rests and API as im on Windows, however we had a similar thread back in Feb 18 which I referred back to. Anyway, the output keeps failing..

I took a random filename from one of the affected directories on the RO side and got this

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

I’m sure that I have everything right, file paths etc, and based on your Feb 18 comment (I had the same PS error that time too)

> The command itself is actually fine, it just responded that there is no such file (“No such object in the index”). Is the file actually in the folder root? If it’s in a sub-directory, you need to give the path relative to the root (e.g. `file=foo/00b7974a-0000-0000-0000-00093d000000.vhdx` ).

I wonder if it’s not in the db and hence can’t be processed / synced. Perhaps it’s easier to reindex and see what happens?

[Next page](https://forum.syncthing.net/t/directory-deletion-on-remote-computer/15941.md?page=2)
