#2197 Issue closed: cat: /sys/class/net/eth0/name_assign_type: Invalid argument

Labels: support / question, no-issue-activity

mvolgincl opened issue at 2019-07-31 12:19:

Relax-and-Recover (ReaR) Issue Template

Fill in the following items before submitting a new issue
(quick response is not guaranteed with free support):

  • ReaR version ("/usr/sbin/rear -V"):
    Relax-and-Recover 2.5 / 2019-05-10

  • OS version ("cat /etc/rear/os.conf" or "lsb_release -a" or "cat /etc/os-release"):
    lsb_release -a
    LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
    Distributor ID: CentOS
    Description: CentOS release 6.10 (Final)
    Release: 6.10
    Codename: Final

Bug after update to 2.5:

rear mkrescue
Skipping 'eth0': not yet supported.
Failed to handle network interface 'eth0'.
Failed to copy target of symlink '/etc/mtab' -> '/etc/mtab'
Broken symlink '/lib/modules/2.6.32-754.17.1.el6.x86_64/build' in recovery system because 'readlink' cannot determine its link target
Broken symlink '/lib/modules/2.6.32-754.17.1.el6.x86_64/source' in recovery system because 'readlink' cannot determine its link target
There are binaries or libraries in the ReaR recovery system that need additional libraries
/usr/lib64/python2.6/site-packages/dmidecodemod.so requires additional libraries
        libxml2mod.so => not found
ReaR recovery system in '/opt/bacula/bacula4hosts/rear/tmp/rear.dDoIH9AjOK2oC4X/rootfs' needs additional libraries, check /var/log/rear/rear-unknown.log for details

Log:

2019-07-31 08:11:19.458154249 Including rescue/GNU/Linux/250_udev.sh
2019-07-31 08:11:19.470532177 Including rescue/GNU/Linux/260_collect_initrd_modules.sh
2019-07-31 08:11:21.509188800 Including rescue/GNU/Linux/260_storage_drivers.sh
2019-07-31 08:11:21.673325646 Including rescue/GNU/Linux/290_kernel_cmdline.sh
cat: /sys/class/net/eth0/name_assign_type: Invalid argument
2019-07-31 08:11:21.770779112 Including rescue/GNU/Linux/300_dns.sh
2019-07-31 08:11:21.788153079 Including rescue/GNU/Linux/310_network_devices.sh
2019-07-31 08:11:21.944941067 Skipping 'eth0': not yet supported.
2019-07-31 08:11:21.953912446 Failed to handle network interface 'eth0'.
2019-07-31 08:11:21.978054164 Including rescue/GNU/Linux/320_inet6.sh
00000000000000000000000000000001 01 80 10 80       lo
260593000001000194ee89fffe040c87 02 40 00 00     eth0
fe8000000000000094ee89fffe040c87 02 40 20 80     eth0
2019-07-31 08:11:22.000318114 Including rescue/GNU/Linux/350_routing.sh

as far as i see it exists:

[root@unknown rear]# ls -al /sys/class/net/eth0/name_assign_type
-r--r--r-- 1 root root 4096 Jul 31 08:15 /sys/class/net/eth0/name_assign_type

but cat gives an error:

[root@unknown rear]# cat /sys/class/net/eth0/name_assign_type
cat: /sys/class/net/eth0/name_assign_type: Invalid argument

[root@unknown rear]# cp  /sys/class/net/eth0/name_assign_type test
cp: reading `/sys/class/net/eth0/name_assign_type': Invalid argument

gdha commented at 2019-07-31 13:01:

@mvolgincl When you say "bug after update to 2.5" does that mean that with 2.4 you did not have this warning?
Is the ISO image created? Did you tested it? As far as I can see the missing library is for python, but rear does not require python.

mvolgincl commented at 2019-07-31 13:24:

I not sure which version were before 2.5 :) It generates iso but as far as i understand without lan settings.

So if i extract iso:

isoinfo -i /opt/bacula/bacula4hosts/rear/iso//rear-unknown.iso -x '/ISOLINUX/INITRD.CGZ;1' |gzip -d| cpio -idmv

etc/mac-addresses does not exist:

cat etc/mac-addresses
cat: etc/mac-addresses: No such file or directory

P.S. python is OK i understand it.

gdha commented at 2019-07-31 16:08:

@mvolgincl why should you need etc/mac-addresses by default? I do not think there is anything wrong in your case. See issue https://github.com/rear/rear/issues/861 for an old (bug) discussion on that topic. Perhaps it explains a bit more how to deal with mac addresses?

mvolgincl commented at 2019-08-01 06:40:

I do not reefer to mapping at all. I'm talking about /etc/mac-addresses as an example what is missing so It does not start network on recovery as it was always before.

But it does work if i define it as boot options

mvolgincl commented at 2019-08-01 06:45:

so it getting cp: reading `/sys/class/net/eth0/name_assign_type': Invalid argument and do not set network at all, that is the bug

