Skip to content
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

GetObjectTagging returns wrong error message on missing object #18791

Closed
mcrichton opened this issue Jan 15, 2024 · 1 comment
Closed

GetObjectTagging returns wrong error message on missing object #18791

mcrichton opened this issue Jan 15, 2024 · 1 comment

Comments

@mcrichton
Copy link

Expected Behavior

Previously a useful error would be returned (NoSuchBucket or NoSuchKey) which could then be used by the client to determine how to handle the error.

Current Behavior

A generic We encountered an internal error, please try again. is returned

Possible Solution

Might be a missing fall-through here:

RELEASE.2024-01-11T07-46-16Z...RELEASE.2024-01-13T07-53-03Z#diff-e7bc5ddd6854880db5918a96700afb6815d4c52c9a66734d00ef9974e6c8ebc4R3311

Such that writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL) is not being called on the missing bucket/object case

Steps to Reproduce (for bugs)

bash

mkdir -p ${HOME}/minio/data

docker run \
   -p 9000:9000 \
   --user $(id -u):$(id -g) \
   --name minio1 \
   -e "MINIO_ACCESS_KEY=aaaaaaaaaaaaaaaa" \
   -e "MINIO_SECRET_KEY=bbbbbbbb" \
   -v ${HOME}/minio/data:/data \
   quay.io/minio/minio server /data
pip install boto3

python

s3_client = boto3.client(
    "s3",
     endpoint_url="http://localhost:9000",
     aws_access_key_id="a" * 16,
     aws_secret_access_key="b" * 8,
)

s3_client.create_bucket(Bucket="foo")
s3_client.get_object_tagging(Bucket="foo", Key="bar")

Context

Previously, I could change the logic of my storage client depending on whether or not an object/key was missing. For example, I could return a "null" result if asked for the tags for a key which does not exist.

Now, with the generic error, I cannot be sure what the fault is, and so have to pass the error on instead of handling it. This breaks my use-case.

Regression

Is this issue a regression? Yes

  • Works under docker tag minio/minio:RELEASE.2024-01-11T07-46-16Z
  • Likely commit: b2b26d9
@zveinn
Copy link
Contributor

zveinn commented Jan 15, 2024

This pr (#18793) should hopefully provide the fix needed here.

Let us know if you keep experiencing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants