dpkg: conffile difference visualizer subprocess returned error exit status 127

Bug #1874953 reported by Craig Dunford
290
This bug affects 52 people
Affects Status Importance Assigned to Milestone
dpkg (Debian)
New
Unknown
dpkg (Ubuntu)
Invalid
High
Unassigned
Focal
Invalid
Undecided
Unassigned
Groovy
Invalid
High
Unassigned
less (Debian)
Fix Released
Unknown
less (Ubuntu)
Fix Released
Critical
Unassigned
Focal
Fix Released
Critical
Brian Murray
Groovy
Fix Released
Critical
Unassigned
smartmontools (Ubuntu)
Invalid
Undecided
Unassigned
Focal
Invalid
Undecided
Unassigned
Groovy
Invalid
Undecided
Unassigned

Bug Description

[Impact]
During a release upgrade to Ubuntu 20.04 LTS some users are not able to view the differences made to a configuration file during the upgrade process. This creates a bad user experience and leads to extra crash reports.

[Test Case]
1) Upgrade from a not usr-merged system (Ubuntu 16.04 LTS) to Ubuntu 18.04 LTS
2) Install the smartmontools package
3) Edit /etc/default/smartmontools (it's enough to just add a comment in there)
4) Upgrade to Ubuntu 20.04 LTS (this requires do-release-upgrade -d as 20.04.1 is not out yet so release upgrades are not enabled)

To test the fix in the version of less from focal-proposed some hackery of the release upgrader code will be necessary as it disables proposed during the upgrade process. After enabling -proposed for bionic you'll want to run do-release-upgrade -d, then cancel the upgrade. After which you can cd to /tmp/ubuntu-release-upgrader-$MKTMPDIR and edit DistUpgradeController.py and the if statement around line 641 re "Disable proposed on upgrade to a development release". Then run 'sudo ./focal'.

[Regression Potential]
None, as we are just calling update-alternatives in the preinst of less.

Issue occurred on upgrade from 19.10 to 20.04

ProblemType: PackageDistroRelease: Ubuntu 20.04
Package: smartmontools 7.1-1build1
ProcVersionSignature: Ubuntu 5.3.0-46.38-generic 5.3.18
Uname: Linux 5.3.0-46-generic x86_64
ApportVersion: 2.20.11-0ubuntu27
Architecture: amd64
CasperMD5CheckResult: skip
Date: Fri Apr 24 21:33:08 2020
ErrorMessage: conffile difference visualizer subprocess returned error exit status 127
InstallationDate: Installed on 2011-06-18 (3233 days ago)InstallationMedia: Ubuntu-Server 11.04 "Natty Narwhal" - Release amd64 (20110426)
Python3Details: /usr/bin/python3.8, Python 3.8.2, python3-minimal, 3.8.2-0ubuntu2
PythonDetails: /usr/bin/python2.7, Python 2.7.18rc1, python-is-python2, 2.7.17-4
RelatedPackageVersions:
 dpkg 1.19.7ubuntu3
 apt 2.0.2SourcePackage: smartmontools
Title: package smartmontools 7.1-1build1 failed to install/upgrade: conffile difference visualizer subprocess returned error exit status 127
UpgradeStatus: Upgraded to focal on 2020-04-25 (0 days ago)
mtime.conffile..etc.default.smartmontools: 2017-12-08T19:12:02.064375
mtime.conffile..etc.smartd.conf: 2017-12-08T20:27:28.727282

Revision history for this message
Craig Dunford (cdunford) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

This really looks like an environment issue:

Setting up smartmontools (7.1-1build1) ...

Configuration file '/etc/default/smartmontools'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ? Your options are:
    Y or I : install the package maintainer's version
    N or O : keep your currently-installed version
      D : show the differences between the versions
      Z : start a shell to examine the situation
 The default action is to keep your current version.
*** smartmontools (Y/I/N/O/D/Z) [default=N] ? d
sh: 1: pager: not found
diff: standard output: Broken pipe
dpkg: error processing package smartmontools (--configure):
 conffile difference visualizer subprocess returned error exit status 127

Due to missing /bin/pager:

