Opened 4 years ago

Last modified 4 years ago

#2900 new defect

EC2 spot instances don't work with AMI filters

Reported by: bgilbert Owned by:
Priority: minor Milestone: undecided
Version: 0.8.9 Keywords: ec2
Cc:

Description

If EC2LatentBuildSlave is configured with spot_instance=True, valid_ami_owners, and valid_ami_location_regex, the latent buildslave fails to substantiate. twistd.log says:

Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 525, in __bootstrap
    self.__bootstrap_inner()
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 505, in run
    self.__target(*self.__args, **self.__kwargs)
--- <exception caught here> ---
  File "/home/foo/env/local/lib/python2.7/site-packages/twisted/python/threadpool.py", line 196, in _worker
    result = context.call(ctx, function, *args, **kwargs)
  File "/home/foo/env/local/lib/python2.7/site-packages/twisted/python/context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/home/foo/env/local/lib/python2.7/site-packages/twisted/python/context.py", line 81, in callWithContext
    return func(*args,**kw)
  File "/home/foo/env/local/lib/python2.7/site-packages/buildbot/buildslave/ec2.py", line 360, in _request_spot_instance
    placement=self.placement)
  File "/home/foo/env/local/lib/python2.7/site-packages/boto/ec2/connection.py", line 1640, in request_spot_instances
    verb='POST')
  File "/home/foo/env/local/lib/python2.7/site-packages/boto/connection.py", line 1166, in get_list
    raise self.ResponseError(response.status, response.reason, body)
boto.exception.EC2ResponseError: EC2ResponseError: 400 Bad Request
<?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>InvalidAMIID.Malformed</Code><Message>Invalid id: "None" (expecting "ami-...")</Message></Error></Errors><RequestID>ca4663fd-ba5c-443a-b27d-d45980b4e06a</RequestID></Response>

The problem appears to be that get_image() is never called in this code path. Instead, self.ami is passed directly to request_spot_instances().

Change History (2)

comment:1 Changed 4 years ago by bgilbert

  • Type changed from undecided to defect

comment:2 Changed 4 years ago by sa2ajj

  • Keywords ec2 added
Note: See TracTickets for help on using tickets.