-
Notifications
You must be signed in to change notification settings - Fork 288
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
Deleting / Re-creating Bucket With Versioning Does Not Enable Versioning through Web Console #3483
Comments
I have created the following script (it assumes alias mc rb local/test --force
mc mb local/test
echo "test 1" | mc pipe local/test/test-object
mc version enable local/test
mc ls --versions local/test
echo "test 1" | mc pipe local/test/test-object
mc ls --versions local/test This is the output:
Versioning works fine. I'm not even sure if you can actually disable versioning when uploading data, but could you tell me which SDK you are using and how you're uploading the object that isn't versioned? You also may want to post the trace |
@ramondeklein to clarify, the issue I am experiencing only happens when the console web app is used, not the command line as per your test. I have recorded a youtube video that illustrates the steps and where the inconsistency is: https://youtu.be/lw41JBWDMYU Do let me know if you need any other information. For my testing I am using the latest c# sdk for .net 8. But we have also tested the latest node sdk. We don't believe this is the issue, but there's something wrong with the console web app. Do let me know if I've posted this issue to the wrong repo. Thanks! |
Hi @markive I've followed your steps and cannot reproduce, yes I used the console. Could you please repeat the steps using And also calls when you use your SDK code vs.
mc cp sample-cradle.jpg local/mybucket/sample-cradle.jpg
❯ mc ls --versions local/mybucket/sample-cradle.jpg
Done in console
❯ mc cp sample-cradle.jpg local/mybucket/sample-cradle.jpg
❯ mc ls --versions local/mybucket/sample-cradle.jpg
❯ mc cp sample-cradle.jpg local/mybucket/sample-cradle-2.jpg
❯ mc ls --versions local/mybucket/sample-cradle-2.jpg As you can see above the version id is correct. |
You can also compare the API calls made by the console and the calls made by the |
Just run it locally and see if you can reproduce on local machine with |
Hi @marktheunissen, thanks for looking into it. I don't have a linux system other than a containerized environment so I don't know how I can run I think focusing on the sdk shouldn't be the issue (we also tried with Node). Since versionId is controlled by minio, it should not be possible to successfully store an object (200 response) with versioning turned on through any means which results in versionId=null. This is the request made by the .Net SDK, it's a PUT always, and in fact all the SDKs minio provides don't support POST: Here is the API request that the console web app makes, it uses a POST even when uploading new versions of an existing file: |
I think the weirdest part of the behavior we are seeing is, why when a bucket is re-created does versioning not work, but when it is created for the first time with versioning turned on does it work perfectly? That's very inconsistent behavior and I'm 100% using the console web app for those operations. |
You can run |
Is this reproducible through |
We are testing MinIO, and the first test we did was to create a bucket without versioning (to look at file structures on disk). Then we wanted to test versioning so we turned it on. We found that our bucket wasn't creating files with version IDs (versionID = null) when uploaded through the API.
When we created a new bucket with versioning turned on from the beginning everything was as expected.
We therefore deleted the original bucket (by deleting all objects and versions first) all in the console and re-created it through the console with versioning turned on. We then found we got the same incorrect behaviour. So it seems like we have 'bricked' that bucket name. I was able to confirm there is no reference to the original bucket name on the file storage.
Another weird behavior is that objects uploaded through the API have this problem, but objects uploaded through the console web app do get a version ID for the first object version.
The only way to resolve the issue is to manually create the bucket using the command line:
mc mb --with-versioning local/mark-voffon-test Bucket created successfully 'local/mark-voffon-test'.
Expected Behavior
When you re-create a bucket with versioning, it should work when using the console web app. It should have the same behavior as the command line.
Current Behavior
Objects behave like they were first uploaded to a bucket with versioning turned off, and on a second object upload you get a version ID.
The console web app isn't re-creating a deleted bucket with versioning turned on the same as the command line.
Video link demonstrating the issue: https://youtu.be/lw41JBWDMYU
Steps to Reproduce (for bugs)
Create bucket with versioning turned off.
Upload file through API (we used c# and node scripts to test)
You will have file with versionID=null
Turn on versioning for the bucket
Upload same file through API
You should have versionId set by MinIO
Upload new file through API
You will have file with versionID=null (this is wrong, bucket should version new files from now on).
Delete files and bucket completely through console web app
Re-create bucket with versioning turned on from the beginning
Follow steps above
Behavior is still incorrect
Delete files and bucket completely through console web app
Create same bucket with mb command with versioning enabled
Follow steps above
Everything works according to the documentation.
Regression
I assume yes
We are running the latest version as of a few days ago.
Your Environment
We are running this as a Dockerised container in Azure Container Apps
MinIO version used (
minio --version
):minio version RELEASE.2024-11-07T00-52-20Z (commit-id=cefc43e4daa4cbb490ef6726ea374e26a93eb85e)
Runtime: go1.23.3 linux/amd64
License: GNU AGPLv3 - https://www.gnu.org/licenses/agpl-3.0.html
Copyright: 2015-2024 MinIO, Inc.
Operating System and version (
uname -a
):Linux rdrive-minio-ea--fh4gz0c-768ff885d5-8hxtt 5.15.164.1-1.cm2 Profiling endpoints for mcs #1 SMP Sun Aug 18 19:16:21 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: