Oracle Object Storage: rclone purge doesn't completely remove directories/prefixes not created by rclone

What is the problem you are having with rclone?

When using rclone purge with Oracle Cloud Infrastructure Object Storage, the command successfully deletes all objects (files) but fails to remove the directory structure itself. After purging, empty directories remain in the bucket and are still visible in listings. The directory(prefix dir1) was created using OCI CLI/SDK and is NOT a directory created by rclone operations.

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

rclone v1.69.1
- os/version: darwin 15.3.2 (64 bit)
- os/kernel: 24.3.0 (arm64)
- os/type: darwin
- os/arch: arm64 (ARMv8 compatible)
- go/version: go1.24.0
- go/linking: dynamic
- go/tags: cmount

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

oracleobjectstorage

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

rclone purge oci-remote:config/dir1/ -vv

The rclone config contents with secrets removed.

[oci-remote]
type = oracleobjectstorage
provider = user_principal_auth
namespace = xxxxx
compartment = xxxxx
region = xxxxx

A log from the command with the -vv flag

2025/04/16 21:16:53 DEBUG : rclone: Version "v1.69.1" starting with parameters ["rclone" "purge" "oci-remote:config/dir1" "-vv"]
2025/04/16 21:16:53 DEBUG : Creating backend with remote "oci-remote:config/dir1"
2025/04/16 21:16:53 DEBUG : Using config file from "/Users/user/.config/rclone/rclone.conf"
2025/04/16 21:16:53 DEBUG : dir1: trying to read metadata dir1
2025/04/16 21:16:54 DEBUG : Waiting for deletions to finish
2025/04/16 21:16:54 INFO  : config.yaml: Deleted
2025/04/16 21:16:54 DEBUG : oos:bucket config, path dir1: listing: bucket : config, directory:
2025/04/16 21:16:54 DEBUG : removing 1 level 0 directories
2025/04/16 21:16:54 INFO  : oos:bucket config, path dir1: Removing directory
2025/04/16 21:16:54 DEBUG : 6 go routines active

welcome to the forum,

before this can be called a bug, need somthing to prove it??


for a deeper look, use --dump flags, such as --dump=headers

Here is the log with --dump=headers
https://gist.githubusercontent.com/dran-dev1/fed68b6685ef270518dc0f336adb34b3/raw/33b215c765309e8e21ed522a3c8118af04d668e7/rclone_purge.log

It seems to me that the issue could be here rclone/backend/oracleobjectstorage/oracleobjectstorage.go at v1.69.1 · rclone/rclone · GitHub where it only allows Rmdir of empty bucket only and not empty directory.

@asdffdsa Added more logs and details, not sure how to bring this to attention of relevant folks? please advise.