# Rmdirs is attempting to delete not empty directory with \*.gform files

**URL:** <https://forum.rclone.org/t/rmdirs-is-attempting-to-delete-not-empty-directory-with-gform-files/54233>\
**Category:** Suspected Bug\
**Created:** [September 10, 2026, 3:10pm UTC](https://forum.rclone.org/t/rmdirs-is-attempting-to-delete-not-empty-directory-with-gform-files/54233 "2026-09-10T15:10:11Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![purjolok](https://forum.rclone.org/letter_avatar_proxy/v4/letter/p/b3f665/32.png) [@purjolok](https://forum.rclone.org/u/purjolok)\
**Post date:** [September 10, 2026, 3:10pm UTC](https://forum.rclone.org/t/rmdirs-is-attempting-to-delete-not-empty-directory-with-gform-files/54233/1 "2026-09-10T15:10:11Z")

</div>

#### What is the problem you are having with rclone?

rmdirs is attempting to delete not empty directory with \*.gform files and I do not expect it to do this as the directory/folder is not empty as I see it.

#### Run the command 'rclone version' and share the full output of the command.

```auto
rclone v1.75.1
- os/version: Microsoft Windows 11 Pro 25H2 25H2 (64 bit)
- os/kernel: 10.0.26200.9445 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.26.8
- go/linking: static
- go/tags: cmount

```

#### Which cloud storage system are you using? (eg Google Drive)

```auto
Google Drive

```

#### The command you were trying to run (eg `rclone copy /tmp remote:tmp`)

```auto
`rclone rmdirs gdrv:"_redacted/form" --dry-run -v`

```

well i am actually trying to run it for real.. but discovered it was not finding files ending in \*.gform and so wants to delete these directories!?

#### The rclone config contents with secrets removed.

```auto
[gdrv]
type = drive
client_id = XXX
client_secret = XXX
scope = drive
token = XXX
team_drive =

[synth]
type = local

```

#### A log from the command with the `-vv` flag

```auto

PS C:\WINDOWS\system32> C:\code\rclone\rclone rmdirs gdrv:"_REDACTED/form" --dry-run -vv
2026/09/10 16:32:09 DEBUG : rclone: Version "v1.75.1" starting with parameters ["C:\\code\\rclone\\rclone.exe" "rmdirs" "gdrv:_REDACTED/form" "--dry-run" "-vv"]
2026/09/10 16:32:09 DEBUG : Creating backend with remote "gdrv:_REDACTED/form"
2026/09/10 16:32:09 DEBUG : Using config file from "C:\\Users\\REDACTED_USER\\AppData\\Roaming\\rclone\\rclone.conf"
2026/09/10 16:32:09 DEBUG : Google drive root '_REDACTED/form': 'root_folder_id = 0AG_REDACTED_PVA' - save this in the config to speed up startup
2026/09/10 16:32:10 DEBUG : REDACTED_file: No export formats found for "application/vnd.google-apps.form"
2026/09/10 16:32:10 DEBUG : REDACTED_file2: No export formats found for "application/vnd.google-apps.form"
2026/09/10 16:32:10 DEBUG : removing 1 level 0 directories
2026/09/10 16:32:10 NOTICE: Google drive root '_REDACTED/form': Skipped remove directory as --dry-run is set
2026/09/10 16:32:10 DEBUG : 3 go routines active

```

so it seems to recognize that there are files in the folder but says ``` no export formats found..```

I have also tried to run this with  
--drive-skip-gdocs=false or --drive-skip-gdocs=true  
gives the same output BUT for example when i create a gdoc file such as \*.gsheet then it does not any longer want to remove the folder, basically the lines debug:removing 1... AND notice: google... are not provided.

---

<div class="post-metadata">

**Author:** ![asdffdsa](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/848f3c/32.png) [@asdffdsa](https://forum.rclone.org/u/asdffdsa)\
**Post date:** [September 10, 2026, 3:52pm UTC](https://forum.rclone.org/t/rmdirs-is-attempting-to-delete-not-empty-directory-with-gform-files/54233/2 "2026-09-10T15:52:10Z")

</div>

welcome to the forum,

to make sure we do not delete files real files, create a test folder.  
post the contents using `rclone lsd` and `rclone ls`

---

<div class="post-metadata">

**Author:** ![purjolok](https://forum.rclone.org/letter_avatar_proxy/v4/letter/p/b3f665/32.png) [@purjolok](https://forum.rclone.org/u/purjolok)\
**Post date:** [September 10, 2026, 4:42pm UTC](https://forum.rclone.org/t/rmdirs-is-attempting-to-delete-not-empty-directory-with-gform-files/54233/3 "2026-09-10T16:42:01Z")

</div>

thanks!

ok I duplicated a form in [forms.google.com](http://forms.google.com) into the temp directory (i was unable to drag/drop them).

output was as follows for the commands given on the directory (i ran with -vv as otherwise there was no output ):

```auto
PS C:\WINDOWS\system32> C:\code\rclone\rclone lsd gdrv:temp
PS C:\WINDOWS\system32> C:\code\rclone\rclone lsd gdrv:temp -vv
2026/09/10 18:38:22 DEBUG : rclone: Version "v1.75.1" starting with parameters ["C:\\code\\rclone\\rclone.exe" "lsd" "gdrv:temp" "-vv"]
2026/09/10 18:38:22 DEBUG : Creating backend with remote "gdrv:temp"
2026/09/10 18:38:22 DEBUG : Using config file from "C:\\Users\\REDACTED_USER\\AppData\\Roaming\\rclone\\rclone.conf"
2026/09/10 18:38:22 DEBUG : Google drive root 'temp': 'root_folder_id = 0AG_REDACTED_PVA' - save this in the config to speed up startup
2026/09/10 18:38:23 DEBUG : rclone_rmdirs_test_form: No export formats found for "application/vnd.google-apps.form"
2026/09/10 18:38:23 DEBUG : 3 go routines active

PS C:\WINDOWS\system32> C:\code\rclone\rclone ls gdrv:temp
PS C:\WINDOWS\system32> C:\code\rclone\rclone ls gdrv:temp -vv
2026/09/10 18:39:40 DEBUG : rclone: Version "v1.75.1" starting with parameters ["C:\\code\\rclone\\rclone.exe" "ls" "gdrv:temp" "-vv"]
2026/09/10 18:39:40 DEBUG : Creating backend with remote "gdrv:temp"
2026/09/10 18:39:40 DEBUG : Using config file from "C:\\Users\\REDACTED_USER\\AppData\\Roaming\\rclone\\rclone.conf"
2026/09/10 18:39:40 DEBUG : Google drive root 'temp': 'root_folder_id = 0AG_REDACTED_PVA' - save this in the config to speed up startup
2026/09/10 18:39:41 DEBUG : rclone_rmdirs_test_form: No export formats found for "application/vnd.google-apps.form"
2026/09/10 18:39:41 DEBUG : 3 go routines active

```

I clearly see the file:

 ![image](https://forum.rclone.org/uploads/default/original/3X/1/c/1c8b167883da6d5c0912e0767e8f469eeed9ffb8.png)

as an extra check, i reran the rmdirs with the same result as before, it wants to delete the directory

```auto
PS C:\WINDOWS\system32> C:\code\rclone\rclone rmdirs gdrv:temp --dry-run -vv
2026/09/10 18:44:20 DEBUG : rclone: Version "v1.75.1" starting with parameters ["C:\\code\\rclone\\rclone.exe" "rmdirs" "gdrv:temp" "--dry-run" "-vv"]
2026/09/10 18:44:20 DEBUG : Creating backend with remote "gdrv:temp"
2026/09/10 18:44:20 DEBUG : Using config file from "C:\\Users\\REDACTED_USER\\AppData\\Roaming\\rclone\\rclone.conf"
2026/09/10 18:44:21 DEBUG : Google drive root 'temp': 'root_folder_id = 0AG_REDACTED_PVA' - save this in the config to speed up startup
2026/09/10 18:44:22 DEBUG : rclone_rmdirs_test_form: No export formats found for "application/vnd.google-apps.form"
2026/09/10 18:44:22 DEBUG : removing 1 level 0 directories
2026/09/10 18:44:22 NOTICE: Google drive root 'temp': Skipped remove directory as --dry-run is set
2026/09/10 18:44:22 DEBUG : 3 go routines active
PS C:\WINDOWS\system32>

```

---

<div class="post-metadata">

**Author:** ![asdffdsa](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/848f3c/32.png) [@asdffdsa](https://forum.rclone.org/u/asdffdsa)\
**Post date:** [September 10, 2026, 4:54pm UTC](https://forum.rclone.org/t/rmdirs-is-attempting-to-delete-not-empty-directory-with-gform-files/54233/4 "2026-09-10T16:54:35Z")

</div>

i do not use gdrive much so i do not have the answer.

what you just posted is helpful, concise output for someone else to comment on

---

<div class="post-metadata">

**Author:** ![asdffdsa](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/848f3c/32.png) [@asdffdsa](https://forum.rclone.org/u/asdffdsa)\
**Post date:** [September 10, 2026, 9:14pm UTC](https://forum.rclone.org/t/rmdirs-is-attempting-to-delete-not-empty-directory-with-gform-files/54233/5 "2026-09-10T21:14:59Z")

</div>

fwiw, to prevent rclone from removing the dir, can use `--drive-show-all-gdocs`

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [September 10, 2026, 10:44pm UTC](https://forum.rclone.org/t/rmdirs-is-attempting-to-delete-not-empty-directory-with-gform-files/54233/6 "2026-09-10T22:44:59Z")

</div>

> [@purjolok](#):
>
> as an extra check, i reran the rmdirs with the same result as before, it wants to delete the directory
> 
> ```auto
> PS C:\WINDOWS\system32> C:\code\rclone\rclone rmdirs gdrv:temp --dry-run -vv
> 2026/09/10 18:44:20 DEBUG : rclone: Version "v1.75.1" starting with parameters ["C:\\code\\rclone\\rclone.exe" "rmdirs" "gdrv:temp" "--dry-run" "-vv"]
> 2026/09/10 18:44:20 DEBUG : Creating backend with remote "gdrv:temp"
> 2026/09/10 18:44:20 DEBUG : Using config file from "C:\\Users\\REDACTED_USER\\AppData\\Roaming\\rclone\\rclone.conf"
> 2026/09/10 18:44:21 DEBUG : Google drive root 'temp': 'root_folder_id = 0AG_REDACTED_PVA' - save this in the config to speed up startup
> 2026/09/10 18:44:22 DEBUG : rclone_rmdirs_test_form: No export formats found for "application/vnd.google-apps.form"
> 2026/09/10 18:44:22 DEBUG : removing 1 level 0 directories
> 2026/09/10 18:44:22 NOTICE: Google drive root 'temp': Skipped remove directory as --dry-run is set
> 2026/09/10 18:44:22 DEBUG : 3 go routines active
> PS C:\WINDOWS\system32>
> 
> ```

What happens if you remove the --dry-run on your test directory? Does it get deleted? I would hope it will error...

---

<div class="post-metadata">

**Author:** ![purjolok](https://forum.rclone.org/letter_avatar_proxy/v4/letter/p/b3f665/32.png) [@purjolok](https://forum.rclone.org/u/purjolok)\
**Post date:** [September 11, 2026, 7:10am UTC](https://forum.rclone.org/t/rmdirs-is-attempting-to-delete-not-empty-directory-with-gform-files/54233/7 "2026-09-11T07:10:35Z")

</div>

good find! thanks! doing a quick test this did seem to do it.. but I am feeling now I need to analyse the full logs some more to confirm it works everywhere which will take some time.. i honestly felt lucky to spot this directory and made me wonder what else I or others may have deleted by mistake.

but then,

> [@ncw](#):
>
> What happens if you remove the --dry-run on your test directory? Does it get deleted? I would hope it will error...

@ncw - interesting idea, I honestly figured--dry-run was at the end of the checks which would then run delete on the directory regardless ...... but it DID error!? 🎉

to do this i created another directory in temp and added another form to it and this is the journey .. under --dry-run it registered it to be deleted.. but rclone again DID in fact error when running live!? mind you I am glad I have likely not deleted something that I missed previously but somewhere something is buggy I think.

```auto
PS C:\WINDOWS\system32> C:\code\rclone\rclone rmdirs gdrv:temp\temp2 --drive-show-all-gdocs --dry-run -vv
2026/09/11 08:40:49 DEBUG : rclone: Version "v1.75.1" starting with parameters ["C:\\code\\rclone\\rclone.exe" "rmdirs" "gdrv:temp\\temp2" "--drive-show-all-gdocs" "--dry-run" "-vv"]
2026/09/11 08:40:49 DEBUG : Creating backend with remote "gdrv:temp\\temp2"
2026/09/11 08:40:49 DEBUG : Using config file from "C:\\Users\\REDACTED_USER\\AppData\\Roaming\\rclone\\rclone.conf"
2026/09/11 08:40:49 DEBUG : gdrv: detected overridden config - adding "{gCMI1}" suffix to name
2026/09/11 08:40:49 DEBUG : Google drive root 'temp/temp2': 'root_folder_id = 0AG_REDACTED_PVA' - save this in the config to speed up startup
2026/09/11 08:40:49 DEBUG : fs cache: renaming cache item "gdrv:temp\\temp2" to be canonical "gdrv{gCMI1}:temp/temp2"
2026/09/11 08:40:50 DEBUG : 3 go routines active

PS C:\WINDOWS\system32> C:\code\rclone\rclone rmdirs gdrv:temp\temp2 --dry-run -vv
2026/09/11 08:41:04 DEBUG : rclone: Version "v1.75.1" starting with parameters ["C:\\code\\rclone\\rclone.exe" "rmdirs" "gdrv:temp\\temp2" "--dry-run" "-vv"]
2026/09/11 08:41:04 DEBUG : Creating backend with remote "gdrv:temp\\temp2"
2026/09/11 08:41:04 DEBUG : Using config file from "C:\\Users\\REDACTED_USER\\AppData\\Roaming\\rclone\\rclone.conf"
2026/09/11 08:41:04 DEBUG : Google drive root 'temp/temp2': 'root_folder_id = 0AG_REDACTED_PVA' - save this in the config to speed up startup
2026/09/11 08:41:05 DEBUG : fs cache: renaming cache item "gdrv:temp\\temp2" to be canonical "gdrv:temp/temp2"
2026/09/11 08:41:05 DEBUG : rclone rmdirs form to test 2: No export formats found for "application/vnd.google-apps.form"
2026/09/11 08:41:05 DEBUG : removing 1 level 0 directories
2026/09/11 08:41:05 NOTICE: Google drive root 'temp/temp2': Skipped remove directory as --dry-run is set
2026/09/11 08:41:05 DEBUG : 3 go routines active

PS C:\WINDOWS\system32> C:\code\rclone\rclone rmdirs gdrv:temp\temp2 -vv
2026/09/11 08:42:03 DEBUG : rclone: Version "v1.75.1" starting with parameters ["C:\\code\\rclone\\rclone.exe" "rmdirs" "gdrv:temp\\temp2" "-vv"]
2026/09/11 08:42:03 DEBUG : Creating backend with remote "gdrv:temp\\temp2"
2026/09/11 08:42:03 DEBUG : Using config file from "C:\\Users\\REDACTED_USER\\AppData\\Roaming\\rclone\\rclone.conf"
2026/09/11 08:42:03 DEBUG : Google drive root 'temp/temp2': 'root_folder_id = 0AG_REDACTED_PVA' - save this in the config to speed up startup
2026/09/11 08:42:03 DEBUG : fs cache: renaming cache item "gdrv:temp\\temp2" to be canonical "gdrv:temp/temp2"
2026/09/11 08:42:04 DEBUG : rclone rmdirs form to test 2: No export formats found for "application/vnd.google-apps.form"
2026/09/11 08:42:04 DEBUG : removing 1 level 0 directories
2026/09/11 08:42:04 INFO : Google drive root 'temp/temp2': Removing directory
2026/09/11 08:42:04 DEBUG : Rmdir: contains file: "rclone rmdirs form to test 2"
2026/09/11 08:42:04 ERROR : Failed to rmdir: directory not empty
2026/09/11 08:42:04 ERROR : Attempt 1/3 failed with 2 errors and: failed to remove directories: directory not empty
2026/09/11 08:42:05 DEBUG : rclone rmdirs form to test 2: No export formats found for "application/vnd.google-apps.form"
2026/09/11 08:42:05 DEBUG : removing 1 level 0 directories
2026/09/11 08:42:05 INFO : Google drive root 'temp/temp2': Removing directory
2026/09/11 08:42:05 DEBUG : Rmdir: contains file: "rclone rmdirs form to test 2"
2026/09/11 08:42:05 ERROR : Failed to rmdir: directory not empty
2026/09/11 08:42:05 ERROR : Attempt 2/3 failed with 2 errors and: failed to remove directories: directory not empty
2026/09/11 08:42:05 DEBUG : rclone rmdirs form to test 2: No export formats found for "application/vnd.google-apps.form"
2026/09/11 08:42:05 DEBUG : removing 1 level 0 directories
2026/09/11 08:42:05 INFO : Google drive root 'temp/temp2': Removing directory
2026/09/11 08:42:05 DEBUG : Rmdir: contains file: "rclone rmdirs form to test 2"
2026/09/11 08:42:05 ERROR : Failed to rmdir: directory not empty
2026/09/11 08:42:05 ERROR : Attempt 3/3 failed with 2 errors and: failed to remove directories: directory not empty
2026/09/11 08:42:05 DEBUG : 3 go routines active
2026/09/11 08:42:05 NOTICE: Failed to rmdirs with 2 errors: last error was: failed to remove directories: directory not empty

PS C:\WINDOWS\system32> C:\code\rclone\rclone rmdirs gdrv:temp\temp2 --dry-run
2026/09/11 08:45:30 NOTICE: Google drive root 'temp/temp2': Skipped remove directory as --dry-run is set

PS C:\WINDOWS\system32> C:\code\rclone\rclone rmdirs gdrv:temp\temp2 --drive-show-all-gdocs

PS C:\WINDOWS\system32> C:\code\rclone\rclone rmdirs gdrv:temp\temp2 --drive-show-all-gdocs -vv
2026/09/11 08:52:10 DEBUG : rclone: Version "v1.75.1" starting with parameters ["C:\\code\\rclone\\rclone.exe" "rmdirs" "gdrv:temp\\temp2" "--drive-show-all-gdocs" "-vv"]
2026/09/11 08:52:10 DEBUG : Creating backend with remote "gdrv:temp\\temp2"
2026/09/11 08:52:10 DEBUG : Using config file from "C:\\Users\\REDACTED_USER\\AppData\\Roaming\\rclone\\rclone.conf"
2026/09/11 08:52:10 DEBUG : gdrv: detected overridden config - adding "{gCMI1}" suffix to name
2026/09/11 08:52:10 DEBUG : Google drive root 'temp/temp2': 'root_folder_id = 0AG_REDACTED_PVA' - save this in the config to speed up startup
2026/09/11 08:52:11 DEBUG : fs cache: renaming cache item "gdrv:temp\\temp2" to be canonical "gdrv{gCMI1}:temp/temp2"
2026/09/11 08:52:11 DEBUG : 3 go routines active

```

interestingly it does not error and works fine with the switch from @asdffdsa `--drive-show-all-gdocs` .. my guess is that this should be standard in `rmdirs` in relation to a gdrive so that `rmdirs` in `--dry-run` can avoid worrying and wrong dry run output.. while it seems `rmdirs` only checks for exportable gdrive natives (?)

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [September 11, 2026, 11:32am UTC](https://forum.rclone.org/t/rmdirs-is-attempting-to-delete-not-empty-directory-with-gform-files/54233/8 "2026-09-11T11:32:10Z")

</div>

> [@purjolok](#):
>
> I honestly figured--dry-run was at the end of the checks which would then run delete on the directory regardless ...... but it DID error!?

That is what should happen. The reason is that users can set filters which can hide directory entries so rmdirs thinks the directory is empty but gets an error when it tries to delete it. Rmdirs is designed to remove as many directories as it can so this works out just fine, except for the error message.

This is very similar to what is happening with the gforms - they don't appear in directories normally (because rclone can't copy them) so they are effectively filtered out. On some storage systems there can be invisible old versions in a directory too which have the same effect.

Using `-drive-show-all-gdocs` is a great idea though! This is useful if you are doing a server side copy and do want to copy the gforms (rclone can do that, it just can't download or upload gforms) and apparently useful for `rclone rmdirs` too 🙂

---

<div class="post-metadata">

**Author:** ![purjolok](https://forum.rclone.org/letter_avatar_proxy/v4/letter/p/b3f665/32.png) [@purjolok](https://forum.rclone.org/u/purjolok)\
**Post date:** [September 11, 2026, 1:29pm UTC](https://forum.rclone.org/t/rmdirs-is-attempting-to-delete-not-empty-directory-with-gform-files/54233/9 "2026-09-11T13:29:54Z")

</div>

I am glad it errored, it just seems it should not get to that line of defense - I mean, what is the purpose of a dry run if it is not a dry run one can rely on?

should i submit a proper bug report on github or can/will someone take it from here? I am honestly not sure what should be "fixed" to avoid the command erroring and that the rmdirs against a google drive should do as it says not try in any way (in dry run or not) to delete a directory with files in it regardless of file types.

---

<div class="post-metadata">

**Author:** ![nite\_route](https://forum.rclone.org/user_avatar/forum.rclone.org/nite_route/32/21758_2.png) [@nite\_route](https://forum.rclone.org/u/nite_route)\
**Post date:** [September 12, 2026, 2:11am UTC](https://forum.rclone.org/t/rmdirs-is-attempting-to-delete-not-empty-directory-with-gform-files/54233/10 "2026-09-12T02:11:43Z")

</div>

The dry run did exactly what it should. It showed that rclone would remove the directory, so I would not run the real command yet. The `no export formats found` lines suggest Google Forms are being seen but not counted as files for the emptiness check. Since `--drive-skip-gdocs` gives the same result, this looks like a Drive backend edge case. I would file it as a bug with the version, redacted command, config, and `-vv` output.

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [October 12, 2026, 2:12am UTC](https://forum.rclone.org/t/rmdirs-is-attempting-to-delete-not-empty-directory-with-gform-files/54233/11 "2026-10-12T02:12:02Z")

</div>

Closed on October 12, 2026, 2:12am UTC

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