The default bug view has changed. See this FAQ.

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

RESOLVED FIXED

Status

Release Engineering
Tools
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: emorley, Assigned: Callek)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

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.
(Assignee)

Comment 1

3 years ago
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
(Assignee)

Comment 2

3 years ago
Created attachment 8401933 [details] [diff] [review]
[slaveapi] v1 - support missing host entries in inventory

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)
(Assignee)

Comment 3

3 years ago
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+
(Assignee)

Updated

3 years ago
Duplicate of this bug: 989553
(Assignee)

Comment 5

3 years ago
$ 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
(Assignee)

Updated

3 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.