Bugzilla – Full Text Bug Listing |
Summary: | ifroute files lost | ||
---|---|---|---|
Product: | [openSUSE] openSUSE Distribution | Reporter: | tao lin <tao.lin> |
Component: | YaST2 | Assignee: | YaST Team <yast-internal> |
Status: | CONFIRMED --- | QA Contact: | Jiri Srain <jsrain> |
Severity: | Minor | ||
Priority: | P5 - None | CC: | kanderssen, snwint, tao.lin |
Version: | Leap 15.2 | ||
Target Milestone: | --- | ||
Hardware: | VMWare | ||
OS: | openSUSE Leap 15.2 | ||
URL: | https://trello.com/c/tQr9Uge7 | ||
Whiteboard: | |||
Found By: | --- | Services Priority: | |
Business Priority: | Blocker: | --- | |
Marketing QA Status: | --- | IT Deployment: | --- |
Attachments: |
Full y2log of both tests
logs, code and config files y2log with Y2DEBUG enabled internal error after applying patch |
Description
tao lin
2021-05-15 05:33:13 UTC
Knut, is there a limit? (In reply to tao lin from comment #0) > I found that when I add ifaces more than 17 will cause ifroute files lost, > reproduce steps as below: > 1. There are eth0, eth1 in my os, add extra 14 vlan (vlan11-vlan24) > 2. run "yast lan", change some routes setting, press "F10" to save > configuration, > files under /etc/sysconfig/network: > > localhost:/etc/sysconfig/network # ls ifcfg* > ifcfg-eth0 ifcfg-lo ifcfg-vlan12 ifcfg-vlan14 ifcfg-vlan16 ifcfg-vlan18 > ifcfg-vlan20 ifcfg-vlan22 ifcfg-vlan24 > ifcfg-eth1 ifcfg-vlan11 ifcfg-vlan13 ifcfg-vlan15 ifcfg-vlan17 ifcfg-vlan19 > ifcfg-vlan21 ifcfg-vlan23 > > > > localhost:/etc/sysconfig/network # ls ifroute* > ifroute-eth0 ifroute-vlan11 ifroute-vlan13 ifroute-vlan15 ifroute-vlan17 > ifroute-vlan19 ifroute-vlan21 ifroute-vlan23 > ifroute-eth1 ifroute-vlan12 ifroute-vlan14 ifroute-vlan16 ifroute-vlan18 > ifroute-vlan20 ifroute-vlan22 ifroute-vlan24 > > 3. cp ifcfg-vlan24 ifcfg-vlan25, and change VLAN-ID in ifcfg-vlan25 to 25 > > 4. run yast lan again, press "F10" directly, then Yast will "Saving Network > Configuration" > 5. now files under the directory : > > localhost:/etc/sysconfig/network # ls ifcfg* > ifcfg-eth0 ifcfg-lo ifcfg-vlan12 ifcfg-vlan14 ifcfg-vlan16 ifcfg-vlan18 > ifcfg-vlan20 ifcfg-vlan22 ifcfg-vlan24 > ifcfg-eth1 ifcfg-vlan11 ifcfg-vlan13 ifcfg-vlan15 ifcfg-vlan17 ifcfg-vlan19 > ifcfg-vlan21 ifcfg-vlan23 ifcfg-vlan25 > > > localhost:/etc/sysconfig/network # ls ifroute* > ifroute-vlan11.YaST2save > > Now all ifroute files were lost > > After tracing yast log I find the code in > /usr/share/YaST2/lib/y2network/sysconfig/Config_writer.rb , function name: > write_interface_changes . > Add more logs as below: > 86 file.routes = routes > 87 log.info "route file name #{file.file_path}" > 88 file.save > 89 log.info "save done" > 90 end > 91 > 92 log.info "current config size: #{config.interfaces.size}" > 93 log.info "old config size: #{old_config.interfaces.size}" > 94 > 95 # Actions needed for removed interfaces > 96 removed_ifaces = old_config ? old_config.interfaces.to_a - > config.interfaces.to_a : [] > 97 log.info "removed ifaces size: #{removed_ifaces.size}" > 98 log.info "#{removed_ifaces}" > 99 removed_ifaces.each do |iface| > 100 file = routes_file_for(iface) > 101 log.info "remove route file #{file.file_path}" > 102 file.remove > 103 end > > do the test again and look at logs in /var/log/YaST2/y2log > Deleting ifcfg-vlan25: > 2021-05-15 13:11:57 <1> localhost(10438) [Ruby] > sysconfig/config_writer.rb:92 current config size: 16 > 2021-05-15 13:11:57 <1> localhost(10438) [Ruby] > sysconfig/config_writer.rb:93 old config size: 16 > 2021-05-15 13:11:57 <1> localhost(10438) [Ruby] > sysconfig/config_writer.rb:97 removed ifaces size: 0 > 2021-05-15 13:11:57 <1> localhost(10438) [Ruby] > sysconfig/config_writer.rb:98 [] > 2021-05-15 13:11:57 <1> localhost(10438) [Ruby] lib/cheetah.rb:160 Executing > "/bin/cp /etc/sysconfig/network/routes > /etc/sysconfig/network/routes.YaST2save". > 2021-05-15 13:11:57 <1> localhost(10438) [Ruby] lib/cheetah.rb:180 Status: 0 > > After add ifcfg-vlan25: > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:77 aaaaaa devname: vlan25 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:87 route file name > /etc/sysconfig/network/ifroute-vlan25 > 2021-05-15 13:13:16 <3> localhost(12448) [Interpreter] > sysconfig/routes_file.rb:87 Wrong value for path . > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:89 save done > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:92 current config size: 17 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:93 old config size: 17 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:97 removed ifaces size: 17 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:98 > [#<Y2Network:hysicalInterface:0x000055f4c50c4670 @name="eth0", > @description="eth0", @type=#<Y2Network::InterfaceType:0x000055f4c486a218 > @my_textdomain=["network"], @name="Ethernet", @short_name="eth">, ...... > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-eth0 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-eth1 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan11 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan12 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan13 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan14 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan15 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan16 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan17 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan18 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan19 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan20 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan21 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan22 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan23 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan24 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan25 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] lib/cheetah.rb:160 Executing > "/bin/cp /etc/sysconfig/network/routes > /etc/sysconfig/network/routes.YaST2save". > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] lib/cheetah.rb:180 Status: 0 > > > > > > My system information: > uname -a > Linux localhost 5.3.18-lp152.19-default #1 SMP Tue Jun 9 20:59:24 UTC 2020 > (960cb00) x86_64 x86_64 x86_64 GNU/Linux > > Using wicked as network service. And the ifroute files are empty or not? We used to create them even if empty and it was requested to stop doing that. (In reply to Steffen Winterfeldt from comment #1) > Knut, is there a limit? Not one that I'm aware of. (In reply to Knut Alejandro Anderssen González from comment #2) > (In reply to tao lin from comment #0) > > I found that when I add ifaces more than 17 will cause ifroute files lost, > > reproduce steps as below: > > 1. There are eth0, eth1 in my os, add extra 14 vlan (vlan11-vlan24) > > 2. run "yast lan", change some routes setting, press "F10" to save > > configuration, > > files under /etc/sysconfig/network: > > > > localhost:/etc/sysconfig/network # ls ifcfg* > > ifcfg-eth0 ifcfg-lo ifcfg-vlan12 ifcfg-vlan14 ifcfg-vlan16 ifcfg-vlan18 > > ifcfg-vlan20 ifcfg-vlan22 ifcfg-vlan24 > > ifcfg-eth1 ifcfg-vlan11 ifcfg-vlan13 ifcfg-vlan15 ifcfg-vlan17 ifcfg-vlan19 > > ifcfg-vlan21 ifcfg-vlan23 > > > > > > > > localhost:/etc/sysconfig/network # ls ifroute* > > ifroute-eth0 ifroute-vlan11 ifroute-vlan13 ifroute-vlan15 ifroute-vlan17 > > ifroute-vlan19 ifroute-vlan21 ifroute-vlan23 > > ifroute-eth1 ifroute-vlan12 ifroute-vlan14 ifroute-vlan16 ifroute-vlan18 > > ifroute-vlan20 ifroute-vlan22 ifroute-vlan24 > > > > 3. cp ifcfg-vlan24 ifcfg-vlan25, and change VLAN-ID in ifcfg-vlan25 to 25 > > > > 4. run yast lan again, press "F10" directly, then Yast will "Saving Network > > Configuration" > > 5. now files under the directory : > > > > localhost:/etc/sysconfig/network # ls ifcfg* > > ifcfg-eth0 ifcfg-lo ifcfg-vlan12 ifcfg-vlan14 ifcfg-vlan16 ifcfg-vlan18 > > ifcfg-vlan20 ifcfg-vlan22 ifcfg-vlan24 > > ifcfg-eth1 ifcfg-vlan11 ifcfg-vlan13 ifcfg-vlan15 ifcfg-vlan17 ifcfg-vlan19 > > ifcfg-vlan21 ifcfg-vlan23 ifcfg-vlan25 > > > > > > localhost:/etc/sysconfig/network # ls ifroute* > > ifroute-vlan11.YaST2save > > > > Now all ifroute files were lost > > > > After tracing yast log I find the code in > > /usr/share/YaST2/lib/y2network/sysconfig/Config_writer.rb , function name: > > write_interface_changes . > > Add more logs as below: > > 86 file.routes = routes > > 87 log.info "route file name #{file.file_path}" > > 88 file.save > > 89 log.info "save done" > > 90 end > > 91 > > 92 log.info "current config size: #{config.interfaces.size}" > > 93 log.info "old config size: #{old_config.interfaces.size}" > > 94 > > 95 # Actions needed for removed interfaces > > 96 removed_ifaces = old_config ? old_config.interfaces.to_a - > > config.interfaces.to_a : [] > > 97 log.info "removed ifaces size: #{removed_ifaces.size}" > > 98 log.info "#{removed_ifaces}" > > 99 removed_ifaces.each do |iface| > > 100 file = routes_file_for(iface) > > 101 log.info "remove route file #{file.file_path}" > > 102 file.remove > > 103 end > > > > do the test again and look at logs in /var/log/YaST2/y2log > > Deleting ifcfg-vlan25: > > 2021-05-15 13:11:57 <1> localhost(10438) [Ruby] > > sysconfig/config_writer.rb:92 current config size: 16 > > 2021-05-15 13:11:57 <1> localhost(10438) [Ruby] > > sysconfig/config_writer.rb:93 old config size: 16 > > 2021-05-15 13:11:57 <1> localhost(10438) [Ruby] > > sysconfig/config_writer.rb:97 removed ifaces size: 0 > > 2021-05-15 13:11:57 <1> localhost(10438) [Ruby] > > sysconfig/config_writer.rb:98 [] > > 2021-05-15 13:11:57 <1> localhost(10438) [Ruby] lib/cheetah.rb:160 Executing > > "/bin/cp /etc/sysconfig/network/routes > > /etc/sysconfig/network/routes.YaST2save". > > 2021-05-15 13:11:57 <1> localhost(10438) [Ruby] lib/cheetah.rb:180 Status: 0 > > > > After add ifcfg-vlan25: > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:77 aaaaaa devname: vlan25 > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:87 route file name > > /etc/sysconfig/network/ifroute-vlan25 > > 2021-05-15 13:13:16 <3> localhost(12448) [Interpreter] > > sysconfig/routes_file.rb:87 Wrong value for path . > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:89 save done > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:92 current config size: 17 > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:93 old config size: 17 > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:97 removed ifaces size: 17 > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:98 > > [#<Y2Network:hysicalInterface:0x000055f4c50c4670 @name="eth0", > > @description="eth0", @type=#<Y2Network::InterfaceType:0x000055f4c486a218 > > @my_textdomain=["network"], @name="Ethernet", @short_name="eth">, ...... > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:101 remove route file > > /etc/sysconfig/network/ifroute-eth0 > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:101 remove route file > > /etc/sysconfig/network/ifroute-eth1 > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:101 remove route file > > /etc/sysconfig/network/ifroute-vlan11 > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:101 remove route file > > /etc/sysconfig/network/ifroute-vlan12 > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:101 remove route file > > /etc/sysconfig/network/ifroute-vlan13 > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:101 remove route file > > /etc/sysconfig/network/ifroute-vlan14 > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:101 remove route file > > /etc/sysconfig/network/ifroute-vlan15 > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:101 remove route file > > /etc/sysconfig/network/ifroute-vlan16 > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:101 remove route file > > /etc/sysconfig/network/ifroute-vlan17 > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:101 remove route file > > /etc/sysconfig/network/ifroute-vlan18 > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:101 remove route file > > /etc/sysconfig/network/ifroute-vlan19 > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:101 remove route file > > /etc/sysconfig/network/ifroute-vlan20 > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:101 remove route file > > /etc/sysconfig/network/ifroute-vlan21 > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:101 remove route file > > /etc/sysconfig/network/ifroute-vlan22 > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:101 remove route file > > /etc/sysconfig/network/ifroute-vlan23 > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:101 remove route file > > /etc/sysconfig/network/ifroute-vlan24 > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > > sysconfig/config_writer.rb:101 remove route file > > /etc/sysconfig/network/ifroute-vlan25 > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] lib/cheetah.rb:160 Executing > > "/bin/cp /etc/sysconfig/network/routes > > /etc/sysconfig/network/routes.YaST2save". > > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] lib/cheetah.rb:180 Status: 0 > > > > > > > > > > > > My system information: > > uname -a > > Linux localhost 5.3.18-lp152.19-default #1 SMP Tue Jun 9 20:59:24 UTC 2020 > > (960cb00) x86_64 x86_64 x86_64 GNU/Linux > > > > Using wicked as network service. > > And the ifroute files are empty or not? We used to create them even if empty > and it was requested to stop doing that. Some of ifroutes files are not empty in both tests. Created attachment 849452 [details]
Full y2log of both tests
Attached full y2log for your information.
(In reply to tao lin from comment #5) > Created attachment 849452 [details] > Full y2log of both tests > > Attached full y2log for your information. It looks like it is empty (In reply to Knut Alejandro Anderssen González from comment #6) > (In reply to tao lin from comment #5) > > Created attachment 849452 [details] > > Full y2log of both tests > > > > Attached full y2log for your information. > > It looks like it is empty Sorry, it is not. I checked the wrong one. From that y2logs files there are no routes associated with that interfaces: 2021-05-15 13:11:26 <3> localhost(10438) [Interpreter] sysconfig/routes_file.rb:70 File not found /etc/sysconfig/network/ifroute-eth0 2021-05-15 13:11:26 <3> localhost(10438) [Interpreter] sysconfig/routes_file.rb:70 File not found /etc/sysconfig/network/ifroute-eth1 2021-05-15 13:11:26 <3> localhost(10438) [Interpreter] sysconfig/routes_file.rb:70 File not found /etc/sysconfig/network/ifroute-vlan11 2021-05-15 13:11:26 <3> localhost(10438) [Interpreter] sysconfig/routes_file.rb:70 File not found /etc/sysconfig/network/ifroute-vlan12 2021-05-15 13:11:26 <3> localhost(10438) [Interpreter] sysconfig/routes_file.rb:70 File not found /etc/sysconfig/network/ifroute-vlan13 2021-05-15 13:11:26 <3> localhost(10438) [Interpreter] sysconfig/routes_file.rb:70 File not found /etc/sysconfig/network/ifroute-vlan14 2021-05-15 13:11:26 <3> localhost(10438) [Interpreter] sysconfig/routes_file.rb:70 File not found /etc/sysconfig/network/ifroute-vlan15 2021-05-15 13:11:26 <3> localhost(10438) [Interpreter] sysconfig/routes_file.rb:70 File not found /etc/sysconfig/network/ifroute-vlan16 2021-05-15 13:11:26 <3> localhost(10438) [Interpreter] sysconfig/routes_file.rb:70 File not found /etc/sysconfig/network/ifroute-vlan17 2021-05-15 13:11:26 <3> localhost(10438) [Interpreter] sysconfig/routes_file.rb:70 File not found /etc/sysconfig/network/ifroute-vlan18 2021-05-15 13:11:26 <3> localhost(10438) [Interpreter] sysconfig/routes_file.rb:70 File not found /etc/sysconfig/network/ifroute-vlan19 2021-05-15 13:11:26 <3> localhost(10438) [Interpreter] sysconfig/routes_file.rb:70 File not found /etc/sysconfig/network/ifroute-vlan20 2021-05-15 13:11:26 <3> localhost(10438) [Interpreter] sysconfig/routes_file.rb:70 File not found /etc/sysconfig/network/ifroute-vlan21 2021-05-15 13:11:26 <3> localhost(10438) [Interpreter] sysconfig/routes_file.rb:70 File not found /etc/sysconfig/network/ifroute-vlan22 2021-05-15 13:11:26 <3> localhost(10438) [Interpreter] sysconfig/routes_file.rb:70 File not found /etc/sysconfig/network/ifroute-vlan23 2021-05-15 13:11:26 <3> localhost(10438) [Interpreter] sysconfig/routes_file.rb:70 File not found /etc/sysconfig/network/ifroute-vlan24 But just a default one. 2021-05-15 13:11:26 <1> localhost(10438) [Ruby] sysconfig/config_reader.rb:97 found routes [#<Y2Network::Route:0x0000560e72829ea8 @to=:default, @interface=nil, @gateway=#<IPAddr: IPv4:172.31.0.1/255.255.255.255>, @options="">] About y2logs it is preferable to use save_y2logs as documented here: https://en.opensuse.org/openSUSE:Report_a_YaST_bug Besides of the default route, there is a ifroute-vlan11 under the directory too. Created attachment 849521 [details]
logs, code and config files
I just do the test again, and packing all related files into all-log-conf-code.tar.
Let me explain files in the package:
config_writer.rb ------> I adding some logs in it.
y2logs.tgz ----> generated by save_y2logs
sysconfig.tar.gz ---> pack of /etc/sysconfig
Please unpack sysconfig.tar.gz to somewhere, we can find out there are some directories:
network ---- network configuration file location
stat1 & stat2 -> backup of network directory during the tests.
Step 1, I copied /etc/sysconfig/network to /etc/sysconfig/stat1,
We can find out ifcfg-vlan11 ~ ifcfg-vlan24 under the directory.
step 2, run yast lan, add a route setting for vlan12, save and close.
We can got a non-empty ifroute-vlan12 and some empty ifroute files else.
step 3, I copied network directory to stat2,
cd network, mv bak/ifcfg-vlan25 to current dir.
run yast lan again, save and close. We got files under network directory.
I think it is a bug of operation on array in ruby. (line 96)
I'm not familiar with both ruby and yast, forget that if I'm wrong.
(In reply to tao lin from comment #11) > Created attachment 849521 [details] > logs, code and config files > > I just do the test again, and packing all related files into > all-log-conf-code.tar. > Let me explain files in the package: > > config_writer.rb ------> I adding some logs in it. > y2logs.tgz ----> generated by save_y2logs > sysconfig.tar.gz ---> pack of /etc/sysconfig > > Please unpack sysconfig.tar.gz to somewhere, we can find out there are some > directories: > network ---- network configuration file location > stat1 & stat2 -> backup of network directory during the tests. > > Step 1, I copied /etc/sysconfig/network to /etc/sysconfig/stat1, > We can find out ifcfg-vlan11 ~ ifcfg-vlan24 under the directory. > > step 2, run yast lan, add a route setting for vlan12, save and close. > We can got a non-empty ifroute-vlan12 and some empty ifroute files else. > > step 3, I copied network directory to stat2, > cd network, mv bak/ifcfg-vlan25 to current dir. > run yast lan again, save and close. We got files under network directory. > > I think it is a bug of operation on array in ruby. (line 96) > I'm not familiar with both ruby and yast, forget that if I'm wrong. I will try to reproduce my self, but just a quick question, which version of yast2-network are u currently using? apparently from logs it is 4.2.66 and last version for Leap15.2 is around 4.2.99 ... just in case it is an already fixed bug... YaST2 version is yast2-4.2.83-lp152.1.1.x86_64. I will trying to upgrade yast2 to the latest version and do the test again. Waiting for my report. My mistake, I yast2-network version is 4.2.66 currently just like your said. > I will try to reproduce my self, but just a quick question, which version of
> yast2-network are u currently using? apparently from logs it is 4.2.66 and
> last version for Leap15.2 is around 4.2.99 ... just in case it is an already
> fixed bug...
I have updated yast2-network to 4.2.97, 4.2.99 and 4.4.10 respectively and repeat the test, all of them got the same result.
For me the problem is still in the reader: As only the default route is read. sysconfig/config_reader.rb:97 found routes [#<Y2Network::Route:0x0000561568d3da78 @to=:default, @interface=nil, @gateway=#<IPAddr: IPv4:172.18.0.1/255.255.255.255>, @options="">] I tried to reproduce it but sill not able to. Could you run the same test with Y2DEBUG enabled? https://en.opensuse.org/openSUSE:YaST_debugging (In reply to tao lin from comment #11) > Created attachment 849521 [details] > logs, code and config files > > I just do the test again, and packing all related files into > all-log-conf-code.tar. > Let me explain files in the package: > > config_writer.rb ------> I adding some logs in it. > y2logs.tgz ----> generated by save_y2logs > sysconfig.tar.gz ---> pack of /etc/sysconfig > > Please unpack sysconfig.tar.gz to somewhere, we can find out there are some > directories: > network ---- network configuration file location > stat1 & stat2 -> backup of network directory during the tests. > > Step 1, I copied /etc/sysconfig/network to /etc/sysconfig/stat1, > We can find out ifcfg-vlan11 ~ ifcfg-vlan24 under the directory. > > step 2, run yast lan, add a route setting for vlan12, save and close. > We can got a non-empty ifroute-vlan12 and some empty ifroute files else. > > step 3, I copied network directory to stat2, > cd network, mv bak/ifcfg-vlan25 to current dir. > run yast lan again, save and close. We got files under network directory. > > I think it is a bug of operation on array in ruby. (line 96) > I'm not familiar with both ruby and yast, forget that if I'm wrong. Could be related... and maybe you are assumption is good as them are not the interface names but the objects (I will check it later). Created attachment 849547 [details]
y2log with Y2DEBUG enabled
Attached y2log with Y2DEBUG enabled.
The test steps:
1.
cd /etc/sysconfig/network/
mv ifcfg-vlan25 bak/
Y2DEBUG=1 /sbin/yast2 lan
add a route for vlan12
save and quit
I got a ifroute-vlan12 (not empty)
2.
mv bak/ifcfg-vlan25 .
Y2DEBUG=1 /sbin/yast2 lan
Press "F10" immediately, YaST showed "Saving configuration" for a few seconds.
localhost:/etc/sysconfig/network # ls -l ifroute*
-rw-r--r-- 1 root root 27 May 21 09:54 ifroute-eth0.YaST2save
-rw-r--r-- 1 root root 38 May 21 09:54 ifroute-vlan11.YaST2save
-rw-r--r-- 1 root root 38 May 21 09:54 ifroute-vlan12.YaST2save
yast2-network version is yast2-network-4.2.99-lp152.1.1
(In reply to tao lin from comment #0) > I found that when I add ifaces more than 17 will cause ifroute files lost, > reproduce steps as below: Already reproduced the issue: You can test it with irb: sudo irb require 'yast' Yast.import "Lan" Yast::Lan.Read(:cache) Yast::Lan.system_config.interfaces.to_a - Yast::Lan.yast_config.interfaces.to_a > 1. There are eth0, eth1 in my os, add extra 14 vlan (vlan11-vlan24) > 2. run "yast lan", change some routes setting, press "F10" to save > configuration, > files under /etc/sysconfig/network: > > localhost:/etc/sysconfig/network # ls ifcfg* > ifcfg-eth0 ifcfg-lo ifcfg-vlan12 ifcfg-vlan14 ifcfg-vlan16 ifcfg-vlan18 > ifcfg-vlan20 ifcfg-vlan22 ifcfg-vlan24 > ifcfg-eth1 ifcfg-vlan11 ifcfg-vlan13 ifcfg-vlan15 ifcfg-vlan17 ifcfg-vlan19 > ifcfg-vlan21 ifcfg-vlan23 > > > > localhost:/etc/sysconfig/network # ls ifroute* > ifroute-eth0 ifroute-vlan11 ifroute-vlan13 ifroute-vlan15 ifroute-vlan17 > ifroute-vlan19 ifroute-vlan21 ifroute-vlan23 > ifroute-eth1 ifroute-vlan12 ifroute-vlan14 ifroute-vlan16 ifroute-vlan18 > ifroute-vlan20 ifroute-vlan22 ifroute-vlan24 > > 3. cp ifcfg-vlan24 ifcfg-vlan25, and change VLAN-ID in ifcfg-vlan25 to 25 > > 4. run yast lan again, press "F10" directly, then Yast will "Saving Network > Configuration" > 5. now files under the directory : > > localhost:/etc/sysconfig/network # ls ifcfg* > ifcfg-eth0 ifcfg-lo ifcfg-vlan12 ifcfg-vlan14 ifcfg-vlan16 ifcfg-vlan18 > ifcfg-vlan20 ifcfg-vlan22 ifcfg-vlan24 > ifcfg-eth1 ifcfg-vlan11 ifcfg-vlan13 ifcfg-vlan15 ifcfg-vlan17 ifcfg-vlan19 > ifcfg-vlan21 ifcfg-vlan23 ifcfg-vlan25 > > > localhost:/etc/sysconfig/network # ls ifroute* > ifroute-vlan11.YaST2save > > Now all ifroute files were lost > > After tracing yast log I find the code in > /usr/share/YaST2/lib/y2network/sysconfig/Config_writer.rb , function name: > write_interface_changes . > Add more logs as below: > 86 file.routes = routes > 87 log.info "route file name #{file.file_path}" > 88 file.save > 89 log.info "save done" > 90 end > 91 > 92 log.info "current config size: #{config.interfaces.size}" > 93 log.info "old config size: #{old_config.interfaces.size}" > 94 > 95 # Actions needed for removed interfaces > 96 removed_ifaces = old_config ? old_config.interfaces.to_a - > config.interfaces.to_a : [] > 97 log.info "removed ifaces size: #{removed_ifaces.size}" > 98 log.info "#{removed_ifaces}" > 99 removed_ifaces.each do |iface| > 100 file = routes_file_for(iface) > 101 log.info "remove route file #{file.file_path}" > 102 file.remove > 103 end > > do the test again and look at logs in /var/log/YaST2/y2log > Deleting ifcfg-vlan25: > 2021-05-15 13:11:57 <1> localhost(10438) [Ruby] > sysconfig/config_writer.rb:92 current config size: 16 > 2021-05-15 13:11:57 <1> localhost(10438) [Ruby] > sysconfig/config_writer.rb:93 old config size: 16 > 2021-05-15 13:11:57 <1> localhost(10438) [Ruby] > sysconfig/config_writer.rb:97 removed ifaces size: 0 > 2021-05-15 13:11:57 <1> localhost(10438) [Ruby] > sysconfig/config_writer.rb:98 [] > 2021-05-15 13:11:57 <1> localhost(10438) [Ruby] lib/cheetah.rb:160 Executing > "/bin/cp /etc/sysconfig/network/routes > /etc/sysconfig/network/routes.YaST2save". > 2021-05-15 13:11:57 <1> localhost(10438) [Ruby] lib/cheetah.rb:180 Status: 0 > > After add ifcfg-vlan25: > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:77 aaaaaa devname: vlan25 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:87 route file name > /etc/sysconfig/network/ifroute-vlan25 > 2021-05-15 13:13:16 <3> localhost(12448) [Interpreter] > sysconfig/routes_file.rb:87 Wrong value for path . > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:89 save done > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:92 current config size: 17 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:93 old config size: 17 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:97 removed ifaces size: 17 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:98 > [#<Y2Network:hysicalInterface:0x000055f4c50c4670 @name="eth0", > @description="eth0", @type=#<Y2Network::InterfaceType:0x000055f4c486a218 > @my_textdomain=["network"], @name="Ethernet", @short_name="eth">, ...... > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-eth0 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-eth1 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan11 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan12 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan13 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan14 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan15 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan16 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan17 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan18 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan19 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan20 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan21 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan22 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan23 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan24 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] > sysconfig/config_writer.rb:101 remove route file > /etc/sysconfig/network/ifroute-vlan25 > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] lib/cheetah.rb:160 Executing > "/bin/cp /etc/sysconfig/network/routes > /etc/sysconfig/network/routes.YaST2save". > 2021-05-15 13:13:16 <1> localhost(12448) [Ruby] lib/cheetah.rb:180 Status: 0 > > > > > > My system information: > uname -a > Linux localhost 5.3.18-lp152.19-default #1 SMP Tue Jun 9 20:59:24 UTC 2020 > (960cb00) x86_64 x86_64 x86_64 GNU/Linux > > Using wicked as network service. This patch fix the issue but it is a workaround while we investigate the real reason / problem https://github.com/yast/yast-network/compare/SLE-15-SP2...fix_collections_difference.patch At the end you was completely right and there is a size limit when comparing arrays which changes the way the objects are compared. https://github.com/ruby/ruby/blob/master/array.c#L47 https://apidock.com/ruby/v2_5_5/Array/- So, if you have more than 16 elements it uses the 'hash' method instead of the 'eql?' one. Created attachment 849570 [details] internal error after applying patch (In reply to Knut Alejandro Anderssen González from comment #21) > This patch fix the issue but it is a workaround while we investigate the > real reason / problem > > https://github.com/yast/yast-network/compare/SLE-15-SP2... > fix_collections_difference.patch I'm glad to be informed the progress. I ran the test again after applying the patch. I got a Internal error when I save the changes: Internal error. Please report a bug report with logs. Run save_y2logs to get complete logs. Caller: /usr/share/YaST2/lib/y2network/interfaces_collection.rb:14 0:in `block in -' Details: undefined method `none?' for # Patched /usr/share/YaST2/lib/y2network/interfaces_collection.rb: 129 # @param other [InterfacesCollection] Other interfaces collection 130 # @return [InterfacesCollection] New interfaces collection 131 def +(other) 132 self.class.new(to_a + other.to_a) 133 end 134 135 # Returns a new collection including only the elements that are not in the given collection 136 # 137 # @param other [InterfacesCollection] Other interfaces collection 138 # @return [InterfacesCollection] New interfaces collection 139 def -(other) 140 self.class.new(select { |i| other.none? { |oi| i == oi } }.to_a) 141 end os environment: yast2-network-4.2.99-lp152.1.1 ruby-2.5-lp152.3.6.x86_64 attached y2log for your information. (In reply to tao lin from comment #23) > Created attachment 849570 [details] > internal error after applying patch > > (In reply to Knut Alejandro Anderssen González from comment #21) > > This patch fix the issue but it is a workaround while we investigate the > > real reason / problem > > > > https://github.com/yast/yast-network/compare/SLE-15-SP2... > > fix_collections_difference.patch > > I'm glad to be informed the progress. > > I ran the test again after applying the patch. > I got a Internal error when I save the changes: > > Internal error. Please report a bug report with logs. > Run save_y2logs to get complete logs. > > Caller: > /usr/share/YaST2/lib/y2network/interfaces_collection.rb:14 > 0:in `block in -' > > Details: undefined method `none?' for # My fault, it was modified by rubocop and I didn't tested it again, basically the none? method is not delegated. I have commited the fix sorry. https://github.com/yast/yast-network/compare/SLE-15-SP2...fix_collections_difference.patch > > Patched /usr/share/YaST2/lib/y2network/interfaces_collection.rb: > 129 # @param other [InterfacesCollection] Other interfaces collection > 130 # @return [InterfacesCollection] New interfaces collection > 131 def +(other) > 132 self.class.new(to_a + other.to_a) > 133 end > 134 > 135 # Returns a new collection including only the elements that are not > in the given collection > 136 # > 137 # @param other [InterfacesCollection] Other interfaces collection > 138 # @return [InterfacesCollection] New interfaces collection > 139 def -(other) > 140 self.class.new(select { |i| other.none? { |oi| i == oi } }.to_a) > 141 end > > os environment: > yast2-network-4.2.99-lp152.1.1 > ruby-2.5-lp152.3.6.x86_64 > > attached y2log for your information. Here is finally the proposed fix: https://github.com/yast/yast-network/pull/1225 You can try the patch https://github.com/yast/yast-network/pull/1225.patch if you want to. As it is already approved and I verified it I will create a new MU, so the RPM should be available soon. We still need to fix this in other classes that could be affected like the connections one. Thnx a lot for the error reported, it alerted us about other possible classes that could be affected by current implementation. https://lists.opensuse.org/archives/list/yast-devel@lists.opensuse.org/thread/KAXJ5IJ44WTWQUEVTLHPVUFU3BYNBBG6/ (In reply to Knut Alejandro Anderssen González from comment #25) > Here is finally the proposed fix: > > https://github.com/yast/yast-network/pull/1225 > > You can try the patch https://github.com/yast/yast-network/pull/1225.patch > if you want to. > > As it is already approved and I verified it I will create a new MU, so the > RPM should be available soon. > > We still need to fix this in other classes that could be affected like the > connections one. > > Thnx a lot for the error reported, it alerted us about other possible > classes that could be affected by current implementation. > > https://lists.opensuse.org/archives/list/yast-devel@lists.opensuse.org/ > thread/KAXJ5IJ44WTWQUEVTLHPVUFU3BYNBBG6/ Great! It's good to see the problem be solved. SUSE-RU-2021:1925-1: An update that has two recommended fixes can now be installed. Category: recommended (moderate) Bug References: 1185967,1186082 CVE References: JIRA References: Sources used: SUSE Linux Enterprise Module for Basesystem 15-SP3 (src): yast2-network-4.3.69-3.5.1 NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination. SUSE-RU-2021:1985-1: An update that has one recommended fix can now be installed. Category: recommended (moderate) Bug References: 1186082 CVE References: JIRA References: Sources used: SUSE Linux Enterprise Module for Basesystem 15-SP2 (src): yast2-network-4.2.100-3.61.1 SUSE Linux Enterprise Installer 15-SP2 (src): yast2-network-4.2.100-3.61.1 NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination. openSUSE-RU-2021:1925-1: An update that has two recommended fixes can now be installed. Category: recommended (moderate) Bug References: 1185967,1186082 CVE References: JIRA References: Sources used: openSUSE Leap 15.3 (src): yast2-network-4.3.69-3.5.1 |