package trousers 0.3.7-2ubuntu1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 137

Bug #959795 reported by James P. Carter on 2012-03-19
74
This bug affects 12 people
Affects Status Importance Assigned to Milestone
trousers (Ubuntu)
High
Unassigned
Precise
High
Unassigned
Quantal
High
Unassigned

Bug Description

[Impact]

Trousers users need to reboot (or restart udev) in order to fully complete configuration of the package. Worse, the install fails and prompts to open this bug with apport.

[Fix]

First, the problem. Though udev watches their rules files and re-reads them whenever something new is added, it does _not_ monitor when new users are groups are added to the system. We're left with:

Jul 31 21:21:46 neptune udevd[409]: specified user 'tss' unknown
Jul 31 21:21:46 neptune udevd[409]: specified group 'tss' unknown

The fix is to explicitly restart udev. This causes udev to reread users and groups and allows the initscript to start.

[Test Case]

1) make sure there is no tss user/group
2) apt-get install tpm-tools

[Regression Potential]

Very small. udevadm control --reload-rules is a benign command and we have it in other packages already.

[Original Report]

Setting up trousers (0.3.7-2ubuntu1) ...
Adding system user `tss' (UID 118) ...
Adding new group `tss' (GID 129) ...
Adding new user `tss' (UID 118) with group `tss' ...
Not creating home directory `/var/lib/tpm'.
 * Starting Trusted Computing daemon tcsd [fail]
invoke-rc.d: initscript trousers, action "start" failed.
dpkg: error processing trousers (--configure):
 subprocess installed post-installation script returned error exit status 137
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of tpm-tools:
 tpm-tools depends on trousers; however:
  Package trousers is not configured yet.
dpkg: error processing tpm-tools (--configure):
 dependency problems - leaving unconfigured

ProblemType: Package
DistroRelease: Ubuntu 12.04
Package: trousers 0.3.7-2ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-19.30-generic 3.2.11
Uname: Linux 3.2.0-19-generic x86_64
NonfreeKernelModules: fglrx
ApportVersion: 1.94.1-0ubuntu2
Architecture: amd64
Date: Mon Mar 19 16:16:56 2012
ErrorMessage: subprocess installed post-installation script returned error exit status 137
SourcePackage: trousers
Title: package trousers 0.3.7-2ubuntu1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 137
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

James P. Carter (jpcarter) wrote :
James P. Carter (jpcarter) wrote :
Download full text (4.3 KiB)

** 2nd Installation Attempt with debug packages selected **

Selecting previously unselected package libopencryptoki-dev.
(Reading database ... 345311 files and directories currently installed.)
Unpacking libopencryptoki-dev (from .../libopencryptoki-dev_2.3.1+dfsg-3ubuntu2_amd64.deb) ...
Selecting previously unselected package zlib1g-dev.
Unpacking zlib1g-dev (from .../zlib1g-dev_1%3a1.2.3.4.dfsg-3ubuntu4_amd64.deb) ...
Selecting previously unselected package libssl-dev.
Unpacking libssl-dev (from .../libssl-dev_1.0.0g-1ubuntu1_amd64.deb) ...
Selecting previously unselected package libssl-doc.
Unpacking libssl-doc (from .../libssl-doc_1.0.0g-1ubuntu1_all.deb) ...
Selecting previously unselected package libtspi-dev.
Unpacking libtspi-dev (from .../libtspi-dev_0.3.7-2ubuntu1_amd64.deb) ...
Selecting previously unselected package opencryptoki-dbg.
Unpacking opencryptoki-dbg (from .../opencryptoki-dbg_2.3.1+dfsg-3ubuntu2_amd64.deb) ...
Selecting previously unselected package trousers-dbg.
Unpacking trousers-dbg (from .../trousers-dbg_0.3.7-2ubuntu1_amd64.deb) ...
Processing triggers for man-db ...
Setting up trousers (0.3.7-2ubuntu1) ...
The system user `tss' already exists. Exiting.
 * Starting Trusted Computing daemon tcsd [fail]
invoke-rc.d: initscript trousers, action "start" failed.
dpkg: error processing trousers (--configure):
 subprocess installed post-installation script returned error exit status 137
dpkg: dependency problems prevent configuration of tpm-tools:
 tpm-tools depends on trousers; however:
  Package trousers is not configured yet.
dpkg: error processing tpm-tools (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of tpm-tools-dbg:
 tpm-tools-dbg depends on tpm-tools (= 1.3.7-1); however:
  Package tpm-tools is not configured yet.
dpkg: error processing tpm-tools-dbg (--configure):
 dependency problems - leaving unconfigured
Setting up libopencryptoki-dev (2.3.1+dfsg-3ubuntu2) ...
Setting up zlib1g-dev (1:1.2.3.4.dfsg-3ubuntu4) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                          No apport report written because the error message indicates its a followup error from a previous failure.
                                                    Setting up libssl-dev (1.0.0g-1ubuntu1) ...
Setting up libssl-doc (1.0.0g-1ubuntu1) ...
Setting up libtspi-dev (0.3.7-2ubuntu1) ...
Setting up opencryptoki-dbg (2.3.1+dfsg-3ubuntu2) ...
dpkg: dependency problems prevent configuration of trousers-dbg:
 trousers-dbg depends on trousers (= 0.3.7-2ubuntu1); however:
  Package trousers is not configured yet.
dpkg: error processing trousers-dbg (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          Errors were encountered while processing:
 trousers
 tpm-tools
 tpm-tools-dbg
 trousers-dbg
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up trousers (0.3.7-2ubuntu1) ...
The system use...

Read more...

tags: removed: need-duplicate-check
James P. Carter (jpcarter) wrote :

wow... strange... on a whim I decided to run through the installations to see if I could gather more information.

I changed directory to /var/cache/apt/archives

dpkg -i trousers* (installed with no error)

dpkg -i tpm-tools* (installed with no error)

Perhaps something is missing... or perhaps 'I' am missing something here? Let me know if I need to do any additional tasks to help out here.

Thank you,
-james

Danny Fullerton (northox) wrote :

I have the same problem but dpkg -i trousers* still fails.

# dpkg -i trouser*
(Reading database ... 177528 files and directories currently installed.)
Preparing to replace trousers 0.3.7-2ubuntu1 (using trousers_0.3.7-2ubuntu1_amd64.deb) ...
 * Stopping Trusted Computing daemon tcsd [ OK ]
Unpacking replacement trousers ...
Setting up trousers (0.3.7-2ubuntu1) ...
The system user `tss' already exists. Exiting.
 * Starting Trusted Computing daemon tcsd [fail]
invoke-rc.d: initscript trousers, action "start" failed.
dpkg: error processing trousers (--install):
 subprocess installed post-installation script returned error exit status 137
Processing triggers for ureadahead ...
Processing triggers for man-db ...
Errors were encountered while processing:
 trousers

Launchpad Janitor (janitor) wrote :

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

Changed in trousers (Ubuntu):
status: New → Confirmed
James M. Leddy (jm-leddy) wrote :

As near as I can tell, this is because user tss does not have access to tpm0. This causes start-stop-daemon in the init script to fail, which in turn causes the init script to fail, which means that the install will fail. The best way to fix this is to have tpm0 accessible to tss user.

open("/dev/tpm0", O_RDWR) = -1 EACCES (Permission denied)
open("/udev/tpm0", O_RDWR) = -1 ENOENT (No such file or directory)
open("/dev/tpm", O_RDWR) = -1 ENOENT (No such file or directory)

James M. Leddy (jm-leddy) wrote :

Looks like commit 19 was designed to address this. The commands provided don't actually alter the permissions though:

https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/precise/trousers/precise/revision/19

James M. Leddy (jm-leddy) wrote :

according to https://wiki.ubuntu.com/UdevRoadmap:

> There are some more recent changes in the git repository that provide caching of the udev rules and further volume UUID support (that would be nice for ProbeForRootFilesystem); so we'll pull these and add them to the package.

I think these caching rules went into effect, since udev is not re-reading rules files.

James M. Leddy (jm-leddy) wrote :

udevadm control --reload-rules works, working on a patch

James M. Leddy (jm-leddy) wrote :

The problem is that without --reload-rules, we don't get the new users and groups that were just added. Here is the output in my syslog:

Jul 31 21:21:46 neptune udevd[409]: specified user 'tss' unknown
Jul 31 21:21:46 neptune udevd[409]: specified group 'tss' unknown
Jul 31 21:21:46 neptune TCSD TDDL[12097]: TrouSerS ERROR: Could not find a device to open!

tags: added: rls-q-incoming
Changed in trousers (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → High
Changed in trousers (Ubuntu Precise):
status: New → Triaged
importance: Undecided → High
tags: removed: rls-q-incoming
Bryce Harrington (bryce) on 2012-08-16
description: updated
Brian Murray (brian-murray) wrote :

For the precise branch to merged and uploaded the bug will need the necessary SRU information filled out in the bug description.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package trousers - 0.3.9-2ubuntu1

---------------
trousers (0.3.9-2ubuntu1) quantal; urgency=low

  * debian/trousers.postinst: Reload udev rules to reload new users and
    groups. (LP: #959795) Thanks to James M Leddy for the patch.
  * debian/trousers.prerm: let other arguments like remove work (LP: #1038302)
 -- Brian Murray <email address hidden> Fri, 17 Aug 2012 14:34:07 -0700

Changed in trousers (Ubuntu Quantal):
status: Triaged → Fix Released
Jamie Strandboge (jdstrand) wrote :

I read the man page for udevadm:
       --reload-rules
           Signal udevd to reload the rules files. The udev daemon detects
           changes automatically, this option is usually not needed. Reloading
           rules does not apply any changes to already existing devices.

However, James' error is quite telling:
Jul 31 21:21:46 neptune udevd[409]: specified user 'tss' unknown
Jul 31 21:21:46 neptune udevd[409]: specified group 'tss' unknown

The package is both adding the user group and a udev rule. It may a bug in udev that it isn't doing another lookup if it can't find the group in its cache, but adding a "udevadm control --reload-rules" seems easy enough and ok for an SRU.

Jamie Strandboge (jdstrand) wrote :

I have uploaded the change to 12.04. Please follow https://wiki.ubuntu.com/StableReleaseUpdates as Brian said, and when ready, subscribe ubuntu-sru. At that point, the package will be accepted into precise-proposed. Thanks for your work on this! Unsubscribing ubuntu-sponsors.

Changed in trousers (Ubuntu Precise):
status: Triaged → In Progress
Brian Murray (brian-murray) wrote :

Bug 1038302 should really be fixed in Precise too.

James M. Leddy (jm-leddy) wrote :

Thanks for the work Jamie, I'm subbing ubuntu-sru as requested.

description: updated

Hello James, or anyone else affected,

Accepted trousers into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/trousers/0.3.7-2ubuntu1.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 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 change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

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

Changed in trousers (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
tags: added: verification-done
removed: verification-needed

The verification of this Stable Release Update has completed successfully and the package has now been 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 regresssions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package trousers - 0.3.7-2ubuntu1.1

---------------
trousers (0.3.7-2ubuntu1.1) precise-proposed; urgency=low

  * Reload udev rules to reload new users and groups. (LP: #959795)
 -- James M Leddy <email address hidden> Tue, 31 Jul 2012 21:34:49 -0400

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

Other bug subscribers