-
Notifications
You must be signed in to change notification settings - Fork 36
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
AuthFailure with IAM role and signature version 4 #59
Comments
OK, I have a PR up which - I think - addresses this issue. You can apply it on your test system by:
And re-running your test script with signature v4. |
Or you could |
It'd be super helpful if you could enable debugging in net-amazon-ec2 by setting Obviously, you'll want to leave out your secrets if you post the debug output. :) |
Hi, I applied the patch and the issue is gone! |
Great. I'll merge this PR and get a new release up on CPAN |
OK, I released 0.35 to CPAN today. Open a new ticket if there's more trouble. |
Sorry for commenting on closed issue but I have the same issue with 0.36. It is just like 25% of tries actually succeed. Any ideas how to troubleshoot it ? It happens also with version 2 signature too. Failure output:
Success output:
|
My solution is to keep trying util it managed to generate signature properly for both AWS calls :)
|
Huh. That it "sometimes works" indicates to me there's some kind of race condition going on in the code somewhere (either yours or mine) which messes up the v4 signing code. Could you set the debug flag on your Net::Amazon::EC2 object? It will be very spammy, but it would help isolate the failure. (Also, if you paste in the output, please make sure you remove your AWS credentials 😄) |
It is iam role attached to instance to all creds are temporary :) but thanks . Here is failure of describeInstance API Call:
|
It is also can fail on CreateSnapshot action too. |
Oh. And I use PAR/pp to build binary (well in fact it extracts all that stuff in /tmp) |
I also experience this issue when using I may switch to using Paws or static credentials as a workaround. |
That sort of sounds like the code isn't getting the token at first and then when you try a second time it works. |
I'm also having this problem and am currently working on the idea that it relates to time sync differences between the instance and the AWS IAM auth server based on these: aws/aws-cli#2205 It may the the wrong track and have had no success after trying a few things, but I'll offer this here in case it's helpful or if someone else can offer more informed advice. Edit: Though as I can repeatedly run aws cli commands with no issues, and the ec2-consistent-snapshot fails about 60% of the time, this is quite possibly the wrong track. |
I was in contact with AWS Premium Support about this issue and they also suspected it was a time sync issue. But I compared the server in question to others and found it was accurate within a second. Also, AWS Premium Support mentioned the difference needed to be 5 minutes for this to matter, but in the second linked issue above, someone reported the problem with only about a one minute difference. So, time skew is certainly one cause of this issue, but I'm not convinced it's the only cause. |
Certainly nothing I've done with time sync has made any difference to IAM auth problems (called from ec2-consistent-snapshot as I think you've noticed). I see why you've switched to static credentials and I'm thinking that need to be my interim solution too. |
And static credentials are also failing, just based on a simple test of:
This suggests that it isn't solely an IAM issue, and the end result is that it will fail 2/3 or 3/4 times but work sometimes. However this test is using 0.35-1 which is all I have available on a production server. And can this ticket be reopened? |
We are also seeing this issue across several different AWS regions, can we reopen this issue? |
We have observed this issue occurring in Net::Amazon::EC2 0.36 on ActivePerl-5.26 and ActivePerl-5.24 |
@tavisma I gave up on getting this solved in the Perl stack, which is not supported by AWS. I believe you happen to experiencing this via ec2-consistent-snapshot. I rewrote that tool in Bash, which in turn uses the officially supported https://github.com/RideAmigosCorp/ec2-consistent-snapshot.sh |
Thanks, i'll check it out |
Net::Amazon::EC2 0.33 have an auth issue with IAM role and signature version 4.
I'm not sure if this issue is region dependent.
This issue has been reported here about two years ago:
https://rt.cpan.org/Public/Bug/Display.html?id=107491
The text was updated successfully, but these errors were encountered: