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

Sagemaker: invalid signature (Credential should be scoped to correct service) #1568

Open
kubukoz opened this issue Jul 15, 2024 · 1 comment · May be fixed by #1596
Open

Sagemaker: invalid signature (Credential should be scoped to correct service) #1568

kubukoz opened this issue Jul 15, 2024 · 1 comment · May be fixed by #1596
Labels
AWS support Issues related to AWS support bug Something isn't working

Comments

@kubukoz
Copy link
Member

kubukoz commented Jul 15, 2024

To reproduce

(repo with sbt run-able setup)

  1. Generate code for AWS sagemaker, for example the ListEndpoints operation
  2. Create a client for that service and call it with any parameters
  3. See the error, {"__type":"InvalidSignatureException","message":"Credential should be scoped to correct service: 'sagemaker'. "}:
[info] {"__type":"InvalidSignatureException","message":"Credential should be scoped to correct service: 'sagemaker'. "}
[error] smithy4s.http.UnknownErrorResponse: status 400, headers: HashMap(content-length -> List(112), x-amzn-requestid -> List(5da79a17-1241-4404-a539-2efdd85b8a85), connection -> List(close), date -> List(Mon, 15 Jul 2024 23:38:37 GMT), content-type -> List(application/x-amz-json-1.1)), body:
[error] {"__type":"InvalidSignatureException","message":"Credential should be scoped to correct service: 'sagemaker'. "}
[error]         at smithy4s.http.UnknownErrorResponse$.apply(UnknownErrorResponse.scala:19)
[error]         at smithy4s.http.HttpResponse$Decoder$$anon$4.decode$$anonfun$1$$anonfun$1(HttpResponse.scala:248)
[error]         at sequence @ smithy4s.interopcats.package$$anon$1.zipMapAll(package.scala:31)
[error]         at sequence @ smithy4s.interopcats.package$$anon$1.zipMapAll(package.scala:31)
[error]         at sequence @ smithy4s.interopcats.package$$anon$1.zipMapAll(package.scala:31)
[error]         at map @ smithy4s.interopcats.package$$anon$1.zipMapAll(package.scala:31)
[error]         at flatMap @ smithy4s.interopcats.package$$anon$1.flatMap(package.scala:33)
[error]         at flatMap @ smithy4s.interopcats.package$$anon$1.flatMap(package.scala:33)
[error]         at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
[error]         at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
[error]         at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
[error]         at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
[error]         at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
[error]         at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
[error]         at clear @ org.http4s.client.middleware.Retry$.retryLoop$1(Retry.scala:90)
[error]         at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
[error]         at rethrow$extension @ fs2.Compiler$Target.compile$$anonfun$1(Compiler.scala:157)
[error]         at run$ @ hello.Main$.run(Main.scala:11)
[error] Nonzero exit code returned from runner: 1
@kubukoz kubukoz added the bug Something isn't working label Jul 15, 2024
@kubukoz
Copy link
Member Author

kubukoz commented Jul 15, 2024

My knowledge of how signatures work is very low, but in case it's useful: aws.auth.Sigv4(name = "sagemaker") - that's the hint on the service. The protocol is AwsJson1_1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AWS support Issues related to AWS support bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant