Closed Bug 992235 Opened 11 years ago Closed 10 years ago

Using slaveapi to reboot a machine on the slave health page results in "list index out of range" under 'output'

Categories

(Release Engineering :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: Callek)

References

Details

Attachments

(1 file)

1) Go to https://secure.pub.build.mozilla.org/builddata/reports/slave_health/slave.html?name=tst-linux64-spot-471 2) Press reboot slave In the reboot history table, after 30s or so, the following appears: In Progress - reboot - list index out of range I'm presuming "list index out of range" isn't expected.
This is not a one-off, I've seen it on ec2 systems before.... This is an issue with our inventory code: 2014-04-04 07:45:05,953 - INFO - tst-linux64-spot-471 - Getting inventory info 2014-04-04 07:45:06,200 - ERROR - Something went wrong while processing! Traceback (most recent call last): File "/builds/slaveapi/prod/lib/python2.7/site-packages/slaveapi/processor.py", line 60, in _worker res, msg = action(slave, *args, **kwargs) File "/builds/slaveapi/prod/lib/python2.7/site-packages/slaveapi/actions/reboot.py", line 33, in reboot slave.load_inventory_info() File "/builds/slaveapi/prod/lib/python2.7/site-packages/slaveapi/slave.py", line 60, in load_inventory_info info = Machine.load_inventory_info(self) File "/builds/slaveapi/prod/lib/python2.7/site-packages/slaveapi/machines/base.py", line 45, in load_inventory_info config["inventory_password"], File "/builds/slaveapi/prod/lib/python2.7/site-packages/slaveapi/clients/inventory.py", line 22, in get_system info = requests.get(str(url), auth=auth).json()["objects"][0] IndexError: list index out of range
This fixes this bug, but is a situation we'd need to support anyway in order to support ec2 management properly.
Assignee: nobody → bugspam.Callek
Status: NEW → ASSIGNED
Attachment #8401933 - Flags: review?(jhopkins)
Comment on attachment 8401933 [details] [diff] [review] [slaveapi] v1 - support missing host entries in inventory Review of attachment 8401933 [details] [diff] [review]: ----------------------------------------------------------------- ::: slaveapi/clients/inventory.py @@ +25,5 @@ > log.debug("%s - Making request to %s", fqdn, url) > + info = defaultdict(lambda: None) > + try: > + result = requests.get(str(url), auth=auth).json()["objects"][0] > + info.extend(result) mistaken syntax error: info.update() not info.extend()
Attachment #8401933 - Flags: review?(jhopkins) → review+
$ git push Counting objects: 34, done. Delta compression using up to 4 threads. Compressing objects: 100% (21/21), done. Writing objects: 100% (21/21), 2.46 KiB | 0 bytes/s, done. Total 21 (delta 17), reused 0 (delta 0) To ssh://gitolite3@git.mozilla.org/build/slaveapi.git 4f63b89..8a742ec master -> master
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Component: Tools → General
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: