Subject: bug#525: network-manager: during upgrade network-manager does not start

From: "Dimitris T." <[email-masked]>
Date: Fri, 27 Nov 2020 13:51:52 +0200

Package: network-manager
Version: 1.27.91-2+devuan1
Severity: normal

Hey,

(noticed it in previous upgrades too -neglected to report-, but latest upgrade yesterday reminded me to...)

after upgrading network-manager, daemon is not started, even though status reports it as "running". :

# apt install --reinstall network-manager
....
....
Get:1 https://$somemirror/merged ceres/main amd64 network-manager amd64 1.27.91-2+devuan1 [3449 kB]
...
Preparing to unpack .../network-manager_1.27.91-2+devuan1_amd64.deb ...
Unpacking network-manager (1.27.91-2+devuan1) over (1.27.91-2+devuan1) ...
Γίνεται εγκατάσταση network-manager (1.27.91-2+devuan1) ...
insserv: warning: script 'cgroups' missing LSB tags
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `cgroups'
insserv: Default-Stop  undefined, assuming empty stop runlevel(s) for script `cgroups'
Stopping network connection manager: NetworkManager.
Starting network connection manager: NetworkManager.
Processing triggers for dbus (1.12.20-1+devuan1) ...
Processing triggers for man-db (2.9.3-2) ...

# service network-manager status 
NetworkManager is running.

# ps -aux | grep Network
(nothing)

# ls -la /var/run/NetworkManager 
drwxr-xr-x  2 root root  80 Νοε  27 13:27 devices
-rw-r--r--  1 root root  30 Νοε  27 13:27 no-stub-resolv.conf
-rw-r--r--  1 root root  30 Νοε  27 13:27 resolv.conf

as you can see, no NetworkManager.pid created in /run/NetworkManager, and daemon is not running. 

restarting/stopping+starting service manually eg. `service network-manager restart`, works as expected. 

# service network-manager restart
Stopping network connection manager: NetworkManager already stopped.
Starting network connection manager: NetworkManager.

#ls -la /var/run/NetworkManager          
drwxr-xr-x  2 root root  80 Νοε  27 13:29 devices
-rw-r--r--  1 root root   4 Νοε  27 13:29 NetworkManager.pid
-rw-r--r--  1 root root 104 Νοε  27 13:29 no-stub-resolv.conf
-rw-r--r--  1 root root 104 Νοε  27 13:29 resolv.conf

was using openrc before, and think it also applied there as well.

thanks in advance,
d.

p.s a silly question perhaps, but does the daemon really needs to restart on each upgrade? (security related excluded..)
"forcing" a network restart on running/connected system might not be the best option...(?)

-- System Information:
Distributor ID:	Devuan
Description:	Devuan GNU/Linux 4 (chimaera/ceres)
Release:	testing/unstable
Codename:	n/a
Architecture: x86_64

Kernel: Linux 5.9.0-3-amd64 (SMP w/4 CPU threads)
Locale: LANG=el_GR.UTF-8, LC_CTYPE=el_GR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: runit (via /run/runit.stopit)
LSM: AppArmor: enabled

Versions of packages network-manager depends on:
ii  adduser                  3.118
ii  dbus                     1.12.20-1+devuan1
ii  eudev [udev]             3.2.9-8
ii  init-system-helpers      1.58+devuan1
ii  libaudit1                1:2.8.5-3.1
ii  libbluetooth3            5.55-1
ii  libc6                    2.31-4
ii  libcurl3-gnutls          7.72.0-1
ii  libelogind0              243.8-1
ii  libeudev1                3.2.9-8
ii  libglib2.0-0             2.66.3-1
ii  libgnutls30              3.6.15-4
ii  libjansson4              2.13.1-1
ii  libmm-glib0              1.14.8-0.1
ii  libndp0                  1.6-1+b1
ii  libnewt0.52              0.52.21-4+b2
ii  libnm0                   1.27.91-2+devuan1
ii  libpam-elogind [logind]  243.8-1
ii  libpsl5                  0.21.0-1.1
ii  libreadline8             8.1~rc3-1
ii  libselinux1              3.1-2+b1
ii  libteamdctl0             1.31-1
ii  libuuid1                 2.36.1-2+devuan1
ii  policykit-1              0.105-29+devuan1
ii  udev                     1:3.2.9+devuan4
ii  wpasupplicant            2:2.9.0-15

Versions of packages network-manager recommends:
ii  crda                         4.14+git20191112.9856751-1
ii  dnsmasq-base [dnsmasq-base]  2.82-1
ii  iptables                     1.8.6-1
ii  modemmanager                 1.14.8-0.1
ii  ppp                          2.4.7-2+4.1+deb10u1+b1

Versions of packages network-manager suggests:
ii  isc-dhcp-client  4.4.1-2.1+b2
pn  libteam-utils    <none>

-- Configuration Files:
/etc/NetworkManager/NetworkManager.conf changed:
[main]
plugins=ifupdown,keyfile
dns=none
ip6-privacy=2
[ifupdown]
managed=false

-- no debconf information

---

From: Mark Hindley <[email-masked]>
Date: Fri, 27 Nov 2020 17:18:20 +0000

Control: tags -1 moreinfo unreproducible

Dimitris,

> reports it as "running". :

Thanks for this. However, I can't reproduce the behaviour you observe.

Here is my attempt in a VM which seems correct:

$ sudo service network-manager status
NetworkManager is running.
$ pidof NetworkManager
4025
$ sudo apt install --reinstall network-manager
Reading package lists... Done
Building dependency tree... 50%
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 3,449 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1ohttp://pkgmaster.devuan.org/merged unstable/main amd64 network-manager amd64 1.27.91-2+devuan1 [3,449 kB]
Preparing to unpack .../network-manager_1.27.91-2+devuan1_amd64.deb ...
Unpacking network-manager (1.27.91-2+devuan1) over (1.27.91-2+devuan1) ...
Setting up network-manager (1.27.91-2+devuan1) ...
Stopping network connection manager: NetworkManager.
Starting network connection manager: NetworkManager.
Processing triggers for dbus (1.12.20-1+devuan1) ...
Processing triggers for man-db (2.9.3-2) ...

$ sudo service network-manager status
NetworkManager is running
$ pidof NetworkManager
4327

So what is different about your system? Is there anything in syslog whilst the
reinstall happens that might give a clue?

Thanks

Mark

---

From: Dimitris <[email-masked]>
Date: Fri, 27 Nov 2020 21:13:43 +0200

ok, so i think i've narrowed it to the following command failing :
# invoke-rc.d network-manager restart
which is probably the one running in every install/upgrade.. look dbus 
related, not sure about their internals though..

getting this in daemon.log :

Nov 27 21:01:59 host NetworkManager[18788]: <info>  [1606503719.6799] 
NetworkManager (version 1.27.91) is starting... (after a restart)
Nov 27 21:01:59 host NetworkManager[18788]: <info>  [1606503719.6801] 
Read config: /etc/NetworkManager/NetworkManager.conf (lib: 
no-mac-addr-change.conf)
Nov 27 21:02:24 host NetworkManager[18788]: <error> [1606503744.7064] 
bus-manager: cannot connect to D-Bus: Timeout was reached
Nov 27 21:02:24 host NetworkManager[18788]: <info>  [1606503744.7066] 
exiting (error)

while, when manually running `service network-manager restart`, it works 
fine :

Nov 27 21:02:58 host NetworkManager[18827]: <info>  [1606503778.0879] 
NetworkManager (version 1.27.91) is starting... (after a restart)
Nov 27 21:02:58 host NetworkManager[18827]: <info>  [1606503778.0881] 
Read config: /etc/NetworkManager/NetworkManager.conf (lib: 
no-mac-addr-change.conf)
Nov 27 21:02:58 host NetworkManager[18827]: <info>  [1606503778.0919] 
bus-manager: acquired D-Bus service "org.freedesktop.NetworkManager"

using runit as init, maybe with sysv this would work(?).

d.

---

From: Dimitris <[email-masked]>
Date: Tue, 2 Mar 2021 11:43:14 +0200

hey there,

noticed the same thing today...
upgraded network-manager to 1.30.0-1+devuan1, and daemon didn't start 
after the upgrade...

what i did :
$ su
# apt update && apt upgrade -y

daemon.log with a different failure message than original report :