gdha commented at 2019-08-01 09:10:

As a reference only (so others understand what name_assign_type means):

What:       /sys/class/net/<iface>/name_assign_type
Date:       July 2014
KernelVersion:  3.17
Contact:    netdev@vger.kernel.org
Description:
        Indicates the name assignment type. Possible values are:
        1: enumerated by the kernel, possibly in an unpredictable way
        2: predictably named by the kernel
        3: named by userspace
        4: renamed

@mvolgincl Did you recently updated RHEL 6.x to 6.10 perhaps? If that is the case I would open a software case at RedHat for an explanation of this phenomena.

The call is done from https://github.com/rear/rear/search?q=is%3Aopen+name_assign_type&unscoped_q=is%3Aopen+name_assign_type

gdha commented at 2019-08-01 09:11:

@rmetrich Does this ring a bell with you?

rmetrich commented at 2019-08-01 10:27:

@gdha Sorry no idea, never saw that parameter before.

@mvolgincl Please provide the rear -dD mkrescue log file, that Skipping 'eth0': not yet supported. isn't supposed to happen. Also please provide content of /sys/class/net/eth0 directory (usecpnottar`, it won't work).

mvolgincl commented at 2019-08-01 12:09:

Not it was not recent update.

[root@unknown ~]# rear -dD mkrescue
Relax-and-Recover 2.5 / 2019-05-10
Running rear mkrescue (PID 14135)
Using log file: /var/log/rear/rear-unknown.log
Using autodetected kernel '/boot/vmlinuz-2.6.32-754.17.1.el6.x86_64' as kernel in the recovery system
Creating disk layout
Using guessed bootloader 'GRUB' (found in first bytes on /dev/xvda)
Verifying that the entries in /var/lib/rear/layout/disklayout.conf are correct ...
Creating root filesystem layout
Handling network interface 'eth0'
eth0 is a physical device
Skipping 'eth0': not yet supported.
Failed to handle network interface 'eth0'.
Copying logfile /var/log/rear/rear-unknown.log into initramfs as '/tmp/rear-unknown-partial-2019-08-01T07:54:57-0400.log'
Copying files and directories
Copying binaries and libraries
Copying all kernel modules in /lib/modules/2.6.32-754.17.1.el6.x86_64 (MODULES contains 'all_modules')
Copying all files in /lib*/firmware/
Failed to copy target of symlink '/etc/mtab' -> '/etc/mtab'
Broken symlink '/lib/modules/2.6.32-754.17.1.el6.x86_64/build' in recovery system because 'readlink' cannot determine its link target
Broken symlink '/lib/modules/2.6.32-754.17.1.el6.x86_64/source' in recovery system because 'readlink' cannot determine its link target
Testing that the recovery system in /opt/bacula/bacula4hosts/rear/tmp/rear.AzvYJdYnzSJWBC7/rootfs contains a usable system
There are binaries or libraries in the ReaR recovery system that need additional libraries
/usr/lib64/python2.6/site-packages/dmidecodemod.so requires additional libraries
        libxml2mod.so => not found
ReaR recovery system in '/opt/bacula/bacula4hosts/rear/tmp/rear.AzvYJdYnzSJWBC7/rootfs' needs additional libraries, check /var/log/rear/rear-unknown.log for details
Creating recovery/rescue system initramfs/initrd initrd.cgz with gzip default compression
Created initrd.cgz with gzip default compression (132771647 bytes) in 28 seconds
Making ISO image
Wrote ISO image: /opt/bacula/bacula4hosts/rear/iso//rear-unknown.iso (134M)
Copying resulting files to file location
Saving /var/log/rear/rear-unknown.log as rear-unknown.log to file location
Copying result files '/opt/bacula/bacula4hosts/rear/iso//rear-unknown.iso /opt/bacula/bacula4hosts/rear/tmp/rear.AzvYJdYnzSJWBC7/tmp/VERSION /opt/bacula/bacula4hosts/rear/tmp/rear.AzvYJdYnzSJWBC7/tmp/README /opt/bacula/bacula4hosts/rear/tmp/rear.AzvYJdYnzSJWBC7/tmp/rear-unknown.log' to /opt/bacula/bacula4hosts/rear/iso//unknown at file location
Exiting rear mkrescue (PID 14135) and its descendant processes ...
Running exit tasks
You should also rm -Rf /opt/bacula/bacula4hosts/rear/tmp/rear.AzvYJdYnzSJWBC7

