Purge command does not work on directories with files

What is the problem you are having with rclone?

purge not working on directories with files. Only works on empty directories

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

rclone v1.64.2

  • os/version: Microsoft Windows 10 Pro 22H2 (64 bit)
  • os/kernel: 10.0.19045.3570 (x86_64)
  • os/type: windows
  • os/arch: amd64
  • go/version: go1.21.3
  • go/linking: static
  • go/tags: cmount

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

Dropbox

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

rclone purge "db1:drives/e2/Telegram" -P

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[db1]
type = crypt
remote = dropbox1:
password = XXX
filename_encoding = base32768

[dropbox1]
type = dropbox
client_id = XXX
client_secret = XXX
token = XXX

A log from the command that you were trying to run with the -vv flag

PS C:\Users\AF> rclone purge "db1:drives/e2/Telegram" -vv -P
2023/11/09 07:43:12 DEBUG : rclone: Version "v1.64.2" starting with parameters ["C:\\rclone\\rclone.exe" "purge" "db1:drives/e2/Telegram" "-vv" "-P"]
2023/11/09 07:43:12 DEBUG : Creating backend with remote "db1:drives/e2/Telegram"
2023/11/09 07:43:12 DEBUG : Using config file from "C:\\Users\\AF\\AppData\\Roaming\\rclone\\rclone.conf"
2023/11/09 07:43:12 DEBUG : Creating backend with remote "dropbox1:褩ڕ枭䶖䜂㦺ꀧ獛蓟/姿⣮㰂鞓⛞羞淧鶪㸿/␁阰嗌㬘茼䢬㤇鯉屟"
2023/11/09 07:43:13 ERROR : Attempt 1/3 failed with 1 errors and: path_lookup/not_found/.
2023/11/09 07:43:13 ERROR : Attempt 2/3 failed with 1 errors and: path_lookup/not_found/.
2023/11/09 07:43:14 ERROR : Attempt 3/3 failed with 1 errors and: path_lookup/not_found/.
Transferred:              0 B / 0 B, -, 0 B/s, ETA -
Errors:                 1 (retrying may help)
Deleted:                0 (files), 3 (dirs)
Elapsed time:         2.1s
2023/11/09 07:43:14 DEBUG : 6 go routines active
2023/11/09 07:43:14 INFO  : Dropbox root '褩ڕ枭䶖䜂㦺ꀧ獛蓟/姿⣮㰂鞓⛞羞淧鶪㸿/␁阰嗌㬘茼䢬㤇鯉屟': Committing uploads - please wait...
2023/11/09 07:43:14 Failed to purge: path_lookup/not_found/.

hi,

does these work?
rclone ls "db1:drives/e2/Telegram" -vv --retries=1
rclone ls "dropbox1:褩ڕ枭䶖䜂㦺ꀧ獛蓟/姿⣮㰂鞓⛞羞淧鶪㸿/␁阰嗌㬘茼䢬㤇鯉屟" -vv --retries=1

Yes, those list all the files

ok, dropbox has a lot of quirks. hopefully someone will stop by soon to help you....

in the meantime, maybe you can create a simple test to document that behavior and post full debug output.

I managed to replicate this

$ rclone mkdir dropbox:'褩ڕ枭䶖䜂㦺ꀧ獛蓟/姿⣮㰂鞓⛞羞淧鶪㸿/␁阰嗌㬘茼䢬㤇鯉屟'

$ echo hello | rclone rcat dropbox:'褩ڕ枭䶖䜂㦺ꀧ獛蓟/姿⣮㰂鞓⛞羞淧鶪㸿/␁阰嗌㬘茼䢬㤇鯉屟'/file.txt

$ rclone ls dropbox:'褩ڕ枭䶖䜂㦺ꀧ獛蓟'
        6 姿⣮㰂鞓⛞羞淧鶪㸿/␁阰嗌㬘茼䢬㤇鯉屟/file.txt


