sonic-net / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
745 stars 1.44k forks source link

[logs][dhcp] Logs show "eth0: cannot use a string pattern on a bytes-like object" #9630

Open alexrallen opened 2 years ago

alexrallen commented 2 years ago

Description

Receiving error log during switch boot.

Steps to reproduce the issue:

  1. Install SONiC latest master via ONIE
  2. Boot switch and check log

Describe the results you received:

Dec 22 04:26:33.620715 sonic WARNING info: eth0: enabling syslog for dhcp configuration
Dec 22 04:26:33.620980 sonic WARNING info: executing /sbin/dhclient -x -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0
Dec 22 04:26:33.703249 sonic INFO dhclient[2912]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
Dec 22 04:26:33.704191 sonic WARNING info: executing ip -o addr show eth0
Dec 22 04:26:33.710026 sonic WARNING info: executing /sbin/dhclient -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0 -nw
Dec 22 04:26:33.767314 sonic INFO dhclient[2918]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
Dec 22 04:26:34.769348 sonic WARNING info: executing /bin/ip -6 addr show eth0
Dec 22 04:26:34.773013 sonic INFO networking[2886]: error: eth0: cannot use a string pattern on a bytes-like object
Dec 22 04:26:34.773176 sonic WARNING error: eth0: cannot use a string pattern on a bytes-like object

Describe the results you expected:

No error log.

Output of show version:

SONiC Software Version: SONiC.master.244-3aec72879_Internal
Distribution: Debian 11.2
Kernel: 5.10.0-8-2-amd64
Build commit: 3aec72879
Build date: Wed Dec 22 08:30:03 UTC 2021
Built by: sw-r2d2-bot@r-build-sonic-ci02-241

Platform: x86_64-mlnx_msn3420-r0
HwSKU: ACS-MSN3420
ASIC: mellanox
ASIC Count: 1
Serial Number: MT2019X13878
Model Number: MSN3420-CB2FO
Hardware Revision: A1
Uptime: 22:05:10 up  5:42,  5 users,  load average: 1.11, 1.01, 0.78

Docker images:
REPOSITORY                                         TAG                             IMAGE ID       SIZE
docker-platform-monitor                            latest                          3179b3bfa4a2   809MB
docker-platform-monitor                            master.244-3aec72879_Internal   3179b3bfa4a2   809MB
docker-teamd                                       latest                          2f47d005bb95   436MB
docker-teamd                                       master.244-3aec72879_Internal   2f47d005bb95   436MB
docker-syncd-mlnx                                  latest                          cc4d31e33915   1.01GB
docker-syncd-mlnx                                  master.244-3aec72879_Internal   cc4d31e33915   1.01GB
docker-orchagent                                   latest                          5c891ff8f214   455MB
docker-orchagent                                   master.244-3aec72879_Internal   5c891ff8f214   455MB
docker-dhcp-relay                                  latest                          c646bc83cc8c   436MB
docker-sonic-telemetry                             latest                          606f26ae194f   511MB
docker-sonic-telemetry                             master.244-3aec72879_Internal   606f26ae194f   511MB
docker-sonic-mgmt-framework                        latest                          7c86fd946748   578MB
docker-sonic-mgmt-framework                        master.244-3aec72879_Internal   7c86fd946748   578MB
docker-snmp                                        latest                          546605aaf36c   465MB
docker-snmp                                        master.244-3aec72879_Internal   546605aaf36c   465MB
docker-sflow                                       latest                          68f7233b21a9   436MB
docker-sflow                                       master.244-3aec72879_Internal   68f7233b21a9   436MB
docker-router-advertiser                           latest                          dafc3d1fb775   423MB
docker-router-advertiser                           master.244-3aec72879_Internal   dafc3d1fb775   423MB
docker-nat                                         latest                          47bf92fce979   438MB
docker-nat                                         master.244-3aec72879_Internal   47bf92fce979   438MB
docker-mux                                         latest                          b68969e05d75   475MB
docker-mux                                         master.244-3aec72879_Internal   b68969e05d75   475MB
docker-macsec                                      latest                          acb05bec6969   439MB
docker-macsec                                      master.244-3aec72879_Internal   acb05bec6969   439MB
docker-lldp                                        latest                          85f1ea2eb1a0   463MB
docker-lldp                                        master.244-3aec72879_Internal   85f1ea2eb1a0   463MB
docker-fpm-frr                                     latest                          ebb395f4d389   454MB
docker-fpm-frr                                     master.244-3aec72879_Internal   ebb395f4d389   454MB
docker-database                                    latest                          89d24c1c4f64   423MB
docker-database                                    master.244-3aec72879_Internal   89d24c1c4f64   423MB
urm.nvidia.com/sw-nbu-sws-sonic-docker/sonic-wjh   1.0.0-master-internal-18        2290464c0e59   468MB
harbor.mellanox.com/sonic/cpu-report               10.0.0                          5314b41a2a5e   413MB
talber-nvidia commented 2 years ago

0003-Fix-the-return-value-of-utils._execute_subprocess-me.patch.zip This seems to be a general issue in ifupdown2 when it executes commands that result in empty output. In this case the command was: "/bin/ip -6 addr show eth0". It should be fixed by patching ifupdown2, see attached patch.