Empty Directories Remain

  • in the OP example of rclone rmdirs, he/she/it was trying to delete an empty dir that was a subdir of another dir.
  • in my example, testfolder01 is a bucket, not a dir, perhaps i should have called it testbucket01.
    that 409 is from wasabi. in s3, a bucket is different from an folder.
2021/08/30 09:57:06 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/08/30 09:57:06 DEBUG : 01: Removing directory
2021/08/30 09:57:06 DEBUG : S3 bucket testfolder01: Removing directory
2021/08/30 09:57:06 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/08/30 09:57:06 DEBUG : HTTP REQUEST (req 0xc00072d300)
2021/08/30 09:57:06 DEBUG : DELETE /testfolder01 HTTP/1.1
Host: s3.us-east-2.wasabisys.com
User-Agent: rclone/v1.56.0
Authorization: XXXX
X-Amz-Content-Sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
X-Amz-Date: 20210830T135706Z
Accept-Encoding: gzip

2021/08/30 09:57:06 DEBUG : >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2021/08/30 09:57:06 DEBUG : <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
2021/08/30 09:57:06 DEBUG : HTTP RESPONSE (req 0xc00072d300)
2021/08/30 09:57:06 DEBUG : HTTP/1.1 409 Conflict
Transfer-Encoding: chunked
Content-Type: application/xml
Date: Mon, 30 Aug 2021 13:57:07 GMT
Server: WasabiS3/7.0.176-2021-07-18-7900366 (head2)
X-Amz-Id-2: 8WifyplWAnRenXrYotjRcE+Mo2GiXnD4SM2yfITIJ4qAx+7LfkMkKxMHodQP99ypUqCSQKATB4T7
X-Amz-Request-Id: 630EEF8E78DEAC80

138
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>BucketNotEmpty</Code><Message>The bucket you tried to delete is not empty</Message><BucketName>testfolder01</BucketName><RequestId>630EEF8E78DEAC80</RequestId><HostId>8WifyplWAnRenXrYotjRcE+Mo2GiXnD4SM2yfITIJ4qAx+7LfkMkKxMHodQP99ypUqCSQKATB4T7</HostId></Error>

as to what gets fixed, do you mean that rclone should support an empty dir on s3 or that rclone's behavior should be self-consistent?

  • rclone will not create a empty dir.
  • rclone can see an empty dir.
  • rclone will claim to delete an empty dir but does not delete it.

on a rclone mount, even stranger behavior.

  • rclone will appear create an empty dir but in the local dircache, not in the backend. only if you copy a real file to that virtual dir, will rclone create both the dir and file in the backend.
  • rclone will appear to delete an empty dir created by another app but after --dir-cache-time expires, that deleted empty dir will reappear. rclone deletes that empty dir from the local dircache not from the backend and when rclone refreshes the dircache, the dir reappears

s3 does not support directories, instead emulates it in its web interface.

i would guess that since s3 api does not support that, rclone does not support it.
as to what the aws s3 command line app does with an empty dir, i have no idea.

given that all the other third-party apps i have used support the concept of empty dir, i believe that rclone should also support that.

if you look at my rclone rmdirs example and the OP, they are the same in that rclone claims to delete an empty dir, does not delete the empty dir.
and that is the same behavior with rclone mount.
perhaps a new topic should be started using feature request to discuss that....