You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kotlin aws sdk is returning an error when running a Kotlin lambda fetching a secret value using a secret Arn from an event parameter.
Regression Issue
Select this option if this issue appears to be a regression.
Expected behavior
No error, secret value is returned.
Current behavior
1 validation error detected: Value null at 'secretId' failed to satisfy constraint: Member must not be null: aws.sdk.kotlin.services.secretsmanager.model.SecretsManagerException
aws.sdk.kotlin.services.secretsmanager.model.SecretsManagerException: 1 validation error detected: Value null at 'secretId' failed to satisfy constraint: Member must not be null
at aws.sdk.kotlin.services.secretsmanager.serde.GetSecretValueOperationDeserializerKt.throwGetSecretValueError(GetSecretValueOperationDeserializer.kt:67)
at aws.sdk.kotlin.services.secretsmanager.serde.GetSecretValueOperationDeserializerKt.access$throwGetSecretValueError(GetSecretValueOperationDeserializer.kt:1)
at aws.sdk.kotlin.services.secretsmanager.serde.GetSecretValueOperationDeserializer.deserialize(GetSecretValueOperationDeserializer.kt:37)
at aws.sdk.kotlin.services.secretsmanager.serde.GetSecretValueOperationDeserializer.deserialize(GetSecretValueOperationDeserializer.kt:32)
at aws.smithy.kotlin.runtime.http.operation.DeserializeHandler.call(SdkOperationExecution.kt:347)
at aws.smithy.kotlin.runtime.http.operation.DeserializeHandler$call$1.invokeSuspend(SdkOperationExecution.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:263)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:95)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:69)
at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:47)
at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
"level": "DEBUG",
"loggerName": "httpTraceMiddleware",
"message": "HttpResponse:\nHTTP 400: Bad Request\r\nconnection: close\r\ncontent-length: 152\r\ncontent-type: application/x-amz-json-1.1\r\ndate: Tue, 19 Nov 2024 11:38:27 GMT\r\nx-amzn-requestid: 66736b04-94c1-4563-bc1b-4f00a71a50f8\r\n\r\n{\"__type\":\"ValidationException\",\"message\":\"1 validation error detected: Value null at 'secretId' failed to satisfy constraint: Member must not be null\"}",
The lambda runs in an isolated VPC and has the purpose connect to RDS and execute schema changes.
I setup the connection between the lambda and a vpc endpoint allowing connection to secret manager.
AWS SDK for Kotlin version
1.3.76
Platform (JVM/JS/Native)
JVM
Operating system and version
Lambda Runtime.JAVA_21
The text was updated successfully, but these errors were encountered:
The empty JSON body {} at the end of your request log suggests that a null secretId is being configured on the request or not being sent some other way.
Can you confirm that the secretArn you're using is never null? I see in your code sample it's a non-null String, but would like to make sure
Thank you for looking into this.
You can see in the code above that I added a log the secretArn and I can confirm it contains a non null value and the correct secret arn.
The fact that your request has an empty body {} strongly suggests you did send a request with a null secretId... I can't think of another reason this would fail for you.
Are you able to consistently reproduce this issue, can you provide a minimal reproduction?
Describe the bug
Kotlin aws sdk is returning an error when running a Kotlin lambda fetching a secret value using a secret Arn from an event parameter.
Regression Issue
Expected behavior
No error, secret value is returned.
Current behavior
I enabled the SDK logging and got:
Steps to Reproduce
Using the following function definitions:
Possible Solution
Unknown
Context
The lambda runs in an isolated VPC and has the purpose connect to RDS and execute schema changes.
I setup the connection between the lambda and a vpc endpoint allowing connection to secret manager.
AWS SDK for Kotlin version
1.3.76
Platform (JVM/JS/Native)
JVM
Operating system and version
Lambda Runtime.JAVA_21
The text was updated successfully, but these errors were encountered: