Bug#804183: dbus fails to start, circular inclusion of *.dpkg-bak

2015-11-16 Thread Simon McVittie
On Sat, 07 Nov 2015 at 15:09:57 +0100, Simon McVittie wrote:
> Downgrading packages is officially not a supported action, but this
> failure mode is obviously quite bad, so I'm leaving this bug as
> release-critical while we work out whether it can be avoided.
> Retitling the bug to make it clearer what its scope is.

Steps to reproduce on a virtual machine:

* install Debian stretch "standard system"
* remove and purge the dbus package
* install dbus and libdbus-1-3 1.10.0-3 from snapshot.debian.org
  ('deb http://snapshot.org/archive/debian/20150916T040116Z sid main',
  and 'Acquire::Check-Valid-Until "false"' in /etc/apt/apt.conf -
  this is a security risk, so do not do it on a production system)
* upgrade to 1.10.2-1 or to the version under test
* downgrade dbus and libdbus-1-3 to 1.10.0-3 again
* upgrade dbus and libdbus-1-3 to the version under test again

Desired result:

* all installations succeed
* all installations successfully reload dbus-daemon configuration
* whenever 1.10.0-3 is installed, /etc/dbus-1/system.conf is
  a real file of size 823 bytes
* whenever 1.10.2 is installed, /etc/dbus-1/system.conf is a
  symlink to /usr/share/dbus-1/system.conf

Actual result with 1.10.2-1:

* the downgrade fails in the way Brent described

I'm testing a potential fix.

S



Bug#804183: dbus fails to start, circular inclusion of *.dpkg-bak

2015-11-09 Thread Brent S. Elmer Ph.D.
On Sat, 2015-11-07 at 15:09 +0100, Simon McVittie wrote:
> Control: retitle 804183 downgrading dbus from 1.10.2-1 leads to
> circular inclusion of s*.conf.dpkg-bak
> 

> Before upgrading to 1.10.2, had you modified /etc/dbus-1/s*.conf?
> 

No.