(c)rafaeldtinoco@devel:~$ which pager
(c)rafaeldtinoco@devel:~$ ls -lah /bin/pager
lrwxrwxrwx 1 root root 23 Apr 24 21:39 /bin/pager -> /etc/alternatives/pager
(c)rafaeldtinoco@devel:~$ ls -lah /etc/alternatives/pager
lrwxrwxrwx 1 root root 13 Apr 24 21:39 /etc/alternatives/pager -> /usr/bin/less

Try checking your system for pager:

(c)rafaeldtinoco@devel:~$ sudo update-alternatives --query pager
Name: pager
Link: /usr/bin/pager
Slaves:
 pager.1.gz /usr/share/man/man1/pager.1.gz
Status: auto
Best: /usr/bin/less
Value: /usr/bin/less

Alternative: /bin/more
Priority: 50
Slaves:
 pager.1.gz /usr/share/man/man1/more.1.gz

Alternative: /usr/bin/less
Priority: 77
Slaves:
 pager.1.gz /usr/share/man/man1/less.1.gz

and fixing it!

Changed in smartmontools (Ubuntu):
status: New → Invalid
status: Invalid → Triaged
Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Hum,

This might be something else... chances for 2 bugs:

https://bugs.launchpad.net/ubuntu/+source/smartmontools/+bug/1874953 (this)
https://bugs.launchpad.net/ubuntu/+source/smartmontools/+bug/1875010 (similar)

not to have pager is lower than just 1.

I'm marking the other bug as a duplicate of this.

Changed in dpkg (Ubuntu):
status: New → Triaged
importance: Undecided → High
Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Looks like "D" option is not working, two bugs with problems...

Need to double check.

Ed M (edjm)
information type: Public → Public Security
information type: Public Security → Public
Revision history for this message
Kai Kasurinen (kai-kasurinen) wrote :

probably related to:

