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

iidy fails silently if AWS metadata service 404s #111

Open
cschmidt opened this issue Jun 13, 2018 · 6 comments
Open

iidy fails silently if AWS metadata service 404s #111

cschmidt opened this issue Jun 13, 2018 · 6 comments
Labels

Comments

@cschmidt
Copy link

If you happen to be running iidy in an environment where the credentials are not found, iidy will fail silently. In particular, I noticed this running iidy under AWS Cloud9. Running iidy render on a template would produce no output.

Manually configuring AWS credentials with aws configure works around the issue.

@cschmidt
Copy link
Author

@tavisrudd noted that the tell-tale sign you were running into this issue was that you'd get a 404 from the AWS metadata service (http://169.254.169.254/latest/meta-data/iam/)

@cschmidt cschmidt added the bug label Jun 14, 2018
@cschmidt
Copy link
Author

Just some further thinking on this. I'm not sure if the lack of iam meta-data is actually a bug in the Cloud9 environment. Reading through the docs on AWS Managed Temporary Credentials it seems like this might be a feature.

@tavisrudd
Copy link
Collaborator

If not a bug in Cloud9, it's a bug in the aws-sdk for js. That's what handles the lookup via the metadata service. Regardless, we can improve iidy's error reporting for this case.

@tavisrudd
Copy link
Collaborator

cschmidt:~/environment (master) $ iidy --debug render cfn-template.yaml 
error:  Error: null
    at IncomingMessage.<anonymous> (/snapshot/cf_templates/node_modules/aws-sdk/lib/util.js:864:34)
    at emitNone (events.js:110:20)
    at IncomingMessage.emit (events.js:207:7)
    at endReadableNT (_stream_readable.js:1045:12)
    at _combinedTickCallback (internal/process/next_tick.js:102:11)
    at process._tickDomainCallback (internal/process/next_tick.js:198:9)

is the stack trace Carl encountered.

@tavisrudd
Copy link
Collaborator

tavisrudd commented Jul 3, 2018

A related issue is that if you run iidy from a location that has neither ~/.aws/ or the AWS metadata service it will either error immediately with error connect ECONNREFUSED 169.254.169.254:80 or it will hang for a while before exiting with error: connect ETIMEDOUT 169.254.169.254:80.

@tavisrudd
Copy link
Collaborator

PR #120 addresses ETIMEDOUT and ECONNREFUSED but not the original 404 that @cschmidt encountered.

@tavisrudd tavisrudd changed the title iidy fails silently if AWS credentials are not found iidy fails silently if AWS metadata service 404s Jul 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants