losDaniel / spot-connect

pip install spot-connect. Module that makes it easy to use AWS virtual machines at discount pricing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IndexError: list index out of range in describe_instance_status when using spot_connect command line or spotted

losDaniel opened this issue · comments

One common problem to encounter when trying to connect is the one seen in the image below. This

image

IndexError appears because when attempting to find the instance we've created using describe_instance_status we cannot find it.

This usually happens when you attempt to launch a spot instance with the same name an older spot instance you have already terminated. Here is a walk through of the events:

  • Create a spot instance with the name "monitor" & use it
  • Terminate the spot instance "monitor"
  • For a few hours, the spot request "monitor" will appear in your console as "terminated"
  • If you try to launch a new instance with the name "monitor" instead of launching a new one the old spot request is detected and the program proceeds, except the instance it detected was terminated meaning that it cannot find it when using describe_spot_instances
  • indexError is returned.

Solution:

  • Use a different name for your new instance
  • Wait until the spot_request disapears from your console then you can use the same name again.

Updated the module to return an error with a description to the user in version 1.0.2