Dispatcher/devices on different subnets not supported in use 'ip route get' changes

Bug #1247005 reported by Dean Arnold
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LAVA Dispatcher
Fix Released
High
Matthew Hart

Bug Description

I have recently upgraded my LAVA instance to the latest version. This pulled in a commit to use 'ip route get' to detect which interface is connected to the lava dispatcher.

This has resulted in our TC2 jobs failing with the following error when attempting to boot the master image:

root@master [rc=0]# 2013-10-31 02:25:02 PM INFO: Waiting for network to come up
 LC_ALL=C ping -W4 -c1 10.1.103.191
 PING 10.1.103.191 (10.1.103.191) 56(84) bytes of data.
 64 bytes from 10.1.103.191: icmp_req=1 ttl=62 time=0.370 ms

 --- 10.1.103.191 ping statistics ---
 1 packets transmitted, 1 received, 0% packet loss, time 0ms
 rtt min/avg/max/mdev = 0.370/0.370/0.370/0.000 ms
 root@master [rc=0]#
 ifconfig `ip route get 10.1.103.191 | cut -d ' ' -f3` | grep 'inet addr' |awk -F: '{split($2,a," "); print "<" a[1] ">"}'
 10.1.99.1: error fetching interface information: Device not found
 root@master [rc=0]#

2013-10-31 02:26:12 PM ERROR: Unable to determine target image IP address
2013-10-31 02:26:12 PM INFO: CriticalError
2013-10-31 02:26:12 PM WARNING: [ACTION-E] deploy_linaro_android_image is finished with error (Unable to determine target image IP address).

The reason for this being that the command used assumes that the interface will be in the 3rd field when doing the cut. However we are seeing that the output of ip route get 10.1.103.191 actually gives this:

$ ip route get 10.1.103.197
10.1.103.197 via 10.1.99.1 dev eth0 src 10.1.99.87
    Cache

And the "cut -d ' ' -f3" bit then gives you 10.1.99.1, which ifconfig is unable to cope with. I suspect the issue is because our dispatcher is on a different subnet to our target devices.

I agree that it makes sense to use 'ip route get' to determine the interface, though I was wondering if you could provide us with a more flexible parsing of the output please?

Revision history for this message
Matthew Hart (matthew-hart) wrote :

Hi Dean,

Can you please try updating your dispatcher code with this commit:
https://staging.review.linaro.org/#/c/405/1/lava_dispatcher/client/base.py

I don't have the ability to setup a dispatcher on a different subnet until I'm back in the Cambridge lab next week, so my code won't get onto the tip until it has been tested.

Matt.

Revision history for this message
Matthew Hart (matthew-hart) wrote :

My change was merged into tip

Changed in lava-dispatcher:
status: New → Fix Released
assignee: nobody → Matthew Hart (matthew-hart)
Changed in lava-dispatcher:
status: Fix Released → Fix Committed
importance: Undecided → High
Changed in lava-dispatcher:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.