package chrony 3.2-4ubuntu4.2 failed to install/upgrade: installed chrony package post-removal script subprocess returned error exit status 1
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
chrony (Debian) |
Fix Released
|
Unknown
|
|||
chrony (Ubuntu) |
Fix Released
|
Undecided
|
Christian Ehrhardt | ||
Bionic |
Fix Released
|
Undecided
|
Christian Ehrhardt |
Bug Description
[Impact]
* When chrony is removed the systems default time service is tried to be
restored. That was and is systemd-timesyncd.
- this was in Debian and Ubuntu since [1]
* That worked fine when systemd-timesyncd was always installed as it was
in the past. But systemd 245.4-2ubuntu1 changed that and it will no more
be installed as it now conflicts.
* That change in systemd lets chrony upgrade fail in postrm where it tries
to start the default again. The Bionic version of the postrm never had
the safety ||true as that was never needed in Bionic an SRU would just
have been forcing many users into a download they would not have needed.
* But due to the systemd change in focal we now need that simple change to
avoid upgrades breaking.
[1]: https:/
[Test Case]
* Take a bionic system with chrony installed and upgrade to Focal.
Please use a VM when doing so as these services do not behave the same
way in containers.
- get bionic system
- apt update && apt dist-upgrade
- apt install chrony
- do-release-upgrade -d
Without the fix installed in Bionic what will happen
is an upgrade error like:
Removing chrony (3.2-4ubuntu4.2) ...
Job for systemd-
See "systemctl status systemd-
dpkg: error processing package chrony (--remove):
installed chrony package post-removal script subprocess returned error exit status 1
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/
Exception during pm.DoInstall(): E:Sub-process /usr/bin/dpkg returned an error code (1)
With the fix that will show a warning if systemd-timesyncd is
unavailable, but it won't crash the upgrade.
In the log you can (with the fix) find:
$ grep chrony -C 6 /var/log/
Removing chrony (3.2-4ubuntu4.
Job for systemd-
See "systemctl status systemd-
(Reading database ... 60156 files and directories currently installed.)
Preparing to unpack .../libaudit-
Unpacking libaudit-common (1:2.8.5-2ubuntu6) over (1:2.8.2-1ubuntu1) ...
Setting up libaudit-common (1:2.8.5-2ubuntu6) ...
Note: the removal is not part of the "do you want to remove obsolete" in
do-release-
is triggered by dependencies/
* Autopkgtests were broken, another test is that those should now work
again.
[Regression Potential]
* The change is minimal as it only ignores a potential error that
a) is considered safe if it happens
b) we now know will happen on a bionic->focal upgrade
In addition we also had that change since 19.10.
[Other Info]
* This is of some extra urgency as it needs to land in Bionic before
upgrading to 20.04 will happen which people are supposed to test
now and will be released soon.
* Note: In focal we can now stop starting the systemd-timesyncd from
chrony as it now takes care in systemd-
will get to Focal to silence the warning, but it isn't gating the SRU to
bionic (the change we backport is already in >=19.10).
In bionic we can't drop it the same way as we will do in Focal as there
timesyncd is not split, so the restart there was and still is needed.
* We also happened to find while SRUing this that the autopkgtest in
Bionic degraded and will fix that in an upload (new version 3.2-
4ubuntu4.4 as 3.2-4ubuntu4.3 was already in proposed, but build with
.changes covering both)
---
Failed during bionic->focal upgrade
ProblemType: Package
DistroRelease: Ubuntu 20.04
Package: chrony 3.2-4ubuntu4.2
ProcVersionSign
Uname: Linux 4.15.0-
ApportVersion: 2.20.9-0ubuntu7.14
Architecture: amd64
Date: Sat Apr 11 10:42:36 2020
DpkgTerminalLog:
Removing chrony (3.2-4ubuntu4.2) ...
Job for systemd-
See "systemctl status systemd-
dpkg: error processing package chrony (--remove):
installed chrony package post-removal script subprocess returned error exit status 1
ErrorMessage: installed chrony package post-removal script subprocess returned error exit status 1
Python3Details: /usr/bin/python3.8, Python 3.8.2, python3-minimal, 3.8.2-0ubuntu2
PythonDetails: /usr/bin/python2.7, Python 2.7.17, python-minimal, 2.7.15~rc1-1
RelatedPackageV
dpkg 1.19.0.5ubuntu2.3
apt 2.0.1ubuntu1
SourcePackage: chrony
Title: package chrony 3.2-4ubuntu4.2 failed to install/upgrade: installed chrony package post-removal script subprocess returned error exit status 1
UpgradeStatus: Upgraded to focal on 2020-04-11 (0 days ago)
Related branches
- Balint Reczey (community): Approve
- Canonical Server: Pending requested
- Canonical Server packageset reviewers: Pending requested
- git-ubuntu developers: Pending requested
-
Diff: 75 lines (+18/-17)3 files modifieddebian/changelog (+16/-0)
debian/postrm (+0/-16)
debian/tests/control (+2/-1)
- Balint Reczey (community): Approve
- Canonical Server: Pending requested
- Canonical Server packageset reviewers: Pending requested
- git-ubuntu developers: Pending requested
-
Diff: 27 lines (+8/-1)2 files modifieddebian/changelog (+7/-0)
debian/postrm (+1/-1)
tags: | removed: need-duplicate-check |
description: | updated |
Changed in chrony (Ubuntu): | |
status: | Fix Released → Triaged |
description: | updated |
Changed in chrony (Debian): | |
status: | Unknown → Fix Released |
Upgrade from bionic to focal broke for this system which has chrony installed.
After do-release-upgrade exited (warning that the system was in an indeterminate state) I was unable to fix the system initially. It seemed that systemd-timesyncd was somehow interacting badly with chrony:
$ sudo apt --fix-broken install filesystem1. 65.1 libboost- iostreams1. 65.1 libboost- system1. 65.1 libcwidget3v5 libip4tc2 libnspr4 libnss3 python3.6 python3.6-minimal iostreams1. 71.0 libcwidget4 libxapian30 iostreams1. 71.0 libcwidget4 timesyncd. service failed because the control process exited with error code. timesyncd. service" and "journalctl -xe" for details.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
libboost-
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
libboost-
Suggested packages:
libcwidget-dev xapian-tools
The following packages will be REMOVED:
chrony
The following NEW packages will be installed:
libboost-
The following packages will be upgraded:
libxapian30
1 upgraded, 2 newly installed, 1 to remove and 439 not upgraded.
2 not fully installed or removed.
Need to get 0 B/1204 kB of archives.
After this operation, 3022 kB of additional disk space will be used.
Do you want to continue? [Y/n]
(Reading database ... 171920 files and directories currently installed.)
Removing chrony (3.2-4ubuntu4.2) ...
Job for systemd-
See "systemctl status systemd-
dpkg: error processing package chrony (--remove):
installed chrony package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
chrony
E: Sub-process /usr/bin/dpkg returned an error code (1)
I turned off the systemd-timesync ntp and that then allowed chrony to be removed (not quite what I wanted but that is another story):
mark@bigben: /var/log/ chrony$ sudo timedatectl status
Local time: Sat 2020-04-11 10:55:31 UTC
Universal time: Sat 2020-04-11 10:55:31 UTC
RTC time: Sat 2020-04-11 10:55:31
Time zone: Etc/UTC (UTC, +0000) timesyncd. service active: yes
RTC in local TZ: no /var/log/ chrony$ sudo timedatectl set-ntp false /var/log/ chrony$ sudo timedatectl status
Local time: Sat 2020-04-11 10:55:50 UTC
Universal time: Sat 2020-04-11 10:55:50 UTC
RTC time: Sat 2020-04-11 10:55:50
Time zone: Etc/UTC (UTC, +0000) timesyncd. service active: no
RTC in local TZ: no
System clock synchronized: yes
systemd-
mark@bigben:
mark@bigben:
System clock synchronized: yes
systemd-
$ sudo apt --fix-broken install filesystem1. 65.1 libboost- iostreams1. 65.1 libboost- system1. 65.1 libcwidget3v5 libip4tc2 libnspr4 libnss3 python3.6 python3.6...
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
libboost-