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

aws-sdk-core >= 3.192.0 may be not compatible with AWS SQS APIs in XML format #3030

Closed
yokonao opened this issue May 26, 2024 · 8 comments
Closed
Labels
bug This issue is a bug. wontfix We have determined that we will not resolve the issue.

Comments

@yokonao
Copy link

yokonao commented May 26, 2024

Describe the bug

Our application uses aws-sdk-core 3.170.0 and aws-sdk-sqs 1.46.0.
Recently, we try to update aws-sdk-core to 3.196.1. However, we canceled the update because some features using AWS SQS were degraded.

As a result of investigation, it was found that the result of SQS ReceiveMessage was unintentionally nil.

I did some more detailed debugging and found the following:

  • Our application uses AWS SQS APIs in XML format.
    • When aws-sdk-sqs >= 1.66.0, APIs in JSON format are selected. (commit)
  • When aws-sdk-core is 3.191.6, we can receive the message. However, when aws-sdk-core is 3.192.0 we cannot.
  • AWS XML Parser changes in 3.192.0. (Pull Request)
  • When the changes of the above PR is reverted, we can receive the message.

Expected Behavior

We can receive the message in AWS SQS when aws-sdk-core >= 3.192.0 and aws-sdk-sqs < 1.66.0.

Current Behavior

We CANNOT receive the message in AWS SQS when aws-sdk-core >= 3.192.0 and aws-sdk-sqs < 1.66.0.

Reproduction Steps

I prepared a sample repository for reproducing this issue.
https://github.com/yokonao/aws-sdk-ruby-examples?tab=readme-ov-file#sqs-xml

Possible Solution

No response

Additional Information/Context

No response

Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version

aws-sdk-core and aws-sdk-sqs

Environment details (Version of Ruby, OS environment)

Ruby 3.1.5, macOS Ventura

@yokonao yokonao added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 26, 2024
@mullermp
Copy link
Contributor

We're aware of the sweeping protocol changes that affected xml in some way. This was an organizational effort to align with expected behavior. There is not much we can do about it now. My question is, why are you trying to upgrade core and not the sqs gem? If you were to upgrade both, you shouldn't see any issue.

@yokonao
Copy link
Author

yokonao commented May 26, 2024

@mullermp
Thanky for your reply!

I understand updating both aws-sdk-sqs and aws-sdk-core is the best solution. We are working towards that.
However, in order to update aws-sdk-sqs, several other prerequisites must be met, so it may take some time. (For example, localstack v2 does not support AWS SQS APIs in JSON format.)
And we were motivated to apply patches for aws-sdk-core iteration issues sooner. (#3015, #3021)

Additionally, our application is so huge that updating all AWS SDK gems at the same time is difficult.

These are why we have tried to update aws-sdk-core only.

This was an organizational effort to align with expected behavior. There is not much we can do about it now.

Does this mean that the backward compatibility break reported in this issue is intentional and cannot be fixed?

@mullermp
Copy link
Contributor

I understand. I am very sorry about this. Once localstack is updated to support SQS JSON, you should be able to upgrade SQS and core - no need to upgrade your other SDK gems unless you want to (you should)

Have you created an issue or feature request? I can also poke the author to state that this is now expected, and we can possibly help with code.

It was not intended to break, however, we've only heard of 2 other cases of SQS related breakage. Given that was minor in that only a few customers were impacted, we decided to commit with the overall changes. Those other customers were able to upgrade easily.

For now, you can possibly get away with upgrading aws-sdk-core while also doing a monkey patch. I'm not exactly sure what affected method you would need to patch, but my guess would be xml_name in Aws::Xml::Parser::Frame. You can try monkey patching the method to be what it used to be in https://github.com/aws/aws-sdk-ruby/pull/2988/files#diff-576fcdf895f808f67ab8e4d1b4993ae6598414e23be5fd8c58063aa8858212fd.

@mullermp mullermp added wontfix We have determined that we will not resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels May 27, 2024
@yokonao
Copy link
Author

yokonao commented May 27, 2024

Thank you!

Our basic policy at the moment is as follows.

  1. Upgrade localstack to v3
  2. Update aws-sdk-core and aws-sdk-sqs

However, I was interested in this incompatibility, so I filed this issue.
Is it possible that a similar problem occurs with AWS services other than SQS?

my guess would be xml_name in Aws::Xml::Parser::Frame.

Thank you, I agree.
When I reverted the implementation of that method, the problem was resolved. (But, I did not adopt it as a solution because I could not estimate the impact on other areas.)

Have you created an issue or feature request?

Does this mean that there is a point of contact other than this repository to report this issue?

@mullermp
Copy link
Contributor

mullermp commented May 28, 2024

Is it possible that a similar problem occurs with AWS services other than SQS?

Possibly, but we haven't seen any reports. The query protocol is not largely used anymore.

Does this mean that there is a point of contact other than this repository to report this issue?

I meant for localstack. Is SQS JSON supported in localstack v3? If so, then your path is to upgrade. If not, create an issue or feature request with their repo and I can put a comment on it.

When I reverted the implementation of that method, the problem was resolved. (But, I did not adopt it as a solution because I could not estimate the impact on other areas.)

I would say you can use that monkey patch if it's working for you. You may as well also patch the other xml parsing changes as well just so it is complete.

@yokonao
Copy link
Author

yokonao commented May 28, 2024

The query protocol is not largely used anymore.

👍
I'm going to check if the AWS services we use use the query protocol.

I meant for localstack.

I got it thanks. locastack v3 supports SQS JSON, we are working on upgrading localstack in progress.
We're having a bit of a problem because of another issue, but that's our problem.

I sincerely appreciate your response. I understand that this issue will not be fixed.

@mullermp
Copy link
Contributor

Thank you. I'm sorry again that this affected you. I think it would be best to monkey patch the parser for now until you can upgrade your local stack and then finally your SDK gems.

Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. wontfix We have determined that we will not resolve the issue.
Projects
None yet
Development

No branches or pull requests

2 participants