rear-unknown.log.gz

[root@unknown eth0]# cp -a /sys/class/net/eth0/* .
cp: reading `/sys/class/net/eth0/duplex': Invalid argument
cp: reading `/sys/class/net/eth0/name_assign_type': Invalid argument
cp: reading `/sys/class/net/eth0/phys_port_id': Operation not supported
cp: reading `/sys/class/net/eth0/speed': Invalid argument

eth0.zip

gdha commented at 2019-09-05 15:22:

@mvolgincl The problem is coming from function is_persistent_ethernet_name of script /usr/share/rear/lib/network-functions.sh.
I guess that on RHEL 6 this is giving issues...

A possible work-around could be in that function:

[ -f "/sys/class/net/$_netif/name_assign_type" ]   && _name_assign_type=$(cat "/sys/class/net/$_netif/name_assign_type" 2>/dev/null)
[ "$_name_assign_type" = "" ] && return 1  # RHEL 6

gdha commented at 2019-09-10 07:21:

@mvolgincl The real error should be found in script /usr/share/rear/rescue/GNU/Linux/310_network_devices.sh and more specific in the function (in the same script) handle_physdev where for eth0 the following is found:

++ Log 'eth0 is a physical device'
++ echo '2019-08-01 07:54:56.174100245 eth0 is a physical device'
2019-08-01 07:54:56.174100245 eth0 is a physical device
++ test 1
++ Print 'eth0 is a physical device'
++ local mac=
++ has_binary ethtool
++ for bin in '$@'
++ type ethtool
++ return 0
+++ ethtool -P eth0
+++ awk '{ print $NF }'
++ mac=00:00:00:00:00:00
++ '[' -z 00:00:00:00:00:00 ']'
++ '[' 00:00:00:00:00:00 '!=' 00:00:00:00:00:00 ']'
++ return 1
++ rc=1

I wonder why the output of the command ethtool -P eth0 returns 00:00:00:00:00:00 ?
From the eth0.zip file I found address to contain 96:ee:89:04:0c:87, which means I really want to see what the output is of ethtool -P eth0

mvolgincl commented at 2019-09-10 13:28:

yes, it returns zeros:

[root@unknown ~]#  ethtool -P eth0
Permanent address: 00:00:00:00:00:00

Then:

[root@unknown ~]# ifconfig 
eth0      Link encap:Ethernet  HWaddr 96:EE:89:04:0C:87  
          inet addr:96.125.182.106  Bcast:96.125.182.255  Mask:255.255.255.0
          inet6 addr: 2605:9300:1:1:94ee:89ff:fe04:c87/64 Scope:Global
          inet6 addr: fe80::94ee:89ff:fe04:c87/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:53278596 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18121984 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:7571577904 (7.0 GiB)  TX bytes:28728194776 (26.7 GiB)
          Interrupt:18

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:2446347 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2446347 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:847907147 (808.6 MiB)  TX bytes:847907147 (808.6 MiB)

pcahyna commented at 2019-09-10 14:27:

This is not a general problem in RHEL 6 because on a test machine it returns a reasonable MAC address.

rmetrich commented at 2019-09-10 15:12:

@mvolgincl please provide a sosreport if you can, I would like to take a look at this.

mvolgincl commented at 2019-09-11 06:32:

Sos report:

sosreport-unknown.static.tor01.cologlobal.com-20190911022042.tar.xz.gz

gdha commented at 2019-10-05 09:57:

@rmetrich Any result/progress on this?

rmetrich commented at 2019-10-05 10:03:

@gdha Sorry, didn't find time to look at this.

jsmeix commented at 2020-04-29 15:57:

https://github.com/rear/rear/issues/2197#issuecomment-529961331
"This is not a general problem in RHEL 6"
indicates we can postpone this support question to ReaR 2.7

github-actions commented at 2020-06-29 01:37:

Stale issue message


[Export of Github issue for rear/rear.]