NetworkManager[1810]: <info>  [1614669836.2669] caught SIGTERM, shutting 
down normally.
NetworkManager[1810]: <info>  [1614669836.2682] device (wlanX): state 
change: activated -> deactivating (reason 'unmanaged', sys-iface-state: 
'managed')
NetworkManager[1810]: <info>  [1614669836.2685] manager: NetworkManager 
state is now DISCONNECTING
dbus-daemon[1532]: [system] Activating service 
name='org.freedesktop.nm_dispatcher' requested by ':1.3' (uid=0 pid=1810 
comm="/usr/sbin/NetworkManager ") (using servicehelper)
dbus-daemon[1532]: [system] Successfully activated service 
'org.freedesktop.nm_dispatcher'
NetworkManager[1810]: <info>  [1614669836.2801] device (wlanX): state 
change: deactivating -> unmanaged (reason 'removed', sys-iface-state: 
'managed')
NetworkManager[1810]: <info>  [1614669836.3026] dhcp4 (wlanX): canceled 
DHCP transaction
NetworkManager[1810]: <info>  [1614669836.3026] dhcp4 (wlanX): state 
changed bound -> done
wpa_supplicant[1972]: wlanX: CTRL-EVENT-DISCONNECTED bssid=xxxxxxxxxx 
reason=3 locally_generated=1
NetworkManager[1810]: <info>  [1614669836.3336] manager: NetworkManager 
state is now DISCONNECTED
wpa_supplicant[1972]: nl80211: deinit ifname=p2p-dev-wlanX 
disabled_11b_rates=0
NetworkManager[1810]: <info>  [1614669836.3386] device (p2p-dev-wlanX): 
state change: disconnected -> unmanaged (reason 'removed', 
sys-iface-state: 'removed')
NetworkManager[1810]: <info>  [1614669836.3400] device (cdc-wdm0): state 
change: unavailable -> unmanaged (reason 'unmanaged', sys-iface-state: 
'external')
NetworkManager[1810]: <info>  [1614669836.3647] exiting (success)
NetworkManager[3406]: <info>  [1614669836.3822] NetworkManager (version 
1.30.0) is starting... (after a restart)
NetworkManager[3406]: <info>  [1614669836.3823] Read config: 
/etc/NetworkManager/NetworkManager.conf (lib: no-mac-addr-change.conf)
NetworkManager[3406]: <error> [1614669836.3844] bus-manager: fatal 
failure to acquire D-Bus service "org.freedesktop.NetworkManager" (3). 
Service already taken
NetworkManager[3406]: <info>  [1614669836.3845] exiting (error)

so no "timeout was reached" as previously, this time message is "service 
already taken".

invoke-rc.d network-manager stop | start | restart, work fine when 
manually run...

thanks,
d

---

From: Dimitris <[email-masked]>
Date: Tue, 2 Mar 2021 11:43:25 +0200

hey there,

what i did :
$ su

thanks,
d

---

From: Mark Hindley <[email-masked]>
Date: Wed, 3 Mar 2021 18:02:00 +0000

Control: tags -1 moreinfo

Dimitris,

On Tue, Mar 02, 2021 at 11:43:14AM +0200, Dimitris wrote:
> upgraded network-manager to 1.30.0-1+devuan1, and daemon didn't start after
> the upgrade...

I am afraid that I still can't reproduce this, even after switching to runit-init.

Does dpkg-reconfigure network-manager restart the daemon successfully?

> to acquire D-Bus service "org.freedesktop.NetworkManager" (3). Service
> already taken

At this point, which process has the D-Bus interface then? What is the output of

 busctl status org.freedesktop.NetworkManager

Thanks

Mark

---

From: Dimitris <[email-masked]>
Date: Wed, 3 Mar 2021 22:27:53 +0200

hey,

> Does dpkg-reconfigure network-manager restart the daemon successfully?

yes it does.. daemon restarts as expected.

>   busctl status org.freedesktop.NetworkManager

can't get to this point again, so i guess you can say this bug can't be 
reproduced..

tried `apt install --reinstall network-manager` and it restarts ok.
also downgraded to 1.28.0-2+devuan1, and re-upgraded with exactly the 
same commands, this time it restarts ok.

can't think of anything else to assist with this bug report, so please 
close it..
if there is a next time, i'll try to collect more info before 
reopening... (didn't know about `busctl` till now..)

thanks for the help (and your work in devuan),
d.

p.s. btw, i think you could also close bugs #388 & #507.

---

From: "Devuan bug Tracking System" <[email-masked]>
Date: Tue, 24 Jan 2023 17:04:03 +0000

This is an automatic notification regarding your bug report
which was filed against the network-manager package:

#525: network-manager: during upgrade network-manager does not start

It has been closed by Mark Hindley <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Mark Hindley <[email-masked]> by
replying to this email.

-- 
525: https://bugs.devuan.org/cgi/bugreport.cgi?bug=525
Devuan Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#525: network-manager: during upgrade network-manager does not start
From: Mark Hindley <[email-masked]>
To: Dimitris <[email-masked]>, [email-masked]
Date: Tue, 24 Jan 2023 17:01:33 +0000

On Wed, Mar 03, 2021 at 10:27:53PM +0200, Dimitris wrote:
> also downgraded to 1.28.0-2+devuan1, and re-upgraded with exactly the same
> commands, this time it restarts ok.
> 
> can't think of anything else to assist with this bug report, so please close
> it..

Closing, as requested.

Mark

Subject: network-manager: during upgrade network-manager does not start
From: "Dimitris T." <[email-masked]>
To: Devuan Bug Tracking System <[email-masked]>
Date: Fri, 27 Nov 2020 13:51:52 +0200

Package: network-manager

Hey,

# ps -aux | grep Network
(nothing)

thanks in advance,
d.

-- System Information:
Distributor ID:	Devuan

-- Configuration Files: