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

Operation AmazonS3.ListBuckets fails #1512

Open
kkrs opened this issue May 7, 2024 · 2 comments
Open

Operation AmazonS3.ListBuckets fails #1512

kkrs opened this issue May 7, 2024 · 2 comments
Assignees

Comments

@kkrs
Copy link

kkrs commented May 7, 2024

Running

object S3ListFail extends IOApp.Simple {
  val loggingHttpClient: Resource[IO, Client[IO]] =
    for
      cl <- EmberClientBuilder.default[IO].build
      reqLogger  = RequestLogger(logHeaders = true, logBody = true, logAction = Some(IO.println(_)))
      respLogger = ResponseLogger(logHeaders = true, logBody = true, logAction = Some(IO.println(_)))
      logging    = reqLogger(respLogger(cl))
    yield logging

  val awsEnv =
    for
      cl  <- loggingHttpClient
      env <- AwsEnvironment.default(cl, AwsRegion.US_WEST_1)
    yield env

  def run: IO[Unit] =
    awsEnv.flatMap(env => AwsClient(S3, env))
      .use {
        case s3 =>
          s3.listBuckets()
      }
      .map(IO.println(_))
}

begets

SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
HTTP/1.1 GET http://169.254.169.254/latest/meta-data/iam/security-credentials/ Headers(Accept: text/*) body=""
HTTP/1.1 GET https://s3.us-west-1.amazonaws.com/ Headers(Authorization: <REDACTED>, host: s3.us-west-1.amazonaws.com, X-Amz-Date: 20240507T224635Z, X-Amz-Target: AmazonS3.ListBuckets) body=""
HTTP/1.1 400 Bad Request Headers(x-amz-request-id: BPHJSED8CXV329FZ, x-amz-id-2: Z9h3qA9tYtylgMvmCUi7FOUwaAIbNqQjnI906TRpl3WZcrnIXSnBEYYqeSj9mgDLRHdHsyn9rL4=, Content-Type: application/xml, Transfer-Encoding: chunked, Date: Tue, 07 May 2024 22:46:34 GMT, Server: AmazonS3, Connection: close) body="<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>InvalidRequest</Code><Message>Missing required header for this request: x-amz-content-sha256</Message><RequestId>BPHJSED8CXV329FZ</RequestId><HostId>Z9h3qA9tYtylgMvmCUi7FOUwaAIbNqQjnI906TRpl3WZcrnIXSnBEYYqeSj9mgDLRHdHsyn9rL4=</HostId></Error>"
PayloadError(.ErrorResponse, expected = , message=Could not decode failed node)
@daddykotex
Copy link
Contributor

daddykotex commented May 9, 2024

Before I give you any explanation, thanks for reporting the issue and trying Smithy4s.

S3 is one of those services that uses the @streaming trait that's not supported right now. On the other hand, the ListBucket operation that you're trying to use right now should work.

There are some changes in 1496 that would make this work. I'll try to open a separate PR that enable ListBuckets in 0.18 by only tweaking the AWSSigning process.

@kkrs
Copy link
Author

kkrs commented May 10, 2024

@daddykotex - isn't super urgent. If #1496 will merge soon and making a separate PR is a lot of work, this can wait. Let me know and I'll link this issue to that PR.

@daddykotex daddykotex mentioned this issue Jun 11, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants