nchammas / flintrock

A command-line tool for launching Apache Spark clusters.
Apache License 2.0
637 stars 116 forks source link

Wrong error message when specifying invalid AMI #319

Closed pmenn36 closed 3 years ago

pmenn36 commented 3 years ago

When specifying my Flintrock configuration, I accidentally used an invalid AMI, but instead of telling me the AMI was invalid, it told me that my key pair was invalid (the key pair was perfectly valid). I eventually figured out the root issue, but that error message sent me down a rabbit hole for a bit!

This was the output:

Launching 2 instances...
An error occurred (InvalidKeyPair.NotFound) when calling the RunInstances operation: The key pair 'FlintrockCluster' does not exist
Operation aborted.
nchammas commented 3 years ago

Interesting. Can you share full command and config you ran so I can reproduce this issue?

nchammas commented 3 years ago

Feel free to post additional details here if you are still having this issue. Flintrock does flag bad AMIs with a clear error, but perhaps there is some other code path you were hitting where Flintrock doesn't do such a good job.

https://github.com/nchammas/flintrock/blob/e03748582c279dc000578fe8898a6be60dc34b84/flintrock/ec2.py#L672-L676