$ rclone purge -vv  dropbox:'褩ڕ枭䶖䜂㦺ꀧ獛蓟/姿⣮㰂鞓⛞羞淧鶪㸿/␁阰嗌㬘茼䢬㤇鯉屟'
2023/11/09 17:51:18 DEBUG : rclone: Version "v1.65.0-beta.7468.23ab6fa3a" starting with parameters ["rclone" "purge" "-vv" "dropbox:褩ڕ枭䶖䜂㦺ꀧ獛蓟/姿⣮㰂鞓⛞羞淧鶪㸿/␁阰嗌㬘茼䢬㤇鯉屟"]
2023/11/09 17:51:18 DEBUG : Creating backend with remote "dropbox:褩ڕ枭䶖䜂㦺ꀧ獛蓟/姿⣮㰂鞓⛞羞淧鶪㸿/␁阰嗌㬘茼䢬㤇鯉屟"
2023/11/09 17:51:18 DEBUG : Using config file from "/home/ncw/.rclone.conf"
2023/11/09 17:51:18 ERROR : Attempt 1/3 failed with 1 errors and: path_lookup/not_found/...
2023/11/09 17:51:19 ERROR : Attempt 2/3 failed with 1 errors and: path_lookup/not_found/...
2023/11/09 17:51:19 ERROR : Attempt 3/3 failed with 1 errors and: path_lookup/not_found/.
2023/11/09 17:51:19 DEBUG : 7 go routines active
2023/11/09 17:51:19 INFO  : Dropbox root '褩ڕ枭䶖䜂㦺ꀧ獛蓟/姿⣮㰂鞓⛞羞淧鶪㸿/␁阰嗌㬘茼䢬㤇鯉屟': Committing uploads - please wait...
2023/11/09 17:51:19 Failed to purge: path_lookup/not_found/.

I narrowed this down to this - note how rmdir works and purge doesn't

$ rclone mkdir dropbox:'␁'

$ rclone purge dropbox:'␁' -vv --retries 1
2023/11/09 17:59:54 DEBUG : rclone: Version "v1.65.0-beta.7468.23ab6fa3a" starting with parameters ["rclone" "purge" "dropbox:␁" "-vv" "--retries" "1"]
2023/11/09 17:59:54 DEBUG : Creating backend with remote "dropbox:␁"
2023/11/09 17:59:54 DEBUG : Using config file from "/home/ncw/.rclone.conf"
2023/11/09 17:59:54 ERROR : Attempt 1/1 failed with 1 errors and: path_lookup/not_found/.
2023/11/09 17:59:54 DEBUG : 7 go routines active
2023/11/09 17:59:54 INFO  : Dropbox root '␁': Committing uploads - please wait...
2023/11/09 17:59:54 Failed to purge: path_lookup/not_found/.

$ rclone rmdir dropbox:'␁' -vv --retries 1
2023/11/09 17:59:58 DEBUG : rclone: Version "v1.65.0-beta.7468.23ab6fa3a" starting with parameters ["rclone" "rmdir" "dropbox:␁" "-vv" "--retries" "1"]
2023/11/09 17:59:58 DEBUG : Creating backend with remote "dropbox:␁"
2023/11/09 17:59:58 DEBUG : Using config file from "/home/ncw/.rclone.conf"
2023/11/09 17:59:58 INFO  : Dropbox root '␁': Removing directory
2023/11/09 17:59:59 DEBUG : 7 go routines active
2023/11/09 17:59:59 INFO  : Dropbox root '␁': Committing uploads - please wait...

This caused by the rclone purge path missing an encoding. Try this

v1.65.0-beta.7469.1d66ccbd2.fix-dropbox-purge on branch fix-dropbox-purge (uploaded in 15-30 mins)


Aside about base32768 encoding... I looked in the table and base32768 encoding uses ␀␁␂␃␄␅␆␇␈␉␊␋␌␍␎␏␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟ as part if its encoding scheme.

However rclone uses ␀␁␂␃␄␅␆␇␈␉␊␋␌␍␎␏␐␑␒␓␔␕␖␗␘␙␚␛␜␝␞␟ for encoding control characters in path names for remotes which can't cope with it.

According to the encoding, dropbox can cope with control characters. This is tested in the integration tests and works fine, so some base32768 file names will be stored with control characters.

However dropbox can store all the base32768 characters (you can check this yourself with rclone test info --check-base32768 dropbox:check-base32768 -vv)

So this is unfortunate - we didn't really want to store files with control characters, but it should work on any backend which supports control characters so nothing to worry about!

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