package avahi-dnsconfd 0.6.32~rc+dfsg-1ubuntu2 failed to install/upgrade: subprocess new pre-removal script returned error exit status 1

Bug #1760128 reported by Rolf MetziRolf Metzingernger on 2018-03-30
616
This bug affects 135 people
Affects Status Importance Assigned to Milestone
avahi (Ubuntu)
High
Unassigned
Xenial
High
Brian Murray

Bug Description

Ubuntu Update 30.03.18

ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: avahi-dnsconfd 0.6.32~rc+dfsg-1ubuntu2
ProcVersionSignature: Ubuntu 4.4.0-116.140-generic 4.4.98
Uname: Linux 4.4.0-116-generic x86_64
NonfreeKernelModules: nvidia_uvm nvidia
ApportVersion: 2.20.1-0ubuntu2.15
Architecture: amd64
Date: Fri Mar 30 16:32:50 2018
ErrorMessage: subprocess new pre-removal script returned error exit status 1
InstallationDate: Installed on 2016-01-31 (788 days ago)
InstallationMedia: Ubuntu-MATE 16.04 LTS "Xenial Xerus" - Alpha amd64 (20160131)
RelatedPackageVersions:
 dpkg 1.18.4ubuntu1.4
 apt 1.2.26
SourcePackage: avahi
Title: package avahi-dnsconfd 0.6.32~rc+dfsg-1ubuntu2 failed to install/upgrade: subprocess new pre-removal script returned error exit status 1
UpgradeStatus: No upgrade log present (probably fresh install)

tags: removed: need-duplicate-check
Brian Murray (brian-murray) wrote :

This is trivial to reproduce by installing avahi-dnsconfd and then reinstalling it.

bdmurray@clean-xenial-amd64:~$ sudo apt-get install --reinstall avahi-dnsconfd
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/14.2 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 212825 files and directories currently installed.)
Preparing to unpack .../avahi-dnsconfd_0.6.32~rc+dfsg-1ubuntu2_amd64.deb ...
Job for avahi-daemon.socket canceled.
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
Job for avahi-daemon.socket canceled.
dpkg: error processing archive /var/cache/apt/archives/avahi-dnsconfd_0.6.32~rc+dfsg-1ubuntu2_amd64.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/avahi-dnsconfd_0.6.32~rc+dfsg-1ubuntu2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Changed in avahi (Ubuntu):
importance: Undecided → High
status: New → Triaged
Nico Machus (nicomachus) wrote :

Receiving the same error on arm chips as well
Raspberry Pi 3 running Ubuntu 16.04.4 Xenial w/ MATE
Kernel: 4.14.32-v7+

pickett@pickett-desktop:~$ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  avahi-dnsconfd
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/13.5 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 177868 files and directories currently installed.)
Preparing to unpack .../avahi-dnsconfd_0.6.32~rc+dfsg-1ubuntu2.1_armhf.deb ...
Job for avahi-daemon.socket canceled.
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
Job for avahi-daemon.socket canceled.
dpkg: error processing archive /var/cache/apt/archives/avahi-dnsconfd_0.6.32~rc+dfsg-1ubuntu2.1_armhf.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/avahi-dnsconfd_0.6.32~rc+dfsg-1ubuntu2.1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Dipanjan Ray (ray-dipanjan) wrote :

There is a workaround for this bug, which I found at:
https://neklaf.wordpress.com/2015/04/02/workaround-to-debian-gnulinux-upgrade/
where you manually disable avahi-daemon before the dpkg operation and reenable it afterwards:

1. sudo systemctl disable avahi-daemon
2. (upgrade/reinstall avahi-dnsconfd)
3. sudo systemctl enable avahi-daemon

This worked for me on 16.04.4.

tags: added: bugpattern-needed
Reffman (ventruejusticar) wrote :

Dipanjan's workaround worked for me.
Ubuntu Mate 16.04.

Trent Lloyd (lathiat) wrote :

Analysis here appears related:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=768620

Seems the interactions here are quite complex

To reproduce the problem, you can do on xenial:
(install old version)
# apt install avahi-daemon=0.6.32~rc+dfsg-1ubuntu2 avahi-dnsconfd=0.6.32~rc+dfsg-1ubuntu2 avahi-utils=0.6.32~rc+dfsg-1ubuntu2

(in a second terminal, leaves this running)
while true; do avahi-browse -a; done

(back in the first terminal)
apt upgrade # will upgrade from the xenial version 1ubuntu2 to xenial-updates version 1ubuntu2.1

Looks like the --restart-after-upgrade change may be what we need except I can't see where that's actually used in the current Ubuntu or Debian package. Seems this shipped patch may have "fixed" the issue instead. This patch is in bionic, but not in xenial where are are seeing this issue reported.

lathiat@optane:~/src/debian/avahi-0.7$ cat debian/patches/no-systemd-also.patch
Description: Don't use 'Also=' in dnsconfd systemd unit
 'Also=avahi-daemon.socket' means that 'systemctl disable avahi-dnsconfd'
 will also disable avahi-daemon.socket, which is definitely not what we
 want, and it also causes debhelper to throw an error. Just drop this entry
 from the configuration.
Author: Steve Langasek <email address hidden>
Last-Modified: 2018-01-02 20:30:00 -0800
Bug-Debian: https://bugs.debian.org/878911