less (551-1) sid; urgency=low
  * move binaries back to /usr/bin (closes: #500092)

Changed in smartmontools (Ubuntu):
status: Triaged → Invalid
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in less (Ubuntu):
status: New → Confirmed
Revision history for this message
Paride Legovini (paride) wrote :

Hi! I agree, this:

less (551-1) sid; urgency=low
  * move binaries back to /usr/bin (closes: #500092)

is almost certainly related. If during the upgrade process the new 'less' package is unpacked but not configured yet, there's a window where the pager alternative points to the wrong location.

I can't see an easy way to fix this. What the linked Debian bug suggests, that is: make dpkg fallback to more(1) if $PAGER is not available, is probably the right balance between making dpkg solid and not adding an overly complex logic for what basically is a one-off failure.

summary: - package smartmontools 7.1-1build1 failed to install/upgrade: conffile
- difference visualizer subprocess returned error exit status 127
+ dpkg: conffile difference visualizer subprocess returned error exit
+ status 127
tags: added: rls-ff-incoming
Changed in dpkg (Debian):
status: Unknown → New
Changed in less (Ubuntu):
importance: Undecided → Critical
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

We must not change the location of binaries from /bin to /usr/bin or vice-versa, inside the deb.

It doesn't matter on freshly installed systems that have usr-merge, but breaks upgraded systems.

This must be reverted.

Changed in less (Ubuntu Focal):
importance: Undecided → Critical
status: New → Triaged
Changed in less (Ubuntu Groovy):
status: Confirmed → Triaged
tags: removed: rls-ff-incoming
tags: added: id-5ed9172aa6b60a1ab1f596d3
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Thinking about it.

Can we add update-alternatives to preinst/upgrade, similar to how it is done in postinst/configure?

Changed in less (Ubuntu Groovy):
status: Triaged → In Progress
Revision history for this message
Paride Legovini (paride) wrote :

The minimal change is probably moving

update-alternatives --quiet --remove pager /bin/less

from postinst to preinst. The pager alternative will fallback to 'more' at least until the new alternative is set up. Strictly speaking it is probably the most correct thing to do, as 'pager' is never left wrongly configured.

However there are several packages calling `update-alternatives --install` from preinst [1]. That's probably OK too.

[1] https://codesearch.debian.net/search?q=path%3Adebian%2Fpreinst+update-alternatives&literal=1

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package less - 551-1ubuntu1

---------------
less (551-1ubuntu1) groovy; urgency=medium

  * On upgrade from packages that shipped less in both /bin and /usr/bin,
    call update-alternatives in preinst, such that after unpacking,
    /usr/bin/pager remains operational. This should resolve dpkg failing
    to invoke pager by dpkg. LP: #1874953

 -- Dimitri John Ledkov <email address hidden> Fri, 05 Jun 2020 16:18:51 +0100

Changed in less (Ubuntu Groovy):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in dpkg (Ubuntu Focal):
status: New → Confirmed
Changed in smartmontools (Ubuntu Focal):
status: New → Confirmed
Revision history for this message
Paride Legovini (paride) wrote :
Changed in less (Debian):
status: Unknown → New
Changed in less (Debian):
status: New → Fix Committed
Steve Langasek (vorlon)
Changed in dpkg (Ubuntu Focal):
status: Confirmed → Invalid
Changed in dpkg (Ubuntu Groovy):
status: Triaged → Invalid
Changed in smartmontools (Ubuntu Focal):
status: Confirmed → Invalid
description: updated
Changed in less (Ubuntu Focal):
assignee: nobody → Brian Murray (brian-murray)
milestone: none → ubuntu-20.04.1
status: Triaged → In Progress
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Craig, or anyone else affected,

Accepted less into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/less/551-1ubuntu0.1 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, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. 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 for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in less (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (less/551-1ubuntu0.1)

All autopkgtests for the newly accepted less (551-1ubuntu0.1) for focal have finished running.
The following regressions have been reported in tests triggered by the package:

mercurial/5.3.1-1ubuntu1 (s390x)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/focal/update_excuses.html#less

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Brian Murray (brian-murray) wrote :

The version of less from focal-proposed resolved the issue and I'm now able to view the diff.

Configuration file '/etc/default/smartmontools'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ? Your options are:
    Y or I : install the package maintainer's version
    N or O : keep your currently-installed version
      D : show the differences between the versions
      Z : start a shell to examine the situation
 The default action is to keep your current version.
*** smartmontools (Y/I/N/O/D/Z) [default=N] ? d
--- /etc/default/smartmontools 2020-07-01 15:02:20.945403642 -0700
+++ /etc/default/smartmontools.dpkg-new 2019-10-09 17:32:47.000000000 -0700
@@ -4,9 +4,6 @@
 # List of devices you want to explicitly enable S.M.A.R.T. for
 # Not needed (and not recommended) if the device is monitored by smartd
 #enable_smart="/dev/hda /dev/hdb"
-enable_smart="/dev/vda"
-# uncomment to start smartd on system startup
-#start_smartd=yes

 # uncomment to pass additional options to smartd on startup
 #smartd_opts="--interval=1800"

Configuration file '/etc/default/smartmontools'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ? Your options are:
    Y or I : install the package maintainer's version
    N or O : keep your currently-installed version
      D : show the differences between the versions
      Z : start a shell to examine the situation
 The default action is to keep your current version.
*** smartmontools (Y/I/N/O/D/Z) [default=N] ? z
Useful environment variables:
 - DPKG_SHELL_REASON
 - DPKG_CONFFILE_OLD
 - DPKG_CONFFILE_NEW
Type 'exit' when you're done.
root@clean-xenial-amd64:/# apt-cache policy less
less:
  Installed: 551-1ubuntu0.1
  Candidate: 551-1ubuntu0.1
  Version table:
 *** 551-1ubuntu0.1 500
        500 http://ubuntu.osuosl.org/ubuntu focal-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     551-1 500
        500 http://ubuntu.osuosl.org/ubuntu focal/main amd64 Packages

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote :

All autopkgtests for the newly accepted less (551-1ubuntu0.1) for focal have finished running.
The following regressions have been reported in tests triggered by the package:

mercurial/5.3.1-1ubuntu1 (s390x)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/focal/update_excuses.html#less

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for less has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package less - 551-1ubuntu0.1

---------------
less (551-1ubuntu0.1) focal; urgency=medium

  * On upgrade from packages that shipped less in both /bin and /usr/bin,
    call update-alternatives in preinst, such that after unpacking,
    /usr/bin/pager remains operational. This should resolve dpkg failing
    to invoke pager by dpkg. LP: #1874953

 -- Brian Murray <email address hidden> Wed, 01 Jul 2020 16:25:13 -0700

Changed in less (Ubuntu Focal):
status: Fix Committed → Fix Released
Changed in less (Debian):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.