get_all_instances is missing instances #1348

pchico opened this Issue Feb 22, 2013 · 7 comments

4 participants


I am doing this code to create instances in amazon and wait for them to be running:

reservation = ec2_connection.run_instances(

instance_id = reservation.instances[0]
log_info('Amazon created instances {0}'.format(instance_id))

reservation = None
while reservation is None or len(reservation) == 0 or reservation[0].instance[0].state != 'pending': 
      reservation = ec2_connection.get_all_instances(instance_ids=[instance_id])
  except EC2ResponseError as exception:
      if exception.error_code != 'InvalidInstanceID.NotFound':

It is working well for most of the cases, but sometimes (1 of 100), it happens this:

  • I get a value for isntance_id
  • A machine with instance_id is running in amazon
  • ec2_connection.get_all_instances(instance_ids=[instance_id]) returns [] for ever

    Am I doing something wrong? Is this a bug in the library?


I encountered the same problem.
I also tried with the official amazon aws for bash and I can get the instances there

the boto project member

@amirbaron is there anything else interesting about your setup? Do you have a lot of instances or just a few? Can you reliably reproduce the issue and if so then how? Is it possible your requests are being throttled by EC2 and Boto is handling that poorly?


get_all_instance() returns not running instances, but returns reserved instances, maybe.

the boto project member

@pchico any further info you can provide about this issue?


Hi, this is not a bug.
I just launched few instances together so they have been in the same reservation and my code has a bug it assume there is one instance per reservation.

the boto project member

@pchico have you resolved your issue from the comments above as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment