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

[🐛 BUG]: SQS plugin not working without static credentials when using IMDSv2 #1250

Closed
1 task done
paulermo opened this issue Aug 7, 2022 · 2 comments · Fixed by roadrunner-server/sqs#87
Closed
1 task done
Assignees
Labels
B-bug Bug: bug, exception
Milestone

Comments

@paulermo
Copy link

paulermo commented Aug 7, 2022

No duplicates 🥲.

  • I have searched for a similar issue in our bug tracker and didn't find any solutions.

What happened?

A bug happened!

While connecting to SQS the plugin needs to retrieve the credentials from AWS (or we have to provide static creds). But prior to this RR tries to check if it is "inside of AWS" or not.

This is done using call to well-known url: awsMetaDataURL string = "http://169.254.169.254/latest/dynamic/instance-identity/" But if we use IMDSv2 then token is required for this operation. And GET request to this url will return 200 in case of IMDSv2 while 401 in case of IMDSv2.

As a result - isInAws == false, and we need static creds to access SQS.

Version (rr --version)

rr version 2.10.7 (build time: 2022-08-05T15:44:08+0000, gol. 18.5), OS: linux, arch: amd64

Relevant log output

handle_serve_command: Serve error:
endure_start:
endure_serve_internal: Function call error:
endure_call_serve_fn: got initial serve error from the Vertex jobs. Plugin, stopping execution, error: jobs_plugin_serve:
new_sqs_consumers operation error SQS: GetQueueUrl, failed to sign request: failed to retrieve credentials: failed to refresh cached credentials, static credentials are empty
@paulermo paulermo added B-bug Bug: bug, exception F-need-verification labels Aug 7, 2022
@rustatian rustatian added this to the v2.11.1 milestone Aug 7, 2022
@rustatian
Copy link
Member

Hey @paulermo 👋🏻
Thanks for the report. Planned for the v2.11.1.

@rustatian
Copy link
Member

@paulermo Hey 👋🏻
Could you please confirm (I don't have an EC2 with IMDSv2 atm) that the request to the http://169.254.169.254/latest/api/token returns a 200 status code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-bug Bug: bug, exception
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants