2022-05-13 22:25:03 |
Athos Ribeiro |
bug |
|
|
added bug |
2022-05-13 22:25:12 |
Athos Ribeiro |
postgresql-common (Ubuntu): status |
New |
Triaged |
|
2022-05-13 22:25:22 |
Athos Ribeiro |
bug |
|
|
added subscriber Ubuntu Server |
2022-05-13 22:25:25 |
Athos Ribeiro |
postgresql-common (Ubuntu): assignee |
|
Athos Ribeiro (athos-ribeiro) |
|
2022-05-16 13:38:36 |
Launchpad Janitor |
merge proposal linked |
|
https://code.launchpad.net/~athos-ribeiro/ubuntu/+source/postgresql-common/+git/postgresql-common/+merge/422669 |
|
2022-05-16 15:12:50 |
Athos Ribeiro |
bug watch added |
|
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1011067 |
|
2022-05-16 15:12:50 |
Athos Ribeiro |
bug task added |
|
postgresql-common (Debian) |
|
2022-05-16 15:36:40 |
Bug Watch Updater |
postgresql-common (Debian): status |
Unknown |
New |
|
2022-05-17 08:45:36 |
Dave Jones |
bug |
|
|
added subscriber Dave Jones |
2022-05-23 13:25:41 |
Launchpad Janitor |
postgresql-common (Ubuntu): status |
Triaged |
Fix Released |
|
2022-08-18 19:30:08 |
Launchpad Janitor |
merge proposal linked |
|
https://code.launchpad.net/~athos-ribeiro/ubuntu/+source/postgresql-common/+git/postgresql-common/+merge/428574 |
|
2022-10-19 14:12:01 |
Michał Małoszewski |
tags |
server-todo update-excuse |
update-excuse |
|
2022-10-25 12:48:51 |
Bug Watch Updater |
postgresql-common (Debian): status |
New |
Fix Released |
|
2023-04-11 14:58:07 |
Athos Ribeiro |
nominated for series |
|
Ubuntu Jammy |
|
2023-04-11 14:58:07 |
Athos Ribeiro |
bug task added |
|
postgresql-common (Ubuntu Jammy) |
|
2023-04-11 19:35:36 |
Launchpad Janitor |
merge proposal linked |
|
https://code.launchpad.net/~athos-ribeiro/ubuntu/+source/postgresql-common/+git/postgresql-common/+merge/440666 |
|
2023-04-11 19:37:29 |
Athos Ribeiro |
postgresql-common (Ubuntu Jammy): assignee |
|
Athos Ribeiro (athos-ribeiro) |
|
2023-04-11 21:20:58 |
Athos Ribeiro |
description |
As seen in
https://autopkgtest.ubuntu.com/results/autopkgtest-kinetic/kinetic/amd64/p/postgresql-common/20220513_042035_38c41@/log.gz
postgresql-common autopkgtest suite have been failing with
# BEGIN LOGS
=== Running test 012_maintscripts.t ... ===
1..14
# We are running systemd
ok 1 - pg_createcluster 14 main --start
ok 2 - postmaster PID is 3634
ok 3 - dpkg-reconfigure --frontend=noninteractive postgresql-common
head: cannot open '/var/lib/postgresql/14/main/postmaster.pid' for reading: No such file or directory
not ok 4 - postmaster PID is
not ok 5 - postmaster was not restarted
# Failed test 'postmaster PID is '
# at ./t/012_maintscripts.t line 32.
# Failed test 'postmaster was not restarted'
# at ./t/012_maintscripts.t line 33.
# got: '3634'
# expected: ''
ok 6 - pg_dropcluster 14 main --stop
# Cleanup
ok 7 - Cleanup: No clusters left behind
ok 8 - No postgres processes left behind
ok 9 - No files in /etc/postgresql left behind
ok 10 - No files in /var/lib/postgresql left behind
ok 11 - No files in /var/run/postgresql left behind
ok 12 - No files in /var/log/postgresql left behind
ok 13 - netstat -avptn 2>/dev/null | grep ":543[2-9]\b.*LISTEN"
ok 14 - PostgreSQL TCP ports are closed
# Looks like you failed 2 tests of 14.
# END LOGS
The test fails because, in Ubuntu, running
dpkg-reconfigure --frontend=noninteractive postgresql-common
results in a call to
deb-systemd-invoke stop 'postgresql.service',
stopping the service which the test expects to be up and running (untouched).
This started happening after the following debhelper change introduced in debhelper 13.6:
https://salsa.debian.org/debian/debhelper/-/commit/742b0c5ac8f4a6cfcd699f08915a8109a5ebec35
Which resulted in the following diff in the postgresql-common preinst script:
# BEGIN DIFF
--- 238-comm/preinst 2022-02-10 07:02:57.000000000 -0300
+++ 241-comm/preinst 2022-05-11 10:57:04.000000000 -0300
@@ -16,7 +16,12 @@
;;
esac
-# Automatically added by dh_installdeb/13.5.2ubuntu1
+# Automatically added by dh_installdeb/13.7.1ubuntu1
dpkg-maintscript-helper rm_conffile /etc/apt/apt.conf.d/01autoremove-postgresql 229\~ postgresql-common -- "$@"
# End automatically added section
+# Automatically added by dh_installsystemd/13.7.1ubuntu1
+if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = upgrade ] && [ -d /run/systemd/system ] ; then
+ deb-systemd-invoke stop 'postgresql.service' >/dev/null || true
+fi
+# End automatically added section
# END DIFF
Tests passed in Debian as shown in
https://ci.debian.net/data/autopkgtest/testing/amd64/p/postgresql-common/21568780/log.gz
Note that it was using debhelper 13.7.1, which did introduce the new snipped into the preinst script. Local autopkgtest runs for Debian also succeed.
The reason for the test to fail in Ubuntu and pass in Debian lies in
https://salsa.debian.org/pkg-debconf/debconf/-/merge_requests/10/diffs#8c2015059db93e56eaf3ed8ea7a2c9bf142c0c8f_198_197
which is applied in Ubuntu delta (but not in Debian).
A possible solution to the issue would be to introduce the "-r" (or --no-stop-on-upgrade) option to dh_installsystemd in Ubuntu's postgresql-common d/rules. This should be enough to keep the expected (old) behavior in the package maintainer scripts.
Then, if/once https://salsa.debian.org/pkg-debconf/debconf/-/merge_requests/10 is merged, we can merge the delta in Debian. |
[ Impact ]
The current postgresql-common DEP8 test suite will fail for any new postgresql-common builds in jammy (even if they are no-change-rebuilds), hindering the SRU process for any needed bug fixes.
This happens because new builds will pick-up different versions of debhelper/debconf than the ones used to build the package shipped in jammy. These new debhelper/debconf versions changed the built package control preinst output to stop the service upon installation.
The proposed fix intends to mimic jammy's postgresql-common behavior even when built with the new debhelper/debconf versions.
[ Test Plan ]
- Rebuild the package (no changes) in a PPA
- Run the DEP8 test suite for that PPA package
- Verify the autopkgtest fails
- Apply the proposed fix
- Verify that tests now pass
Finally, verify that the binary packages control data did not change for the maintscripts to avoid future upgrade unexpected issues (i.e., maintain the package behavior - no control logical changes).
[ Where problems could occur ]
By Verifying that the binary packages control logical data did not change for the maintscripts, we are actually ensuring this SRU suppresses the changes that would be applied to the package by the debhelper/debconf change. Still, there may be other unaccounted dependency changes (as this one was once) that may affect the package usability. If that is the case, we will need to evaluate and deal with possible issues in future SRUs.
[ Other info ]
The reason this issue is only manifesting in jammy now is because our latest postgresql-common build in jammy was performed during jammy's development, before the aforementioned debhelper/debconf changes landed.
When trying to SRU a fix for LP: #2007794, we realized jammy is also affected by this bug.
[ Original message ]
As seen in
https://autopkgtest.ubuntu.com/results/autopkgtest-kinetic/kinetic/amd64/p/postgresql-common/20220513_042035_38c41@/log.gz
postgresql-common autopkgtest suite have been failing with
# BEGIN LOGS
=== Running test 012_maintscripts.t ... ===
1..14
# We are running systemd
ok 1 - pg_createcluster 14 main --start
ok 2 - postmaster PID is 3634
ok 3 - dpkg-reconfigure --frontend=noninteractive postgresql-common
head: cannot open '/var/lib/postgresql/14/main/postmaster.pid' for reading: No such file or directory
not ok 4 - postmaster PID is
not ok 5 - postmaster was not restarted
# Failed test 'postmaster PID is '
# at ./t/012_maintscripts.t line 32.
# Failed test 'postmaster was not restarted'
# at ./t/012_maintscripts.t line 33.
# got: '3634'
# expected: ''
ok 6 - pg_dropcluster 14 main --stop
# Cleanup
ok 7 - Cleanup: No clusters left behind
ok 8 - No postgres processes left behind
ok 9 - No files in /etc/postgresql left behind
ok 10 - No files in /var/lib/postgresql left behind
ok 11 - No files in /var/run/postgresql left behind
ok 12 - No files in /var/log/postgresql left behind
ok 13 - netstat -avptn 2>/dev/null | grep ":543[2-9]\b.*LISTEN"
ok 14 - PostgreSQL TCP ports are closed
# Looks like you failed 2 tests of 14.
# END LOGS
The test fails because, in Ubuntu, running
dpkg-reconfigure --frontend=noninteractive postgresql-common
results in a call to
deb-systemd-invoke stop 'postgresql.service',
stopping the service which the test expects to be up and running (untouched).
This started happening after the following debhelper change introduced in debhelper 13.6:
https://salsa.debian.org/debian/debhelper/-/commit/742b0c5ac8f4a6cfcd699f08915a8109a5ebec35
Which resulted in the following diff in the postgresql-common preinst script:
# BEGIN DIFF
--- 238-comm/preinst 2022-02-10 07:02:57.000000000 -0300
+++ 241-comm/preinst 2022-05-11 10:57:04.000000000 -0300
@@ -16,7 +16,12 @@
;;
esac
-# Automatically added by dh_installdeb/13.5.2ubuntu1
+# Automatically added by dh_installdeb/13.7.1ubuntu1
dpkg-maintscript-helper rm_conffile /etc/apt/apt.conf.d/01autoremove-postgresql 229\~ postgresql-common -- "$@"
# End automatically added section
+# Automatically added by dh_installsystemd/13.7.1ubuntu1
+if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = upgrade ] && [ -d /run/systemd/system ] ; then
+ deb-systemd-invoke stop 'postgresql.service' >/dev/null || true
+fi
+# End automatically added section
# END DIFF
Tests passed in Debian as shown in
https://ci.debian.net/data/autopkgtest/testing/amd64/p/postgresql-common/21568780/log.gz
Note that it was using debhelper 13.7.1, which did introduce the new snipped into the preinst script. Local autopkgtest runs for Debian also succeed.
The reason for the test to fail in Ubuntu and pass in Debian lies in
https://salsa.debian.org/pkg-debconf/debconf/-/merge_requests/10/diffs#8c2015059db93e56eaf3ed8ea7a2c9bf142c0c8f_198_197
which is applied in Ubuntu delta (but not in Debian).
A possible solution to the issue would be to introduce the "-r" (or --no-stop-on-upgrade) option to dh_installsystemd in Ubuntu's postgresql-common d/rules. This should be enough to keep the expected (old) behavior in the package maintainer scripts.
Then, if/once https://salsa.debian.org/pkg-debconf/debconf/-/merge_requests/10 is merged, we can merge the delta in Debian. |
|
2023-05-12 23:44:00 |
Athos Ribeiro |
tags |
update-excuse |
block-proposed-jammy update-excuse |
|
2023-05-13 00:03:19 |
Steve Langasek |
postgresql-common (Ubuntu Jammy): status |
New |
Incomplete |
|
2023-05-19 23:56:33 |
Steve Langasek |
postgresql-common (Ubuntu Jammy): status |
Incomplete |
In Progress |
|
2023-05-19 23:57:06 |
Steve Langasek |
postgresql-common (Ubuntu Jammy): status |
In Progress |
Fix Committed |
|
2023-05-19 23:57:09 |
Steve Langasek |
bug |
|
|
added subscriber Ubuntu Stable Release Updates Team |
2023-05-19 23:57:13 |
Steve Langasek |
bug |
|
|
added subscriber SRU Verification |
2023-05-19 23:57:16 |
Steve Langasek |
tags |
block-proposed-jammy update-excuse |
block-proposed-jammy update-excuse verification-needed verification-needed-jammy |
|
2023-05-26 02:39:08 |
Athos Ribeiro |
tags |
block-proposed-jammy update-excuse verification-needed verification-needed-jammy |
block-proposed-jammy update-excuse verification-done verification-done-jammy |
|