Rmdirs is attempting to delete not empty directory with *.gform files
Author: ptrykCreated Sep 12, 2026Updated Sep 12, 2026
Labelsbug
Before you start
- I have searched the forum and the existing issues for this problem.
- I have tested with the latest beta or stable release and can still reproduce the problem.
- This is a reproducible bug, not a usage question (questions belong on the forum).
Associated forum post URL
https://forum.rclone.org/t/rmdirs-is-attempting-to-delete-not-empty-directory-with-gform-files/54233
What is the problem you are having with rclone?
rclone rmdirs wants to remove a gdrive directory with *.gform files in it in --dry-run
when actually running the command w/o dry run it errors as the directory has files in it.
I do not believe rmdirs should try to do this at all as it says in the docs it should not delete non empty directories (or try to delete either i presume). As one helpful user pointed out there is a non standard flag one can add that will avoid this --drive-show-all-gdocs and it seems this should the default for rmdirs towards google drives
rclone version
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
Operating system
Windows
Which cloud storage system are you using?
google drive
Output of rclone config redacted
[gdrv]
type = drive
client_id = XXX
client_secret = XXX
scope = drive
token = XXX
team_drive =
[synth]
type = local
The command you were trying to run
`rclone rmdirs gdrv:`
A log from the command with the -vv flag
from last forum post which shows it under dry run would like to delete the directory and then the errors that occur when it actually tries to delete it and finds the directory with files after first trying the flag ´--drive-show-all-gdocs´ (which i do not believe should be required to find files if the purpose of `rmdirs` is fullfilled as described in the docs ref: https://rclone.org/commands/rclone_rmdirs/ "Remove empty directories under the path." which I believe entails even under a dry run)
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
Anything else?
No response
Source: rclone/rclone