Index: avahi-0.7-3ubuntu1/avahi-dnsconfd/avahi-dnsconfd.service.in
===================================================================
--- avahi-0.7-3ubuntu1.orig/avahi-dnsconfd/avahi-dnsconfd.service.in
+++ avahi-0.7-3ubuntu1/avahi-dnsconfd/avahi-dnsconfd.service.in
@@ -26,4 +26,3 @@

 [Install]
 WantedBy=multi-user.target
-Also=avahi-daemon.socket

Trent Lloyd (lathiat) wrote :

If you are hit by this issue, it seems sufficient to simply ask dpkg to finish configuration as it seems the prerm script isn't retried

$ dpkg --configure -a

Or you can just re-run your upgrade command (e.g. "apt upgrade") which should do the same plus finish any upgrades that didn't finish (which may be the case) - you'll probably want to do that either way.

Truxpin (faustria) wrote :

Anyway, disabling the avahi.daemon, upgrading and re-enabling it works fine...
Did not had the chance of trying last bypass from lathiat, but will fdbk if/when I'll do.

Changed in avahi (Ubuntu Xenial):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Brian Murray (brian-murray)
Changed in avahi (Ubuntu):
status: Triaged → Fix Released
Brian Murray (brian-murray) wrote :

Well Launchpad kept timing out when I tried to edit the description so here's the SRU info.

[Impact]
avahi-dnsconfd fails to upgrade causing lots of bug reports.

[Test Case]
1) sudo apt install avahi-daemon=0.6.32~rc+dfsg-1ubuntu2 avahi-dnsconfd=0.6.32~rc+dfsg-1ubuntu2 avahi-utils=0.6.32~rc+dfsg-1ubuntu2
2) in a separate terminal run 'while true; do avahi-browse -a -t; done
3) sudo apt upgrade avahi-daemon avahi-dnsconfd avahi-utils

With the version of the package from -proposed you should not receive a crash report and should see the following instead:

Preparing to unpack avahi-dnsconfd_0.6.32~rc+dfsg-1ubuntu3_amd64.deb ...
Job for avahi-daemon.socket canceled.
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
dpkg: ... it looks like that went OK

[Regression Potential]
This has been in bionic for a while with no regressions.

tags: removed: bugpattern-needed
tags: added: bugpattern-written

Hello Rolf, or anyone else affected,

Accepted avahi into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/avahi/0.6.32~rc+dfsg-1ubuntu2.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in avahi (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-xenial
Jacopo Losi (jlk69) wrote :

I tried:

sudo apt-get -f install

and it worked just fine. I hope this is useful.
Have a nice day,
Jacopo

Brian Murray (brian-murray) wrote :

I tested the version of the package from -proposed (while running avahi-browse per the test case) and did not receive any errors.

bdmurray@clean-xenial-amd64:~$ sudo apt-get install avahi-daemon avahi-dnsconfd avahi-utils
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
  avahi-daemon avahi-dnsconfd avahi-utils
3 upgraded, 0 newly installed, 0 to remove and 576 not upgraded.
2 not fully installed or removed.
Need to get 97.8 kB of archives.
After this operation, 1,024 B disk space will be freed.
Get:1 http://192.168.10.7/ubuntu xenial-proposed/main amd64 avahi-daemon amd64 0.6.32~rc+dfsg-1ubuntu2.2 [59.5 kB]
Get:2 http://192.168.10.7/ubuntu xenial-proposed/main amd64 avahi-utils amd64 0.6.32~rc+dfsg-1ubuntu2.2 [24.3 kB]
Get:3 http://192.168.10.7/ubuntu xenial-proposed/universe amd64 avahi-dnsconfd amd64 0.6.32~rc+dfsg-1ubuntu2.2 [14.0 kB]
Fetched 97.8 kB in 0s (2,106 kB/s)
(Reading database ... 212825 files and directories currently installed.)
Preparing to unpack .../avahi-daemon_0.6.32~rc+dfsg-1ubuntu2.2_amd64.deb ...
Unpacking avahi-daemon (0.6.32~rc+dfsg-1ubuntu2.2) over (0.6.32~rc+dfsg-1ubuntu2.1) ...
Preparing to unpack .../avahi-utils_0.6.32~rc+dfsg-1ubuntu2.2_amd64.deb ...
Unpacking avahi-utils (0.6.32~rc+dfsg-1ubuntu2.2) over (0.6.32~rc+dfsg-1ubuntu2.1) ...
Preparing to unpack .../avahi-dnsconfd_0.6.32~rc+dfsg-1ubuntu2.2_amd64.deb ...
Unpacking avahi-dnsconfd (0.6.32~rc+dfsg-1ubuntu2.2) over (0.6.32~rc+dfsg-1ubuntu2.1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for dbus (1.10.6-1ubuntu3) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu10) ...
Setting up avahi-daemon (0.6.32~rc+dfsg-1ubuntu2.2) ...
Setting up avahi-utils (0.6.32~rc+dfsg-1ubuntu2.2) ...
Setting up avahi-dnsconfd (0.6.32~rc+dfsg-1ubuntu2.2) ...

tags: added: verification-done verification-done-xenial
removed: verification-needed verification-needed-xenial
To post a comment you must log in.