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

September 20th, 2011 - 05:30 am ET by Michael Biebl | Report spam
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)

Hi Hilko, Luca and Moshe!

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.

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 tried to reproduce this issue with 0.9.0-2 by managing my wireless interface
via ifupdown and did the following:
- stop network-manager
- configure eth0 via ifupdown
- ifup eth0
(resolv.conf contains the correct nameserver configuration)
- start network-manager
(resolv.conf still correct!)

So initially I wasn't able to reproduce the issue. But when I *stopped*
network-manager, /etc/resolv.conf was rewritten/cleared in the way described above.

So my guess is, that this is not actually a regression in 0.9.0, but simply due
to the fact that network-manager was restarted (i.e. stopped) during the
upgrade. And indeed I was able to reproduce the same behaviour with 0.8.4.

It would be great if you could try to reproduce the following steps:

1/ kill network-manager (service network-manager stop)
2/ ifup eth0 (or whatever your interface is)
3/ check resolv.conf
4/ run NetworkManager --no-daemon --log-level=DEBUG (redirect the output to a file)
5/ check resolv.conf
6/ stop NetworkManager
7/ check resolv.conf

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/.

Thanks,
Michael

Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?







To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
email Follow the discussionReplies 2 repliesReplies Make a reply

Replies

#1 Luca Capello
September 20th, 2011 - 12:00 pm ET | Report spam


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:
==
:/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

:/etc# echo "10.0.0.1" >/etc/resolv.conf

:/etc# cat /etc/resolv.conf
10.0.0.1

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

:/etc# cat /etc/resolv.conf
10.0.0.1

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

:/etc# cat /etc/resolv.conf
# Generated by NetworkManager

:/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):
==
:/etc# wget http://snapshot.debian.org/archive/...1T173309Z/\
pool/main/n/network-manager/network-manager_0.8.4.0-1_amd64.deb
[...]

:/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

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

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

:/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:
==
:/etc# echo "deb http://cdn.debian.net/debian/ wheezy main" \
/etc/apt/sources.list





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

:/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 ...

:/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

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

:/etc# cat /etc/resolv.conf
# Generated by NetworkManager

:/etc# ifdown eth0
[...]

:/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

:/etc# echo "10.0.0.1" >/etc/resolv.conf

:/etc# cat /etc/resolv.conf
10.0.0.1

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

:/etc# cat /etc/resolv.conf
10.0.0.1

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

:/etc# cat /etc/resolv.conf
# Generated by NetworkManager

:/etc#
==

Thx, bye,
Gismo / Luca


filenamed2191_n-m_debug_0.8.4-2_0.9.0-2.log.gz

H4sICNKzeE4AAzY0MjE5MV9uLW1fZGVidWdfMC44LjQtMl8wLjkuMC0yLmxvZwDNWmtv4zYW/d5f
wf0UG4hsvV/tDBAknd0BOtlip7tdYDAQaImyiciUqkcc76/fS4lKbMd6RnFrDMZhJF4e3jd5ck/y
XZw+fMEMr0n6TXVU47uLfqIsjD+i+6OHaPZI0ozGDMkL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