> Please show me anything relevant to dbus from /var/log/dpkg.log* and
> /var/log/apt/*, going back to before you first attempted to install
> dbus 1.10.2-1? I'm particularly interested in whether the package
> went
> via some unusual state (maybe a failed or partially-failed upgrade)
> before you did the problematic downgrade, and in any messages that it
> emitted in /var/log/apt/term.log* during the upgrade and downgrade.
> 


> (reference:
>  -mscriptsinstact>)
> 
> S

I attached the greps for dbus below.

Brent
grep --color -nH -e dbus /var/log/dpkg.log*
/var/log/dpkg.log:246:2015-11-03 13:22:09 upgrade dbus-x11:amd64 1.10.0-3 1.10.2-1
/var/log/dpkg.log:247:2015-11-03 13:22:09 status half-configured dbus-x11:amd64 1.10.0-3
/var/log/dpkg.log:248:2015-11-03 13:22:09 status unpacked dbus-x11:amd64 1.10.0-3
/var/log/dpkg.log:249:2015-11-03 13:22:09 status half-installed dbus-x11:amd64 1.10.0-3
/var/log/dpkg.log:250:2015-11-03 13:22:09 status half-installed dbus-x11:amd64 1.10.0-3
/var/log/dpkg.log:251:2015-11-03 13:22:10 status unpacked dbus-x11:amd64 1.10.2-1
/var/log/dpkg.log:252:2015-11-03 13:22:10 status unpacked dbus-x11:amd64 1.10.2-1
/var/log/dpkg.log:253:2015-11-03 13:22:10 upgrade libdbus-1-3:i386 1.10.0-3 1.10.2-1
/var/log/dpkg.log:254:2015-11-03 13:22:10 status half-configured libdbus-1-3:i386 1.10.0-3
/var/log/dpkg.log:255:2015-11-03 13:22:10 status unpacked libdbus-1-3:i386 1.10.0-3
/var/log/dpkg.log:256:2015-11-03 13:22:10 status half-configured libdbus-1-3:amd64 1.10.0-3
/var/log/dpkg.log:257:2015-11-03 13:22:10 status half-installed libdbus-1-3:i386 1.10.0-3
/var/log/dpkg.log:258:2015-11-03 13:22:10 status half-installed libdbus-1-3:i386 1.10.0-3
/var/log/dpkg.log:259:2015-11-03 13:22:10 status unpacked libdbus-1-3:i386 1.10.2-1
/var/log/dpkg.log:260:2015-11-03 13:22:10 status unpacked libdbus-1-3:i386 1.10.2-1
/var/log/dpkg.log:261:2015-11-03 13:22:11 upgrade libdbus-1-3:amd64 1.10.0-3 1.10.2-1
/var/log/dpkg.log:262:2015-11-03 13:22:11 status half-configured libdbus-1-3:amd64 1.10.0-3
/var/log/dpkg.log:263:2015-11-03 13:22:11 status unpacked libdbus-1-3:amd64 1.10.0-3
/var/log/dpkg.log:264:2015-11-03 13:22:11 status half-installed libdbus-1-3:amd64 1.10.0-3
/var/log/dpkg.log:265:2015-11-03 13:22:11 status half-installed libdbus-1-3:amd64 1.10.0-3
/var/log/dpkg.log:266:2015-11-03 13:22:11 status unpacked libdbus-1-3:amd64 1.10.2-1
/var/log/dpkg.log:267:2015-11-03 13:22:11 status unpacked libdbus-1-3:amd64 1.10.2-1
/var/log/dpkg.log:268:2015-11-03 13:22:11 upgrade dbus:amd64 1.10.0-3 1.10.2-1
/var/log/dpkg.log:269:2015-11-03 13:22:11 status half-configured dbus:amd64 1.10.0-3
/var/log/dpkg.log:270:2015-11-03 13:22:12 status unpacked dbus:amd64 1.10.0-3
/var/log/dpkg.log:271:2015-11-03 13:22:12 status half-installed dbus:amd64 1.10.0-3
/var/log/dpkg.log:273:2015-11-03 13:22:12 status half-installed dbus:amd64 1.10.0-3
/var/log/dpkg.log:274:2015-11-03 13:22:12 status unpacked dbus:amd64 1.10.2-1
/var/log/dpkg.log:275:2015-11-03 13:22:13 status unpacked dbus:amd64 1.10.2-1
/var/log/dpkg.log:579:2015-11-03 13:23:16 upgrade cairo-dock-dbus-plug-in:amd64 3.4.0-1+b2 3.4.0-1.1
/var/log/dpkg.log:580:2015-11-03 13:23:16 status half-configured cairo-dock-dbus-plug-in:amd64 3.4.0-1+b2
/var/log/dpkg.log:581:2015-11-03 13:23:16 status unpacked cairo-dock-dbus-plug-in:amd64 3.4.0-1+b2
/var/log/dpkg.log:582:2015-11-03 13:23:17 status half-installed cairo-dock-dbus-plug-in:amd64 3.4.0-1+b2
/var/log/dpkg.log:583:2015-11-03 13:23:17 status half-installed cairo-dock-dbus-plug-in:amd64 3.4.0-1+b2
/var/log/dpkg.log:584:2015-11-03 13:23:17 status unpacked cairo-dock-dbus-plug-in:amd64 3.4.0-1.1
/var/log/dpkg.log:585:2015-11-03 13:23:17 status unpacked cairo-dock-dbus-plug-in:amd64 3.4.0-1.1
/var/log/dpkg.log:777:2015-11-03 13:23:33 configure libdbus-1-3:amd64 1.10.2-1 
/var/log/dpkg.log:778:2015-11-03 13:23:33 status unpacked libdbus-1-3:amd64 1.10.2-1
/var/log/dpkg.log:779:2015-11-03 13:23:33 status half-configured libdbus-1-3:amd64 1.10.2-1
/var/log/dpkg.log:780:2015-11-03 13:23:33 status installed libdbus-1-3:amd64 1.10.2-1
/var/log/dpkg.log:781:2015-11-03 13:23:33 configure libdbus-1-3:i386 1.10.2-1 
/var/log/dpkg.log:782:2015-11-03 13:23:33 status unpacked libdbus-1-3:i386 1.10.2-1
/var/log/dpkg.log:783:2015-11-03 13:23:33 status half-configured libdbus-1-3:i386 1.10.2-1
/var/log/dpkg.log:784:2015-11-03 13:23:33 status installed libdbus-1-3:i386 1.10.2-1
/var/log/dpkg.log:785:2015-11-03 13:23:33 configure dbus:amd64 1.10.2-1 
/var/log/dpkg.log:786:2015-11-03 13:23:33 status unpacked dbus:amd64 1.10.2-1
/var/log/dpkg.log:787:2015-11-03 13:23:33 status unpacked dbus:amd64 1.10.2-1

Bug#804183: dbus fails to start, circular inclusion of *.dpkg-bak

2015-11-07 Thread Simon McVittie
Control: retitle 804183 downgrading dbus from 1.10.2-1 leads to circular 
inclusion of s*.conf.dpkg-bak

On Thu, 05 Nov 2015 at 14:40:53 -0600, Brent S. Elmer wrote:
> I had dbus 1.10.0-3 installed on my system then I
> upgraded to 1.10.2-1.  After some series of upgrades, bluetooth stopped 
> working
> so I was reverting packages that I had recently upgraded one of which was 
> dbus.
> So, I downgraded dbus from 1.10.2-1 back down to 1.10.0-3.  After I did this,
> my computer failed to boot.  I was able to boot into recovery mode.

Downgrading packages is officially not a supported action, but this
failure mode is obviously quite bad, so I'm leaving this bug as
release-critical while we work out whether it can be avoided.
Retitling the bug to make it clearer what its scope is.

The session and system buses have identical logic for this stuff, so let's
ignore the session bus and concentrate on the system bus. If there's a
solution for the system bus, then there's a very similar solution
for the session bus too.

Before upgrading to 1.10.2, had you modified /etc/dbus-1/s*.conf?

Please show me anything relevant to dbus from /var/log/dpkg.log* and
/var/log/apt/*, going back to before you first attempted to install
dbus 1.10.2-1? I'm particularly interested in whether the package went
via some unusual state (maybe a failed or partially-failed upgrade)
before you did the problematic downgrade, and in any messages that it
emitted in /var/log/apt/term.log* during the upgrade and downgrade.

> Here is what /etc/dbus-1 looks like:
...
> lrwxrwxrwx 1 root root   29 Nov  5 09:24 system.conf ->
> /usr/share/dbus-1/system.conf
> lrwxrwxrwx 1 root root   29 Nov  3 13:23 system.conf.dpkg-bak ->
> /usr/share/dbus-1/system.conf

This is a step closer to the root cause of the bug: system.conf.dpkg-bak
shouldn't be this symlink into /usr (probably something is wrong in the
maintainer scripts, and that's is causing you to get into this bad
situation). With dbus (>= 1.10.2-1), what you are meant to get is:

/usr/share/dbus-1/system.conf (a real file)
upstream's standard bus setup

/etc/dbus-1/system.conf -> /usr/share/dbus-1/system.conf (a symlink)
backwards compat symlink so dbus << 1.10 can reload successfully
after upgrading to >= 1.10 but before rebooting

/etc/dbus-1/system.conf.dpkg-bak (a real file, if it exists)
your previous modified bus setup (only if you previously modified
system.conf, even though it contains comments telling you to create
system-local.conf instead)

> So, I don't know what the intent was with including the dpkg-bak in the two
> ..conf files but it causes severe breakage.

The intention is that as required by Debian Policy, modified configuration
files are kept (even though in this case you're meant to create a parallel
file instead of editing them). The bug here is that the compatibility
symlink gets treated as though it was a modified configuration file - it
shouldn't be.

The sequence of events in your downgrade, ignoring recovery paths if a step
fails, goes something like this:

* 1.10.2-1's prerm with arguments "upgrade 1.10.0-3"
** dpkg-maintscript-helper rm_conffile /etc/dbus-1/system.conf 1.10.0-4~ dbus 
-- upgrade 1.10.0-3
* 1.10.0-3's preinst with arguments "upgrade 1.10.2-1"
* unpack files from 1.10.0-3
* 1.10.2-1's postrm with arguments "upgrade 1.10.0-3"
** dpkg-maintscript-helper rm_conffile /etc/dbus-1/system.conf 1.10.0-4~ dbus 
-- upgrade 1.10.0-3
* remove any files from 1.10.2-1 not present in 1.10.0-3
* file list from 1.10.0-3 becomes active
* 1.10.0-3's postinst with arguments "configure 1.10.2-1"

(reference:
)

S



Bug#804183: dbus fails to start, circular inclusion of *.dpkg-bak

2015-11-06 Thread Holger Schramm
Hi,

I cannot reproduce the bug. After making the update I had no *.bak files
and no problems.

Perhaps there were problems during the update with aptitude o. sth?

-- 
Holger



Bug#804183: dbus fails to start, circular inclusion of *.dpkg-bak

2015-11-05 Thread Brent S. Elmer
Package: dbus
Version: 1.10.2-1
Severity: serious

dbus just broke my system.  I had dbus 1.10.0-3 installed on my system then I
upgraded to 1.10.2-1.  After some series of upgrades, bluetooth stopped working
so I was reverting packages that I had recently upgraded one of which was dbus.
So, I downgraded dbus from 1.10.2-1 back down to 1.10.0-3.  After I did this,
my computer failed to boot.  I was able to boot into recovery mode.

Using the journal, I found this:

● dbus.service - D-Bus System Message Bus
   Loaded: loaded (/lib/systemd/system/dbus.service; static; vendor preset:
enabled)
   Active: failed (Result: exit-code) since Thu 2015-11-05 13:39:34 CST; 8min
ago
 Docs: man:dbus-daemon(1)
  Process: 812 ExecStart=/usr/bin/dbus-daemon --system --address=systemd:
--nofork --nopidfile --systemd-activation (code=exited, status=1/FAILURE)
 Main PID: 812 (code=exited, status=1/FAILURE)

Nov 05 13:39:09 brente systemd[1]: Started D-Bus System Message Bus.
Nov 05 13:39:09 brente dbus-daemon[812]: Failed to start message bus: Circular
inclusion of file '/etc/dbus-1/system.conf.dpkg-bak'
Nov 05 13:39:34 brente systemd[1]: dbus.service: Main process exited,
code=exited, status=1/FAILURE
Nov 05 13:39:34 brente systemd[1]: dbus.service: Unit entered failed state.
Nov 05 13:39:34 brente systemd[1]: dbus.service: Failed with result 'exit-
code'.


Here is what /etc/dbus-1 looks like:

lrwxrwxrwx 1 root root   30 Nov  5 09:24 session.conf ->
/usr/share/dbus-1/session.conf
lrwxrwxrwx 1 root root   30 Nov  3 13:23 session.conf.dpkg-bak ->
/usr/share/dbus-1/session.conf
-rw-r--r-- 1 root root  828 Sep 15 17:09 session.conf.dpkg-new
drwxr-xr-x 2 root root 4096 May 27 17:12 session.d
lrwxrwxrwx 1 root root   29 Nov  5 09:24 system.conf ->
/usr/share/dbus-1/system.conf
lrwxrwxrwx 1 root root   29 Nov  3 13:23 system.conf.dpkg-bak ->
/usr/share/dbus-1/system.conf
-rw-r--r-- 1 root root  823 Sep 15 17:09 system.conf.dpkg-new
drwxr-xr-x 2 root root 4096 Nov  4 15:02 system.d


/usr/share/dbus-1/system.conf has the following which I commented out to help
fix the problem:


  

You can see the circular dependency.  However, we are not done yet.  That fixes
that problem but gdm3 still will not start.
I found the following in syslog after commenting system.conf as above and
rebooting:

Nov  5 14:04:49 brente /usr/bin/dbus-launch[1953]: Failed to start message bus:
Circular inclusion of file '/etc/dbus-1/session.conf.dpkg-bak'
Nov  5 14:04:49 brente /usr/bin/dbus-launch[1953]: EOF in dbus-launch reading
address from bus daemon
N

I found the following in session.conf and commented it out:

  
  

You can see the circular dependency there also.

So, I don't know what the intent was with including the dpkg-bak in the two
..conf files but it causes severe breakage.  I wasted a whole day tracking this
down.







-- System Information:
Debian Release: stretch/sid
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)

Versions of packages dbus depends on:
ii  adduser   3.113+nmu3
ii  libapparmor1  2.10-2+b1
ii  libaudit1 1:2.4.4-4
ii  libc6 2.19-22
ii  libcap-ng00.7.4-2
ii  libdbus-1-3   1.10.2-1
ii  libexpat1 2.1.0-6+deb8u1
ii  libselinux1   2.3-2
ii  libsystemd0   226-4
ii  lsb-base  4.1+Debian13+nmu1

dbus recommends no packages.

Versions of packages dbus suggests:
ii  dbus-x11  1.10.2-1

Versions of packages dbus is related to:
ii  dbus-x11  1.10.2-1
ii  systemd   226-4
ii  systemd-sysv  226-4

-- no debconf information