[Pkg-utopia-maintainers] Bug#642191: network-manager: On upgrade/restart, resolv.conf is overwritten with empty file

Luca Capello luca at pca.it
Tue Sep 20 15:49:00 UTC 2011


found 642191 0.8.4.0-2
thanks

Hi there!

On Tue, 20 Sep 2011 11:26:07 +0200, Michael Biebl wrote:
> You all filed independent bug reports against network-manager-0.9.0-2 about NM
> clearing/rewriting /etc/resolv.conf.
>
> They all look like duplicates to me that's why I merged them and and unless the
> analysis shows otherwise I'd like you to follow up on this bug #642191 so we
> keep the information in one place.

Fine for me, but I would have continued on the oldest bug report (not
simply because I reported it ;-) ), given that, I would like to have an
answer to one of the questions I asked in my report, see #641904:

  1) why does network-manager look for ifupdown interfaces if it has been
     told not to?  IMHO with "[ifupdown] managed=false" the ifupdown
     plugin should not be loaded at all, even if it is in the plugin list.

This raises two more questions:

a) if network-manager stops caring about ifupdown devices, should this
   bug automatically go away?  From the syslog at #641904 you see that
   on my sid network-manager knows only about eth0 and wlan0, both
   present in /etc/network/interfaces (but for virbr0 see below).  The
   answer is no, read below why.

b) would the situation have changed if I had resolvconf installed?  If
   yes, then network-manager misses a Recommends: or Suggests: to
   resolvconf (the latter has network-manager in the Enhances: field).

> It seems you all have interfaces managed by ifupdown which are activated during
> boot and during the upgrade /etc/resolv.conf was overwritten/cleared i.e. empty
> besides a "# Generated by NetworkManager" line.
> NetworkManager either doesn't manage any interfaces at all or the interfaces it
> manages arent't active (e.g. no link beat).

I find network-manager behavior quite strange, as I asked in #641904:

  2) I thought that since I have libvirt-bin installed and since virbr0 is
     not present in /etc/network/interfaces, maybe network-manager
     wanted to manage it, but this is not the case from the log above.

The log above was:

  Sep 17 12:08:55 gismo NetworkManager[30061]: <warn> /sys/devices/virtual/net/virbr0: \
   couldn't determine device driver; ignoring...

Anyway, just to be sure, I did a test with libvirt-bin stopped (and its
default network as well, so no virbr0 at all) and nothing changed.

> It would be great if you could try to reproduce the following steps:
>
> 1/ kill network-manager (service network-manager stop)

This is enough to cause the bug.  Please note that you do not need any
*working* connection to reproduce this bug:
=====
root at gismo:/etc# ip a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
    link/ether 00:16:d3:2c:fc:f5 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN qlen 1000
    link/ether 00:19:d2:07:2c:a0 brd ff:ff:ff:ff:ff:ff
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN
    link/ether a6:55:c3:cb:ae:e7 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0

root at gismo:/etc# echo "10.0.0.1" >/etc/resolv.conf

root at gismo:/etc# cat /etc/resolv.conf
10.0.0.1

root at gismo:/etc# service network-manager start
Starting network connection manager: NetworkManager.

root at gismo:/etc# cat /etc/resolv.conf
10.0.0.1

root at gismo:/etc# service network-manager stop
Stopping network connection manager: NetworkManager.

root at gismo:/etc# cat /etc/resolv.conf
# Generated by NetworkManager

root at gismo:/etc#
=====

I did the tests you asked for anyway, even if they are useless (and this
specific step was already reported in #641904).

> 2/ ifup eth0 (or whatever your interface is)

For this to work you need the interface down before killing
network-manager, thus here what you should do instead:

2a/ ifdown eth0
2b/ ifup eth0 [this generates a "correct" /etc/resolv.conf]

> 4/ run NetworkManager --no-daemon --log-level=DEBUG (redirect the output to a file)

Debug file attached, for both 0.8.4-2 and 0.9.0-2, but FYI you should
redirect stderr, non stdout.

> Please try this with both 0.9.0 and 0.8.4 so I know I'm on the right track here
> and it is actually at 7/ where resolv.conf gets rewritten.
>
> If you need 0.8.4 and you don't have them in the apt-cache anymore, you can
> either get the packages from testing or via http://snapshot.debian.org/.

You were right, this is not a regression at all (Version: updated), but
it took me quite a while to downgrade to 0.8.4 (and as a sidenote I
discovered a "bug" in dpkg, reported as #181491 and #183470):
=====
root at gismo:/etc# wget http://snapshot.debian.org/archive/debian/20110421T173309Z/\
 pool/main/n/network-manager/network-manager_0.8.4.0-1_amd64.deb
[...]

root at gismo:/etc# dpkg -i network-manager_0.8.4.0-1_amd64.deb
dpkg: warning: downgrading network-manager from 0.9.0-2 to 0.8.4.0-1.
(Reading database ... 81292 files and directories currently installed.)
Preparing to replace network-manager 0.9.0-2 (using network-manager_0.8.4.0-1_amd64.deb) ...
Unpacking replacement network-manager ...
dpkg: dependency problems prevent configuration of network-manager:
 network-manager depends on libnm-glib2 (>= 0.8.2); however:
  Package libnm-glib2 is not installed.
 network-manager depends on libnm-util1 (>= 0.8.2); however:
  Package libnm-util1 is not installed.
dpkg: error processing network-manager (--install):
 dependency problems - leaving unconfigured
Processing triggers for man-db ...
Errors were encountered while processing:
 network-manager

root at gismo:/etc# echo "deb http://snapshot.debian.org/archive/debian/20110421T173309Z/ \
 sid main" >>/etc/apt/sources.list

root at gismo:/etc# apt-get update
[...]
E: Release file for \
 http://snapshot.debian.org/archive/debian/20110421T173309Z/dists/sid/InRelease \
 is expired (invalid since 144d 21h 9min 32s). Updates for this repository will \
 not be applied.

root at gismo:/etc# apt-cache policy network-manager
network-manager:
  Installed: 0.8.4.0-1
  Candidate: 0.9.0-2
  Version table:
     0.9.0-2 0
        990 http://cdn.debian.net/debian/ sid/main amd64 Packages
 *** 0.8.4.0-1 0
        100 /var/lib/dpkg/status
=====

OK, snapshot.d.o can not be used as an APT repository, so try wheezy:
=====
root at gismo:/etc# echo "deb http://cdn.debian.net/debian/ wheezy main" \
 >>/etc/apt/sources.list

root at gismo:/etc# apt-get update
[...]
Fetched 275 kB in 2s (94.6 kB/s)
Reading package lists... Done

root at gismo:/etc# apt-get install network-manager=0.8.4.0-2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libnm-glib2 libnm-util1
Suggested packages:
  avahi-autoipd
Recommended packages:
  ppp modemmanager
The following NEW packages will be installed:
  libnm-glib2 libnm-util1
The following packages will be DOWNGRADED:
  network-manager
0 upgraded, 2 newly installed, 1 downgraded, 0 to remove and 7 not upgraded.
Need to get 1,708 kB of archives.
After this operation, 184 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
[...]
Reloading system message bus config...done.
Stopping network connection manager: NetworkManager already stopped.
Starting network connection manager: NetworkManager.
Processing triggers for man-db ...

root at gismo:/etc# cat /etc/resolv.conf
domain unige.ch
search unige.ch
nameserver 129.194.4.32
nameserver 129.194.8.7
nameserver 129.194.4.6

root at gismo:/etc# service network-manager stop
Stopping network connection manager: NetworkManager.

root at gismo:/etc# cat /etc/resolv.conf
# Generated by NetworkManager

root at gismo:/etc# ifdown eth0
[...]

root at gismo:/etc# ip a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
    link/ether 00:16:d3:2c:fc:f5 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN qlen 1000
    link/ether 00:19:d2:07:2c:a0 brd ff:ff:ff:ff:ff:ff
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN
    link/ether a6:55:c3:cb:ae:e7 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0

root at gismo:/etc# echo "10.0.0.1" >/etc/resolv.conf                                                                            

root at gismo:/etc# cat /etc/resolv.conf
10.0.0.1

root at gismo:/etc# service network-manager start
Starting network connection manager: NetworkManager.

root at gismo:/etc# cat /etc/resolv.conf
10.0.0.1

root at gismo:/etc# service network-manager stop
Stopping network connection manager: NetworkManager.

root at gismo:/etc# cat /etc/resolv.conf
# Generated by NetworkManager

root at gismo:/etc#
=====

Thx, bye,
Gismo / Luca

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 642191_n-m_debug_0.8.4-2_0.9.0-2.log.gz
Type: application/octet-stream
Size: 2383 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-utopia-maintainers/attachments/20110920/07c5cba8/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-utopia-maintainers/attachments/20110920/07c5cba8/attachment.pgp>


More information about the Pkg-utopia-maintainers mailing list