Skip to content

get_artifact forwards Authorization header to S3 presigned URLs, causing download failure #278

@rjernst

Description

@rjernst

When get_artifact is called with a Buildkite artifact download URL, the tool calls the Buildkite REST API which returns a 302 redirect to an S3 presigned URL. The go-buildkite HTTP client used in the MCP impl then fetches that presigned URL with the bearer token auth header added, which S3 rejects.

The error looks like this:

  <Error>
    <Code>InvalidArgument</Code>
    <Message>Only one auth mechanism allowed; only the X-Amz-Algorithm query parameter, Signature query string parameter or the Authorization header should be specified</Message>
    <ArgumentName>Authorization</ArgumentName>
    <ArgumentValue>Bearer bkua_...</ArgumentValue>
  </Error>

I believe the root cause is that go-buildkite is always adding the bearer token auth header, but that only makes sense when talking to buildkite APIs, not S3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions