Bug 1193195 - nil:NilClass crash in yast2-network in ipv4? in configure_gateway: Network Manager doesn't take over from wicked
nil:NilClass crash in yast2-network in ipv4? in configure_gateway: Network Ma...
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Distribution
Classification: openSUSE
Component: Network
Leap 15.3
64bit openSUSE Leap 15.3
: P5 - None : Normal (vote)
: ---
Assigned To: YaST Team
E-mail List
https://trello.com/c/xLR4mLpR
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-11-29 21:02 UTC by William Flanagan
Modified: 2022-10-04 08:15 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
yast doesn't switch control from wicked to Network Manager (5.46 MB, application/x-xz)
2021-11-29 21:02 UTC, William Flanagan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description William Flanagan 2021-11-29 21:02:30 UTC
Created attachment 854152 [details]
yast doesn't switch control from wicked to Network Manager

Wanted to move from wicked to network manager.  Yast didn't complete the job in Network Settings but gave this error message:

Caller: /usr/share/YaST2/lib/y2network/network_manager/connection_config_writers/base.rb:72:in `configure_gateway'

Details: undefined method `ipv4?' for nil:NilClass

Log attached.

In search of other bugs, found this request for information, so included it.

>  systemctl list-dependencies --reverse NetworkManager-wait-online.service
NetworkManager-wait-online.service
● └─network-online.target
●   └─nmb.service

The goal is to have different DHCP services from external devices on eth0 and wlan0, if possible.  Or would it be better to assign static IP addresses with wicked?  The notebook computer in question will be set up with TeamViewer so a remote programmer can access a test network.

Thanks for suggestions.
Comment 1 Chenzi Cao 2021-12-06 06:55:47 UTC
Assign to yast team to take a look at this bug report, please feel free to reassign whenever necessary, thanks.
Comment 2 Stefan Hundhammer 2021-12-06 08:21:20 UTC
Yes, this sounds indeed like a bug in yast2-network.
Comment 3 Stefan Hundhammer 2021-12-06 09:09:57 UTC
From the y2logs tarball:


2021-11-29 15:01:53 <1> suslix(3928) [Ruby]
  bin/y2start(<main>):22 y2base called with
  ["lan", "qt", "-name", "YaST2", "-icon", "yast"]

...
...

2021-11-29 15:02:13 <3> suslix(3928) [Interpreter]
  y2network/driver.rb:94 setOptions:Empty map

2021-11-29 15:02:13 <3> suslix(3928) [Interpreter]
  y2network/driver.rb:94 setOptions:Empty map

2021-11-29 15:02:18 <1> suslix(3928) [Ruby]
  y2network/interface.rb(update_udev_rule):123 Updating udev rule
  for wlan0 based on: :mac

2021-11-29 15:02:18 <1> suslix(3928) [Ruby]
  y2network/interface.rb(update_udev_rule):123 Updating udev rule
  for eth0 based on: :mac

2021-11-29 15:02:18 <2> suslix(4071) [ag_udev_persistent]
  YaPI is deprecated, do not use it anymore! It will be removed soon.

...
...

2021-11-29 15:02:19 <3> suslix(3928) [Ruby]
  yast/wfm.rb(handle_exception):272 Client
  /usr/share/YaST2/clients/lan.rb failed with
  'undefined method `ipv4?'
  for nil:NilClass' (NoMethodError).


Backtrace:

.../lib/y2network/network_manager/connection_config_writers/base.rb:72:
  in `configure_gateway'

.../lib/y2network/network_manager/connection_config_writers/base.rb:67:
  in `block in configure_routes'

.../lib/y2network/network_manager/connection_config_writers/base.rb:67:
  in `each'

.../lib/y2network/network_manager/connection_config_writers/base.rb:67:
  in `configure_routes'

.../lib/y2network/network_manager/connection_config_writers/base.rb:55:
  in `write'

.../lib/y2network/network_manager/connection_config_writer.rb:49:
  in `write'

.../lib/y2network/network_manager/config_writer.rb:42:
  in `block in write_connections'

.../ruby/2.5.0/forwardable.rb:229:
  in `each'

.../lib/y2network/network_manager/config_writer.rb:37:
  in `write_connections'

.../lib/y2network/config_writer.rb:77:
  in `block in write'

.../lib/y2network/config_writer.rb:76:
  in `each'

.../lib/y2network/config_writer.rb:76:
  in `write'

.../lib/y2network/config.rb:141:
  in `write'

.../modules/Lan.rb:734:
  in `write_config'

.../modules/Lan.rb:440:
  in `Write'

.../include/network/lan/complex.rb:198:
  in `WriteDialog'

.../include/network/lan/wizards.rb:58:
  in `block in LanSequence'
Comment 4 Michal Filka 2021-12-06 09:40:46 UTC
(In reply to William Flanagan from comment #0)
....

> The goal is to have different DHCP services from external devices on eth0
> and wlan0, if possible.  Or would it be better to assign static IP addresses
> with wicked?  The notebook computer in question will be set up with
> TeamViewer so a remote programmer can access a test network.
> 
> Thanks for suggestions.

I don't understand what you mean by "different DHCP services".

Do we talk about switching from wicked to network manager in installer or running system?

Did you simply try to configure a route for each device and then tried to switch to NetworkManager? Did you configure both (eth0 and wlan0) for DHCP? Saving configuration then died ... ?

In general yast should survive switching from wicked to network manager, so we need to know what exactly you tried to configure.
Comment 5 William Flanagan 2021-12-06 15:14:57 UTC
By different DHCP services I mean that I want wlan and eth of this notebook to be on different subnets, receiving IP addresses from different routers.  In Yast each interface is configured for IPv4 only DHCP.
The attempt to move from wicked to NM is on a running system, not at installation.  In Yast, under System/Network settings/global options the network setup method is Wicked Service.  If I change that to Network Manager and click OK The error message comes up and Yast closes.
Comment 6 Stefan Hundhammer 2021-12-07 09:47:18 UTC
Moved to our task queue for an upcoming sprint.
Comment 7 Michal Filka 2021-12-10 08:19:12 UTC
(In reply to William Flanagan from comment #5)
> By different DHCP services I mean that I want wlan and eth of this notebook
> to be on different subnets, receiving IP addresses from different routers. 
> In Yast each interface is configured for IPv4 only DHCP.

ok, this is quite common scenario

> The attempt to move from wicked to NM is on a running system, not at
> installation.  In Yast, under System/Network settings/global options the
> network setup method is Wicked Service.  If I change that to Network Manager
> and click OK The error message comes up and Yast closes.

this simple scenario didn't reproduce the issue for me. So, there is most probably something more.

(In reply to William Flanagan from comment #0)
> Caller:
> /usr/share/YaST2/lib/y2network/network_manager/connection_config_writers/
> base.rb:72:in `configure_gateway'
> 
> Details: undefined method `ipv4?' for nil:NilClass

according to this snippet it seems that there is a problem when configuring a route and / or default gateway. If not in yast then probably before. We could do some hotfix to avoid this crash, but I'd prefer to know how yast got to this state. To have something to start with ... Do you remmember if you tried to do something else in yast than described above? Even if you didn't accept the modification in the end. Could you pls check what "if route" shows? Also pls check if /etc/sysconfig/network/ifroute-* files exist and contains something.
Comment 8 William Flanagan 2021-12-16 18:22:07 UTC
Went to look for the information requested and found that this machine couldn't find any network from a browser.  Yast/system/networkSettings  was edited to confirm config.  Rebooted and the process hung for about 10 minutes on stopping both Network Manager and wicked (restarting the timers more than once).  After stopping NM, still worked longer to stop wicked.  Then again hung stopping the supplicant daemons.  Eventualy it said it reached Reboot, but didn't--had to power cycle to restart.
Watching the log entries, both wicked and NM were started, as was the DHCP supplicant for IPv6 which I had disabled.

if route produces only a ">" prompt.  CTL-C to quit.

ifroute-* files exist.  -wlan1 and -wlan0 are empty.  ifroute-eth0 contains "default - - eth0".  ifroute-eth0.YaST2save contains "default - - eth0" and ifroute-wlan0.YaST2save contains "default - - wlan0". 

This machine is needed tomorrow so I'm going to install 15.2.  Will get back to 15.3 as soon as I can.
Comment 9 Michal Filka 2021-12-17 07:58:58 UTC
(In reply to William Flanagan from comment #8)
> 
> if route produces only a ">" prompt.  CTL-C to quit.

well ... it should be ip route of course, but never mind because ...
> 
> ifroute-* files exist.  -wlan1 and -wlan0 are empty.  ifroute-eth0 contains
> "default - - eth0".  

... this is the problem. I've reproduced the issue by filling the ifroute file with a default gateway record.
Comment 10 William Flanagan 2021-12-17 13:48:14 UTC
if route ???!!  and to think I was once a pretty good editor  :-(
Comment 11 Knut Alejandro Anderssen González 2022-10-04 08:15:53 UTC
This bug should be already fixed by https://github.com/yast/yast-network/pull/1309 (yast2-network-4.3.86), that is, it is a duplicate of (bsc#1203866) but for a different product.