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

Log response body of failed AWS requests #3579

Merged
merged 1 commit into from Oct 14, 2021

Conversation

tvhong-amazon
Copy link
Contributor

Proposed Changes

Currently, RabbitMQ only logs a simple error message when AWS API calls fail. This can be insufficient for debugging. This PR adds more logs for failed AWS request.

Here is an example error message after the change:

2021-10-08 22:17:09.233583+00:00 [warn] <0.2885.0> Error occurred: Forbidden
--
2021-10-08 22:17:09.233639+00:00 [warn] <0.2885.0> Failed AWS request: /?Action=DescribeInstances&InstanceId.3=i-0e0a1ffe033f786ed&InstanceId.4=i-0d41f71f51082f61b&InstanceId.5=i-059087f7877037020&Version=2015-10-01
2021-10-08 22:17:09.233639+00:00 [warn] <0.2885.0> Response: [{"Response",
2021-10-08 22:17:09.233639+00:00 [warn] <0.2885.0>             [{"Errors",
2021-10-08 22:17:09.233639+00:00 [warn] <0.2885.0>               [{"Error",
2021-10-08 22:17:09.233639+00:00 [warn] <0.2885.0>                 [{"Code","UnauthorizedOperation"},
2021-10-08 22:17:09.233639+00:00 [warn] <0.2885.0>                  {"Message",
2021-10-08 22:17:09.233639+00:00 [warn] <0.2885.0>                   "You are not authorized to perform this operation."}]}]},
2021-10-08 22:17:09.233639+00:00 [warn] <0.2885.0>              {"RequestID","8b108075-b2f6-49b9-b0ba-12057748b4a4"}]}]
2021-10-08 22:17:09.233739+00:00 [warn] <0.2885.0> Will retry AWS request, remaining retries: 5

Types of Changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bug fix (non-breaking change which fixes issue #NNNN)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause an observable behavior change in existing systems)
  • Documentation improvements (corrections, new content, etc)
  • Cosmetic change (whitespace, formatting, etc)
  • Build system and/or CI

Checklist

Put an x in the boxes that apply.
You can also fill these out after creating the PR.
If you're unsure about any of them, don't hesitate to ask on the mailing list.
We're here to help!
This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING.md document
  • I have signed the CA (see https://cla.pivotal.io/sign/rabbitmq)
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally with my changes
  • If relevant, I have added necessary documentation to https://github.com/rabbitmq/rabbitmq-website
  • If relevant, I have added this change to the first version(s) in release-notes that I expect to introduce it

@michaelklishin michaelklishin merged commit 45a654c into rabbitmq:master Oct 14, 2021
@michaelklishin
Copy link
Member

Thank you!

michaelklishin added a commit that referenced this pull request Oct 14, 2021
Log response body of failed AWS requests  (backport #3579)
michaelklishin added a commit that referenced this pull request Oct 15, 2021
Log response body of failed AWS requests

(cherry picked from commit 45a654c)

Conflicts:
	deps/rabbitmq_aws/src/rabbitmq_aws.erl
@michaelklishin
Copy link
Member

Backported to v3.8.x manually.

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

Successfully merging this pull request may close these issues.

None yet

2 participants