Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Need to check if 'ifconfig' is available or replace with 'ip add show' #1712

Open
juhlee-microsoft opened this issue Nov 18, 2019 · 10 comments
Assignees

Comments

@juhlee-microsoft
Copy link

Describe the bug
'ifconfig' got deprecated and soon we won't see it in many distro. I still see below error message in today's SLES 15. Can you check if waagent can substitutes 'ip address show' when no ifconfig command available in the system?

Error in waagent.log : 2019/11/18 19:58:00.744410 ERROR Daemon Command: [ifconfig -a], return code: [127], result: [/bin/sh: ifconfig: command not found]

Note: Please add some context which would help us understand the problem better

  1. Provision a new SLES 15
  2. Check the waagent log

Distro and WALinuxAgent details (please complete the following information):

  • Distro and Version: SLES 15 (4.12.14-5.30-azure)
  • WALinuxAgent version: WALinuxAgent-2.2.36 running on sles 15
    Python: 3.6.8
    Goal state agent: 2.2.36

Additional context
NA

@narrieta
Copy link
Member

@juhlee-microsoft - thanks for reporting this, could you attach the entire waagent.log?

@narrieta narrieta removed the triage Needs Triaging label Nov 19, 2019
@juhlee-microsoft
Copy link
Author

waagent.log

@narrieta
Copy link
Member

@juhlee-microsoft Thanks. We'll follow up.

@narrieta narrieta assigned longlimsft and unassigned vrdmr, narrieta, pgombar and larohra Nov 20, 2019
@narrieta
Copy link
Member

@longlimsft - could you take a look at this issue? we are using ifconfig during RDMA provisioning.

@juhlee-microsoft
Copy link
Author

waagent 2.2.36 still shows below error and failed to initialize ib0 device interface. This blocks the SLES 15 RDMA tests.

2020/01/08 19:47:49.736059 INFO Daemon RDMA: waiting for any Infiniband device at directory=/sys/class/infiniband timeout=120s
2020/01/08 19:47:49.736712 INFO Daemon RDMA: device found in /sys/class/infiniband
2020/01/08 19:47:49.737348 INFO Daemon Wait for ib0 become available
2020/01/08 19:47:49.739908 ERROR Daemon Command: [ifconfig -a], return code: [127], result: [/bin/sh: ifconfig: command not found
]
2020/01/08 19:47:49.740684 ERROR Daemon RDMA: device processing failed: Failed to list network interfaces
2020/01/08 19:47:49.741306 INFO Daemon RDMA: completed device processing.
2020/01/08 19:47:49.741960 INFO Daemon RDMA: device is set up

@longlimsft
Copy link
Collaborator

@juhlee-microsoft , can you install ifconfig on sles15 to see if it fixes your problem:

apt install net-tools-deprecated

@juhlee-microsoft
Copy link
Author

@jpbuecken
Copy link

@juhlee-microsoft , can you install ifconfig on sles15 to see if it fixes your problem:

apt install net-tools-deprecated

This is not a good advice: net-tools with ifconfig are only available in the legacy module of SLES15. The legacy module has shorter support lifecycle than the SLES15 itself.
So you may get a enterprise system with unsupported software.

Better fix

ret, output = RunGetOutput("ifconfig -a")

and you may allow arbitary network interface names instead of hardcoded eth at that function.

See #1877 (comment) as well.

@alv000h
Copy link

alv000h commented Jun 4, 2020

@juhlee-microsoft @jpbuecken
It is better no user binaries, using /proc /sys is a better aproach...
Example to determine iface names on a machine:

Command:
$ ip r |grep link
10.100.100.0/23 dev nic0 proto kernel scope link src 10.100.100.25
10.255.255.0/21 dev nic1 proto kernel scope link src 10.255.255.33
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
10.8.1.0/24 dev tap0 proto kernel scope link src 10.8.1.10

synonym from /proc (i have edited nicX destination, but tap0 and docker is OK, it must match with link src 10.X.X.X of above but with octets reversed):
$ cat /proc/net/route | awk '$3 == "00000000" { print $0}'
Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT
tap0 0001080A 00000000 0001 0 0 0 00FFFFFF 0 0 0
nic1 00000000 00000000 0001 0 0 0 00FFFFFF 0 0 0
nic0 00000000 00000000 0001 0 0 0 00FFFFFF 0 0 0
docker0 000011AC 00000000 0001 0 0 0 0000FFFF 0 0 0

@alv000h
Copy link

alv000h commented Jun 4, 2020

Addtional ideas:

$ ls -1 /sys/class/net
docker0
eth0
eth1
lo
tap0
tap1
tap2
tap3

$ cat /sys/class/net/eth0/address
00:00:AA:AA:AA:c3

@narrieta narrieta added the RDMA label Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants