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

Decoding failure #720

Closed
Buratti opened this issue Jun 27, 2024 · 11 comments
Closed

Decoding failure #720

Buratti opened this issue Jun 27, 2024 · 11 comments

Comments

@Buratti
Copy link

Buratti commented Jun 27, 2024

Describe the bug
Lambda.UpdateFunctionConfiguration fails when it comes to decode the response. The function configuration is updated correctly.

dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "LastUpdateStatusReasonCode", intValue: nil)], debugDescription: "Cannot initialize LastUpdateStatusReasonCode from invalid String value Creating", underlyingError: nil))

To Reproduce
Steps to reproduce the behavior:

let httpClient = HTTPClient(eventLoopGroupProvider: .singleton)
let awsClient = AWSClient(httpClientProvider: .createNew)

defer {
    try? awsClient.syncShutdown()
    try? httpClient.syncShutdown()
}

let lambda = Lambda(client: awsClient)
let request = Lambda.UpdateFunctionConfigurationRequest(functionName: "")
_ = try await lambda.updateFunctionConfiguration(request)

Expected behavior
Should not fail

Setup (please complete the following information):

  • Version of soto: 6.8.0
  • Authentication mechanism: profile

Additional context
Tested in eu-central-1, should not be relevant though.

@0xTim
Copy link
Member

0xTim commented Jun 27, 2024

@Buratti are you able to breakpoint inside the HTTPClient call and get the JSON body returned? Because Creating should not be being returned as the reason code - https://docs.aws.amazon.com/lambda/latest/api/API_UpdateFunctionConfiguration.html#lambda-UpdateFunctionConfiguration-response-LastUpdateStatusReasonCode

@Buratti
Copy link
Author

Buratti commented Jun 27, 2024

Sure! I'll need an hour though, I'm OOO right now.
What I can tell you right now is that the I have tried the same invocation using aws-cli earlier, and it also returned Creating.
I'll paste the response received inside the HTTPClient in a new comment later!

@adam-fowler
Copy link
Member

adam-fowler commented Jun 27, 2024

@Buratti would you be able to try this with the 7.0.0-rc version

Actually don't bother Creating as a case doesn't exist in 7 either. I may have to patch the enums

@Buratti
Copy link
Author

Buratti commented Jun 27, 2024

Breakpointing here the response does indeed return a "Creating" string.

This looks like a bug on AWS side, I couldn't find any reference of Creating either and GetFunctionConfiguration does not even return it. Creating also looks like an unexpected case for a function that has been "created" and updated for over two years.

@adam-fowler
Copy link
Member

It is a pain when the model files amazon provide are not up to date with the actual reality. I have add a patch to code generator and have run it on the models. You can test the aws-update-models branch, but that'll require you to upgrade to 7.0 code base. As long as you are only using Swift concurrency that shouldn't be too hard.

I'm hoping to do v7 release in the very near future

@0xTim
Copy link
Member

0xTim commented Jun 27, 2024

Looks like they've just updated them (it's in #717)

@adam-fowler
Copy link
Member

Looks like they've just updated them (it's in #717)

That's my patch

@0xTim
Copy link
Member

0xTim commented Jun 27, 2024

Oh lol I misread the PR 😅

@Buratti
Copy link
Author

Buratti commented Jun 27, 2024

IMHO I would argue that this is a bug, not a "synchronization" problem with their models. Otherwise I couldn't understand why the difference behavior between GetFunctionConfiguration and UpdateFunctionConfiguration.
I've open a case on AWS Support and update this issue with their answer.

This isn't a big issue for us right now, it's a very simple helper script and I can work around it ignoring the DecodingError, not a big deal.

I will try the patch, migrating to soto 7 was very high on my priority list anyway (thanks for adding tracing support, loved seeing it).

@adam-fowler
Copy link
Member

adam-fowler commented Jun 27, 2024

IMHO I would argue that this is a bug, not a "synchronization" problem with their models.

You are probably correct, but AWS aren't always fast to move so I tend to patch models until they are fixed.

Please keep us updated on their response thanks

@adam-fowler
Copy link
Member

This should be resolved in v7

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

3 participants