debconf socket closes if aptdaemon/PK client exits

Bug #1726068 reported by sinu
32
This bug affects 4 people
Affects Status Importance Assigned to Milestone
apper (Ubuntu)
New
Undecided
Unassigned
Bionic
New
Undecided
Unassigned
aptdaemon (Ubuntu)
Fix Released
High
Julian Andres Klode
Bionic
New
Undecided
Unassigned
packagekit (Ubuntu)
Fix Released
Medium
Julian Andres Klode
Bionic
New
Undecided
Unassigned
software-properties (Ubuntu)
Invalid
High
Unassigned

Bug Description

[Impact]
Closing an application using PackageKit or aptdaemon to install packages kills the debconf endpoint (because it's a subprocess that's cleaned up), causing debconf to use defaults which might lead to wrong results, or even cause installations to fail.

[Solution]
The solution is to move the end point into a socket-activated systemd unit, so that it is independent of the graphical frontend that started the transaction. The other advantage is that this offers us restart if the end point crashes.

[Test case]
1. Install opera deb using packagekit, ensure service is activated
2. Install opera deb using aptdaemon, ensure service is activated

Alternatively, you might use another deb that has debconf prompts.

[Regression potential]
Systems that do not yet use systemd will fall back to the old method, so should not regress.

Otherwise, if there are bugs, they'd affect the ability to show debconf prompts, and behavior would revert to using the defaults.

There might be some uncertainty if you restart your desktop while the helper is running and it does not pick up the new X/Wayland display until it restarts (it should fail to connect and restart). Given that the helper times out, this should not be an issue in practice, as you'd have to logout, login, and start a new install within 60 seconds.

Revision history for this message
sinu (crsububtu) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Steve Langasek (vorlon) wrote :

This happens if software-properties is closed on the desktop before the packages have finished installing.

You will need to run 'sudo apt-get -f install' from a terminal to complete the configuration of these packages.

affects: shim-signed (Ubuntu) → software-properties (Ubuntu)
Changed in software-properties (Ubuntu):
importance: Undecided → High
status: New → Triaged
tags: added: id-59558f621454c20af30afa36
Steve Langasek (vorlon)
summary: - package shim-signed 1.32~16.04.1+0.9+1474479173.6c180c6-1ubuntu1 failed
- to install/upgrade: subprocess installed post-installation script
- returned error exit status 1
+ software-properties closed, closing debconf socket, while aptdaemon is
+ running (package shim-signed
+ 1.32~16.04.1+0.9+1474479173.6c180c6-1ubuntu1 failed to install/upgrade:
+ subprocess installed post-installation script returned error exit status
+ 1)
tags: added: id-5a4d4950c53c0080d7779997
Revision history for this message
Julian Andres Klode (juliank) wrote : Re: software-properties closed, closing debconf socket, while aptdaemon is running (package shim-signed 1.32~16.04.1+0.9+1474479173.6c180c6-1ubuntu1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1)

I think dangling sockets to the frontend might also be a problem with PackageKit, but I'm not sure. My idea was to have helper have a timeout and be (re)launched by systemd via socket activation, but
I don't know if that's feasible.

Changed in software-properties (Ubuntu):
status: Triaged → Invalid
Changed in aptdaemon (Ubuntu):
status: New → Triaged
importance: Undecided → High
Changed in packagekit (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
summary: - software-properties closed, closing debconf socket, while aptdaemon is
- running (package shim-signed
- 1.32~16.04.1+0.9+1474479173.6c180c6-1ubuntu1 failed to install/upgrade:
- subprocess installed post-installation script returned error exit status
- 1)
+ debconf socket closes if aptdaemon/PK client exists
summary: - debconf socket closes if aptdaemon/PK client exists
+ debconf socket closes if aptdaemon/PK client exits
no longer affects: plasma-discover (Ubuntu)
Changed in packagekit (Ubuntu):
status: Triaged → In Progress
assignee: nobody → Julian Andres Klode (juliank)
Changed in aptdaemon (Ubuntu):
status: Triaged → In Progress
assignee: nobody → Julian Andres Klode (juliank)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package packagekit - 1.1.12-5ubuntu3

---------------
packagekit (1.1.12-5ubuntu3) eoan; urgency=medium

  * Actually enable the socket-activated client helper

packagekit (1.1.12-5ubuntu2) eoan; urgency=medium

  * Actually install the socket-activated client helper
  * Do not use pk_client_helper_get_instance_private(), this does not
    actually work, probably needs different type setup.

packagekit (1.1.12-5ubuntu1) eoan; urgency=medium

  * Use a socket-activated client helper (LP: #1726068)

 -- Julian Andres Klode <email address hidden> Fri, 24 May 2019 12:08:09 +0200

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

This bug was fixed in the package aptdaemon - 1.1.1+bzr982-0ubuntu22

---------------
aptdaemon (1.1.1+bzr982-0ubuntu22) eoan; urgency=medium

  * Use PackageKit's socket-activated debconf helper (LP: #1726068)
  * Fix failing tests and disable ones we do not care about anymore (PK/PEP8)
  * Make failing tests fail the build again
  * Drop python2 support

 -- Julian Andres Klode <email address hidden> Fri, 24 May 2019 12:16:27 +0200

Changed in aptdaemon (Ubuntu):
status: Fix Committed → Fix Released
no longer affects: software-properties (Ubuntu Bionic)
no longer affects: software-properties (Ubuntu Disco)
Changed in packagekit (Ubuntu Disco):
status: New → In Progress
description: updated
Revision history for this message
Steve Langasek (vorlon) wrote :

I don't think this test case is well formed, it doesn't describe how to install the packages with the named backends and it doesn't mention needing to kill the frontend or when to kill it.

Changed in packagekit (Ubuntu Disco):
status: In Progress → Incomplete
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

ping, will the test case be improved?

Revision history for this message
Robie Basak (racb) wrote : Proposed package upload rejected

An upload of packagekit to disco-proposed has been rejected from the upload queue for the following reason: "Incomplete SRU information and no response to requests to fix it".

Revision history for this message
Julian Andres Klode (juliank) wrote :

I'm still happy with the test case. It shows that the debconf socket is independent of whatever frontend is running, and hence closing the frontend can't close the debconf socket. Which means you can just use pkcon / aptdcon to test that bit.

I don't really know of any PackageKit frontend that's heavily affected by this. gnome-software is running as a background service, so I guess you could install via it and then kill it and check that the prompts still work. And the KDE stuff is still broken, as they use their own mess.

For aptdaemon, you could probably write a small script.

no longer affects: packagekit (Ubuntu Disco)
no longer affects: aptdaemon (Ubuntu Disco)
no longer affects: apper (Ubuntu Disco)
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.