[Bug 2052834] Re: Incomplete network info showing in both web and API :: landscape-server 23.03
Simon Quigley
2052834 at bugs.launchpad.net
Wed Jun 5 14:49:34 UTC 2024
Sponsored, thanks!
In the future, please use DEP-3 headers: https://dep-
team.pages.debian.net/deps/dep3/
** Changed in: landscape-client (Ubuntu Oracular)
Status: In Progress => Fix Committed
--
You received this bug notification because you are a member of Ubuntu
Sponsors, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/2052834
Title:
Incomplete network info showing in both web and API :: landscape-
server 23.03
Status in Landscape Server:
Fix Committed
Status in Landscape Client:
In Progress
Status in landscape-client package in Ubuntu:
Fix Committed
Status in landscape-client source package in Focal:
New
Status in landscape-client source package in Jammy:
New
Status in landscape-client source package in Mantic:
New
Status in landscape-client source package in Noble:
New
Status in landscape-client source package in Oracular:
Fix Committed
Bug description:
Thank you @mdscunningham for opening the bug report.
[Impact]
Current versions of landscape client omit some network interfaces in their API response. While some interfaces should not be included such as loops and tap interfaces, others such as disconnected interfaces (no IP address or in the down state) should still be included as long as they have a valid MAC address.
This patch makes sure that interfaces are not omitted from the API response based on their IP address or their current state.
[Test Plan]
1- launch a ubuntu instance (lxc container, VM, bare metal) and make sure that the machine has access to at least two network interfaces.
2- Make sure one of the interfaces is connected and has a valid IP.
3- Also make sure at least one interface is not connected and has a valid MAC address. The interface can be in the down state or simply not configured with an IP. One easy way to achieve this is by running the following command:
$ ip link set dev <interface> down
4- Install landscape-client on the machine and enroll it into the landscape server.
5- Wait a few minutes for the machine to enroll and for all information to be exchanged between the server and the client
6- Query the server with lanscape-api to fetch information about the currently connected clients:
$ landscape-api get-computers --with-network --json
7- Prior to this patch, the interfaces in the down state or with no IP addresses will not show up in the API response. However after this patch these interfaces will show up with an IP address, broadcast address and netmask of 0.0.0.0.
[Where problems could occur]
* Some interfaces might still fail to show up.
* Some interfaces that are not meant to show up might show up.
[Original Description]
Customer has opened a case (00378390) indicating that when they use
the lansdcape-api to get network info for client machines they do not
get all interfaces returned by the API.
For their specific use case they need to get all MAC addresses from
the machine to add those to their VPN for access. They indicate that
their wifi interface shows up in the web UI, but not in the API
output.
I was able to replicate this in 23.03+18 with my own laptop. Here are
my results.
Actual interfaces on machine, there are four, which should all be
visible in Landscape.
ip a | grep -E 'BROADCAST|ether|inet '
2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 38:f3:ab:41:dd:0d brd ff:ff:ff:ff:ff:ff
inet 192.168.1.176/24 brd 192.168.1.255 scope global dynamic noprefixroute enp0s31f6
3: enx803f5d0918d6: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether 80:3f:5d:09:18:d6 brd ff:ff:ff:ff:ff:ff
4: wlp0s20f3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether e0:2b:e9:bb:0f:6c brd ff:ff:ff:ff:ff:ff
inet 192.168.1.143/24 brd 192.168.1.255 scope global dynamic noprefixroute wlp0s20f3
5: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 52:54:00:e3:af:9a brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
From Web UI, I see three of four:
Network:
Model: Not available
MAC: 80:3f:5d:09:18:d6
IP: Not available
Model: Comet Lake PCH CNVi WiFi
MAC: e0:2b:e9:bb:0f:6c
IP: 192.168.1.143
Model: Ethernet Connection (11) I219-LM
MAC: 38:f3:ab:41:dd:0d
IP: 192.168.1.176
From API, I see a different three of four:
landscape-api get-computers --with-network --query <hostname>
'network_devices': [{'broadcast_address': '192.168.1.255',
'duplex': True,
'interface': 'enp0s31f6',
'ip_address': '192.168.1.176',
'mac_address': '38:f3:ab:41:dd:0d',
'netmask': '255.255.255.0',
'speed': 1000},
{'broadcast_address': '192.168.122.255',
'duplex': False,
'interface': 'virbr0',
'ip_address': '192.168.122.1',
'mac_address': '52:54:00:e3:af:9a',
'netmask': '255.255.255.0',
'speed': 10000},
{'broadcast_address': '192.168.1.255',
'duplex': False,
'interface': 'wlp0s20f3',
'ip_address': '192.168.1.143',
'mac_address': 'e0:2b:e9:bb:0f:6c',
'netmask': '255.255.255.0',
'speed': -1}],
I would expect all four interfaces to be visible, and clearly
Landscape is aware of all four because if we combine the outputs above
you can see all four, but each view Web / API only returns a different
three of the four.
To manage notifications about this bug go to:
https://bugs.launchpad.net/landscape/+bug/2052834/+subscriptions
More information about the Ubuntu-sponsors
mailing list