-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: what is the migration path for BucketAlreadyOwnedByYou and BucketAlreadyExists errors? #1051
Comments
Both
|
@balamurugana |
I did, but this is really tedious to go through to find the new variant of what I am using if I don't know what name I am looking for. This is why a migration note would be great, instead of just dropping the new API with no info about how it relates to the old one. Is there one? |
One example: this uses make_bucket as I do: https://github.com/minio/minio-py/blob/master/examples/make_bucket.py ... but it doesn't handle any errors, while my code does. But what does that mean? Am I not supposed to handle BucketAlreadyExists for Edit: just checked the API docs, they don't seem to have any specific info on what errors |
How about below code? if not client.bucket_exists("my-bucket"):
client.make_bucket("my-bucket") To specific to make bucket, it is usually done only one in life time. When error is concerned with APIs, there is nothing specific unless user wants to deal with S3 API. minio-py v7 comes with lot of additions, improvements and correctness + detailed API guide and examples. Majority of older APIs do not break because of new additional parameters. However error handling is surely incompatible because previous versions did not provide right way of handling errors. You could refer README for basic |
That code looks like a race condition waiting to happen, and therefore useless in production code. You really shouldn't suggest that to anyone, IMHO. (My code is written under the assumption that the app backend is stateless, hence this could be run in multiple backend containers in parallel and blow up. I would assume most minio-using backends would be written with this assumption, otherwise I could just use a local folder for file storage and not S3/minio.) The only sane way is obviously to check S3Error, but only for the specific known error condition that it already exists. That was easily possible with A migration guide specifically for sane error handling, and updating your examples to handle errors would really help a lot. Because this was previously pretty obvious on how to do it, but now it's not - not only for people migrating but for newcomers as well. Edit: I apologize, my wording was unnecessarily negative. It is nice that you're responding with some ideas for sure, it is helpful for example to know that |
What is the migration path for BucketAlreadyOwnedByYou and BucketAlreadyExists errors? These imports just seem to be gone and I can't find a single relevant result on Google on what happened with them. Maybe it would be useful to add a note to
minio/error.py
at the top in the form of a code comment that gives some info on where they went, for people like me opening up the file and trying to figure out what happened.The text was updated successfully, but these errors were encountered: