Skip to content

Support "S3-compatible" object store errors more gracefully #223

@tomdcc

Description

@tomdcc

Hi! We have a customer who is attempting to use a product (mimir) that uses this library but their "S3-compatible" object store returns this for a 404:

<?xml version="1.0" encoding="UTF-8" standalone="no"?><Error><Code>404</Code><Message>No message</Message><RequestId>5cd29bba-dc52-41f7-a655-46180f123d6c</RequestId></Error>

Ie it is putting 404 as the error code instead of NoSuchKey. It is however reporting the HTTP status as 404 correctly.

mimir is calling IsObjNotFoundErr (here) to see if a particular error was that an object is not found. This currently fails because the Code is wrong, but we do have the HTTP status available.

In this case we should fall back to looking at the HTTP status code. I think it's just a matter of adding a || minioError.StatusCode == http.StatusNotFound to the test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions