After deleting multiple object from AWS S3 framework c# the file not deleted

I deleted a bunch of files (7) from my bucket using DeleteObjectsAsync from AWS S3 C# framework.

Then I connected to my bucket and I see there the massage: " You have at least 7 objects locked with a different passphrase.
Enter your other passphrase to access these files."

And in the list of bucket files, I see “Objects locked”.

Why is it? why were they not deleted?

  • I added the files from the same framework with the same key - so this is not a passphrase error (After uploading the files before deleting I was able to see them and use them)

  • In case it’s relevant this Is how I created the bucket:

          PutBucketRequest request = new PutBucketRequest()
              BucketName = bucketName,
              CannedACL = S3CannedACL.NoACL,
              BucketRegion = S3Region.EUWest1,
          await s3Client.PutBucketAsync(request);

Hello @meir,
Welcome to the forum!

If you mean the satellite UI, then this is mean that you have some not decryptable objects for the current encryption phrase. So, 7 objects were uploaded with a different encryption phrase before.
Since they are not decryptable, they are hidden from the output.
To check that you need to use uplink CLI:

  1. Create an access grant using your current encryption phrase
  2. Setup an uplink with that access grant

To list buckets:

uplink ls

To list objects which uses the current encryption phrase:

uplink ls sj://my-bucket

If list of objects is empty - there is no objects with current encryption phrase. If you lost the previous encryption passphrase, you can only delete the previous objects or even the buckets.

To list objects in encrypted form:

uplink ls --encrypted sj://my-bucket

To calculate the number of decryptable objects

uplink ls --recursive sj://my-object | wc -l

To calculate the number of encrypted objects:

uplink --recursive --encrypted sj://my-bucket | wc -l

If numbers are different - you have some objects encrypted using another encryption phrase. If you do not remember it, you may only delete them.

To remove object in encrypted form:

uplink rm --encrypted sj://my-bucket/An1LhSLauz-ROF8oLgLV1UrafXZVUm3HEtU8irR8il4oFI9Xqzc=

To remove buckets where you lost an encryption phrase:

uplink rb --force sj://my-bucket

If you have a lot of objects inside the bucket, it could timeout. In this case you need to remove the encrypted content first:

uplink rm --recursive --encrypted --parallelism 100 sj://my-bucket

Then remove the bucket:

uplink rb --force sj://my-bucket

If you want to delete only not decryptable objects, you may move all decryptable objects to a different bucket, then force remove the source bucket (or only encrypted content).

  1. create a new bucket
uplink mb sj://my-bucket2
  1. Move all decryptable objects
uplink mv --recursive --parallelism 100 sj://my-bucket/ sj://my-bucket2/
  1. remove remained not decryptable objects
uplink rm --recursive --encrypted --parallelism 100 sj://my-bucket/
  1. remove the source bucket
uplink rb --force sj://my-bucket

4.1. or move decryptable objects back

uplink mv --recursive --parallelism 100 sj://my-bucket2/ sj://my-bucket/

4.2. and remove the temporary bucket

uplink rb --force sj://my-bucket2
1 Like