Bucket has NOT been deleted, but is actually deleted?

Hi Everyone,

I’ve been coming across something weird when I try to delete a nested bucket. My bucket structure is as follows:

Project

  • Bucket 1 (main bucket)
    • Bucket 1a
      • files
    • Bucket 1b
      • files

So for example, I delete the files in Bucket 1a => successful, then I delete Bucket 1a and I get this error

Bucket <bucket_name> has NOT been deleted
uplink: bucket not found (“<bucket_name>”)Error: uplink: bucket not found (“<bucket_name>”)

But when I list the buckets under Bucket 1, Bucket 1a is no longer there. So the deletion was successful, but it throws an error.

I thought it wasn’t possible to create nested buckets.

Keep in mind that the data structure is “flat” (like in S3). It means that everything is a file, even if you see a tree view. There is actually no “directory”.

oh lol ok. So when listing the files though, are these two statements then the same?

./uplink.exe ls sj://bucket1/bucket1a

/uplink.exe ls sj://bucket1a

I use this to delete bucket1a

/uplink.exe rb sj://bucket1a

because it wont let me delete using the ‘full path’, but it being a flat structure makes sense. But still doesn’t answer the thrown error

Actually I’m a little bit surprised.
I’m on Linux and didn’t manage to create a nested bucket.

I’ll give a bit of background. So the upload key creation and file upload/download is happening on a Go server I wrote. I just use my windows machine with uplink to see how it looks like (kind of a sanity check), if that makes sense.

Unless I’m mixing up terminology here. On upload/download, I provide a bucket name and upload/download key. So my bucket name would be Bucket 1 and my upload/download key would be Bucket1a/filename. Then, that would mean Bucket1a is not a bucket but just a prefix

What you calling a “nested bucket” is actually prefix(es) to your object. The bucket has only one level - the bucket name (and related UID).
For example:

uplink cp movie.avi sj://bucket1/prefix1/prefix2/prefix3/movie.avi

Will upload a file to the bucket sj://bucket1 with prefixes prefix1/prefix2/prefix3 and object name movie.avi.
When you delete an object, the prefixes are gone altogether unless you have other objects with the same prefix(es).

When you removed a bucket - it’s deleted all containment (in case of --force option).

1 Like

Ah ok, so it is a prefix, makes sense, thanks @Alexey.

I just did a test, removed the object, and now the ‘prefix’ that I thought was a bucket is no longer there when I list everything under bucket1

Sorry for the confusion

1 Like

You do not need to sorry :slight_smile: it could make confusion in a first time.
You can read more there:
https://documentation.tardigrade.io/concepts/data-structure

3 Likes