package google-compute-engine-oslogin 20170718-0ubuntu1~16.04.0 failed to install/upgrade: there is no script in the new version of the package - giving up

Bug #1733878 reported by raktim pain
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gce-compute-image-packages (Ubuntu)
Fix Released
Medium
Balint Reczey
Trusty
Fix Released
Undecided
Unassigned
Xenial
Fix Released
Undecided
Unassigned
Zesty
Fix Released
Undecided
Unassigned
Artful
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

* The bug make dpkg fail to remove/upgrade the 20170718-0ubuntu1* versions of the package with the following error when openssh-server is not installed:
...
Selecting previously unselected package google-compute-engine-oslogin.
Preparing to unpack .../google-compute-engine-oslogin_20171025+dfsg1-0ubuntu1~16.04.0_amd64.deb ...
Deactivating Google Compute Engine OS Login.
cp: cannot stat '/etc/ssh/sshd_config': No such file or directory
...
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
dpkg: error processing archive /var/cache/apt/archives/google-compute-engine-oslogin_20171025+dfsg1-0ubuntu1~16.04.0_amd64.deb (--unpack):
 there is no script in the new version of the package - giving up
...

* This problem may interrupt upgrading other packages as well hence fixing it in stable releases as well is justified.
* The fix is adding an always succeeding prerm script which dpkg can fall back to.

[Test Case]

1. Install openssh-server and ensure ssh server is started
2. Install google-compute-engine-oslogin 20170718-0ubuntu1~16.04.0 or 20170718-0ubuntu1~* targeting the tested release
3. Purge openssh-server
4. Run apt-get dselect-upgrade to trigger upgrade of google-compute-engine-oslogin
4.a. Upgrading to an unfixed version will fail with the errors reported in this bug
4
.b. Upgrading to a fixed version succeeds.

[Regression Potential]

* The added prerm may let package upgrades succeed which were broken for other reasons but the way around that would be adding code which would check for exactly this breakage and this seems to be overkill.
* It seems to be highly unlikely to cause other regressions.

[Original Bug Report Text]

It's taking more than normal time period while booting.

ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: google-compute-engine-oslogin 20170718-0ubuntu1~16.04.0
ProcVersionSignature: Ubuntu 4.10.0-38.42~16.04.1-generic 4.10.17
Uname: Linux 4.10.0-38-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.10
Architecture: amd64
Date: Mon Nov 20 08:25:50 2017
ErrorMessage: there is no script in the new version of the package - giving up
InstallationDate: Installed on 2017-06-11 (164 days ago)
InstallationMedia: Ubuntu 16.04.2 LTS "Xenial Xerus" - Release amd64 (20170215.2)
RelatedPackageVersions:
 dpkg 1.18.4ubuntu1.2
 apt 1.2.24
SourcePackage: gce-compute-image-packages
Title: package google-compute-engine-oslogin 20170718-0ubuntu1~16.04.0 failed to install/upgrade: there is no script in the new version of the package - giving up
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
raktim pain (dark-dorky) wrote :
tags: removed: need-duplicate-check
Balint Reczey (rbalint)
Changed in gce-compute-image-packages (Ubuntu):
assignee: nobody → Balint Reczey (rbalint)
Balint Reczey (rbalint)
Changed in gce-compute-image-packages (Ubuntu):
status: New → Confirmed
Balint Reczey (rbalint)
Changed in gce-compute-image-packages (Ubuntu):
status: Confirmed → Triaged
Balint Reczey (rbalint)
Changed in gce-compute-image-packages (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Balint Reczey (rbalint) wrote :

The failure is caused by old version's prerm failing because it expected openssh-server to be installed.
Please install openssh-server to let prerm succeed and allow upgrades whithout dpkg stopping on prerm error.
I added the proper fix to the packaging repository recovering even when openssh-server is not installed.

Changed in gce-compute-image-packages (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gce-compute-image-packages - 20171129+dfsg1-0ubuntu1

---------------
gce-compute-image-packages (20171129+dfsg1-0ubuntu1) bionic; urgency=medium

  [ Balint Reczey ]
  * Add minimal debian/google-compute-engine-oslogin.prerm to fix upgrades
    (LP: #1733878)
  * New upstream version 20171129+dfsg1
    - Generate SSH host keys when none are present.
    - Improve logging when activating OS Login.
    - Fix parsing logic for expiration time on SSH public keys.
    - Fix home directory creation PAM config.
  * Update symlink to shared library with updated revision
  * Use -I/usr/include/json-c for building tests

  [ Ludovic Gasc ]
  * Add systemd as valid ntp daemon

 -- Balint Reczey <email address hidden> Fri, 01 Dec 2017 19:40:05 +0100

Changed in gce-compute-image-packages (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello raktim, or anyone else affected,

Accepted gce-compute-image-packages into artful-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gce-compute-image-packages/20171129+dfsg1-0ubuntu1~17.10.0 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 and change the tag from verification-needed-artful to verification-done-artful. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-artful. 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 gce-compute-image-packages (Ubuntu Artful):
status: New → Fix Committed
tags: added: verification-needed verification-needed-artful
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello raktim, or anyone else affected,

Accepted gce-compute-image-packages into zesty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gce-compute-image-packages/20171129+dfsg1-0ubuntu1~17.04.0 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 and change the tag from verification-needed-zesty to verification-done-zesty. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-zesty. 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 gce-compute-image-packages (Ubuntu Zesty):
status: New → Fix Committed
tags: added: verification-needed-zesty
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello raktim, or anyone else affected,

Accepted gce-compute-image-packages into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gce-compute-image-packages/20171129+dfsg1-0ubuntu1~16.04.0 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 and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. 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 gce-compute-image-packages (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed-xenial
Changed in gce-compute-image-packages (Ubuntu Trusty):
status: New → Fix Committed
tags: added: verification-needed-trusty
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello raktim, or anyone else affected,

Accepted gce-compute-image-packages into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gce-compute-image-packages/20171129+dfsg1-0ubuntu1~14.04.0 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 and change the tag from verification-needed-trusty to verification-done-trusty. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-trusty. 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!

Balint Reczey (rbalint)
description: updated
Balint Reczey (rbalint)
description: updated
Balint Reczey (rbalint)
tags: added: verification-done-trusty
removed: verification-needed-trusty
Revision history for this message
Balint Reczey (rbalint) wrote :
Download full text (3.2 KiB)

While verifying the fix on Zesty I observed a dpkg crash which is gone in artful and bionic:
root@z-test-gce:~# apt-get dselect-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  openssh-server
The following packages will be upgraded:
  google-compute-engine-oslogin
1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/371 kB of archives.
After this operation, 914 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Preconfiguring packages ...
Selecting previously unselected package openssh-server.
(Reading database ... 26653 files and directories currently installed.)
Preparing to unpack .../openssh-server_1%3a7.4p1-10_amd64.deb ...
Unpacking openssh-server (1:7.4p1-10) ...
Preparing to unpack .../google-compute-engine-oslogin_20171025+dfsg1-0ubuntu1~17.04.0_amd64.deb ...
Deactivating Google Compute Engine OS Login.
cp: cannot stat '/etc/ssh/sshd_config': No such file or directory
sed: can't read /etc/ssh/sshd_config.new: No such file or directory
mv: cannot stat '/etc/ssh/sshd_config.new': No such file or directory
cp: cannot stat '/etc/pam.d/sshd': No such file or directory
sed: can't read /etc/pam.d/sshd.new: No such file or directory
mv: cannot stat '/etc/pam.d/sshd.new': No such file or directory
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
dpkg: error processing archive /var/cache/apt/archives/google-compute-engine-oslogin_20171025+dfsg1-0ubuntu1~17.04.0_amd64.deb (--unpack):
 there is no script in the new version of the package - giving up
Activating Google Compute Engine OS Login.
cp: cannot stat '/etc/ssh/sshd_config': No such file or directory
sed: can't read /etc/ssh/sshd_config.new: No such file or directory
sed: can't read /etc/ssh/sshd_config.new: No such file or directory
sed: can't read /etc/ssh/sshd_config.new: No such file or directory
mv: cannot stat '/etc/ssh/sshd_config.new': No such file or directory
cp: cannot stat '/etc/pam.d/sshd': No such file or directory
sed: can't read /etc/pam.d/sshd.new: No such file or directory
sed: can't read /etc/pam.d/sshd.new: No such file or directory
sed: can't read /etc/pam.d/sshd.new: No such file or directory
sed: can't read /etc/pam.d/sshd.new: No such file or directory
mv: cannot stat '/etc/pam.d/sshd.new': No such file or directory
*** Error in `/usr/bin/dpkg': munmap_chunk(): invalid pointer: 0x00005642d895b186 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7908b)[0x7ff1f746e08b]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x1f8)[0x7ff1f747bed8]
/usr/bin/dpkg(+0x20cd0)[0x5642d6d78cd0]
/usr/bin/dpkg(+0x21119)[0x5642d6d79119]
/usr/bin/dpkg(+0x283cd)[0x5642d6d803cd]
/usr/bin/dpkg(+0x17737)[0x5642d6d6f737]
/usr/bin/dpkg(+0x17915)[0x5642d6d6f915]
/usr/bin/dpkg(+0x17b5d)[0x5642d6d6fb5d]
/usr/bin/dpkg(+0xaed7)[0x5642d6d62ed7]
/usr/bin/dpkg(+0x20c0b)[0x5642d6d78c0b]
/usr/bin/dpkg(+0x20e01)[0x5642d6d78e01]
/usr/bin/dpkg(+0xa962)[0x5642d6d62962]
/usr/bin/dpkg(+0x72fd)[0x5642d6d5f2fd]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0x7ff1f...

Read more...

tags: added: verification-done verification-done-artful verification-done-xenial verification-done-zesty
removed: verification-needed verification-needed-artful verification-needed-xenial verification-needed-zesty
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

When verifying SRU fixes it is required to give some details about the testing performed, at least which package versions have been performed. Also, I see you mentioned a dpkg crash during package upgrade but still marked is as verified - is it not reproducible? Does that happen for other packages as well? Is the package still usable after such a crash?

Revision history for this message
Balint Reczey (rbalint) wrote :

I executed the tests the way it was written in the test steps, using 20170718-0ubuntu1(~*) on each release.
I observed the crash only with the _unfixed_ 20170718-0ubuntu1(~*) version in step 4.a, where I upgraded to latest unfixed version. I'm attaching the log of the reproduction soon.

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

This bug was fixed in the package gce-compute-image-packages - 20171129+dfsg1-0ubuntu1~17.10.0

---------------
gce-compute-image-packages (20171129+dfsg1-0ubuntu1~17.10.0) artful; urgency=medium

  [ Balint Reczey ]
  * Add minimal debian/google-compute-engine-oslogin.prerm to fix upgrades
    (LP: #1733878)
  * New upstream version 20171129+dfsg1
    - Generate SSH host keys when none are present.
    - Improve logging when activating OS Login.
    - Fix parsing logic for expiration time on SSH public keys.
    - Fix home directory creation PAM config.
  * Update symlink to shared library with updated revision
  * Use -I/usr/include/json-c for building tests
  * Backport to Artful (LP: #1735793)

  [ Ludovic Gasc ]
  * Add systemd as valid ntp daemon

 -- Balint Reczey <email address hidden> Fri, 01 Dec 2017 19:40:05 +0100

Changed in gce-compute-image-packages (Ubuntu Artful):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for gce-compute-image-packages 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 regressions.

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

This bug was fixed in the package gce-compute-image-packages - 20171129+dfsg1-0ubuntu1~17.04.0

---------------
gce-compute-image-packages (20171129+dfsg1-0ubuntu1~17.04.0) zesty; urgency=medium

  [ Balint Reczey ]
  * Add minimal debian/google-compute-engine-oslogin.prerm to fix upgrades
    (LP: #1733878)
  * New upstream version 20171129+dfsg1
    - Generate SSH host keys when none are present.
    - Improve logging when activating OS Login.
    - Fix parsing logic for expiration time on SSH public keys.
    - Fix home directory creation PAM config.
  * Update symlink to shared library with updated revision
  * Use -I/usr/include/json-c for building tests
  * Backport to Zesty (LP: #1735793)

  [ Ludovic Gasc ]
  * Add systemd as valid ntp daemon

 -- Balint Reczey <email address hidden> Tue, 05 Dec 2017 14:06:17 +0100

Changed in gce-compute-image-packages (Ubuntu Zesty):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gce-compute-image-packages - 20171129+dfsg1-0ubuntu1~16.04.0

---------------
gce-compute-image-packages (20171129+dfsg1-0ubuntu1~16.04.0) xenial; urgency=medium

  [ Balint Reczey ]
  * Add minimal debian/google-compute-engine-oslogin.prerm to fix upgrades
    (LP: #1733878)
  * New upstream version 20171129+dfsg1
    - Generate SSH host keys when none are present.
    - Improve logging when activating OS Login.
    - Fix parsing logic for expiration time on SSH public keys.
    - Fix home directory creation PAM config.
  * Update symlink to shared library with updated revision
  * Use -I/usr/include/json-c for building tests
  * Backport to Xenial (LP: #1735793)

  [ Ludovic Gasc ]
  * Add systemd as valid ntp daemon

 -- Balint Reczey <email address hidden> Tue, 05 Dec 2017 14:11:20 +0100

Changed in gce-compute-image-packages (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gce-compute-image-packages - 20171129+dfsg1-0ubuntu1~14.04.0

---------------
gce-compute-image-packages (20171129+dfsg1-0ubuntu1~14.04.0) trusty; urgency=medium

  [ Balint Reczey ]
  * Add minimal debian/google-compute-engine-oslogin.prerm to fix upgrades
    (LP: #1733878)
  * New upstream version 20171129+dfsg1
    - Generate SSH host keys when none are present.
    - Improve logging when activating OS Login.
    - Fix parsing logic for expiration time on SSH public keys.
    - Fix home directory creation PAM config.
  * Update symlink to shared library with updated revision
  * Use -I/usr/include/json-c for building tests
  * Backport to Trusty (LP: #1735793)
    - Retain the delta between devel and trusty as those are necessary for the
      package to build and work.
    - Revert adding systemd as valid ntp daemon

  [ Ludovic Gasc ]
  * Add systemd as valid ntp daemon

 -- Balint Reczey <email address hidden> Tue, 05 Dec 2017 14:16:22 +0100

Changed in gce-compute-image-packages (Ubuntu Trusty):
status: Fix Committed → Fix Released
Revision history for this message
Balint Reczey (rbalint) wrote :

The steps I used for reproducing the issue and testing the fix on zesty (and on other releases with the proper package versions):

lxc launch ubuntu:17.04 z-test-gce
lxc exec z-test-gce -- wget http://launchpadlibrarian.net/330841798/google-compute-engine-oslogin_20170718-0ubuntu1~17.04.0_amd64.deb
lxc exec z-test-gce -- dpkg -i google-compute-engine-oslogin_20170718-0ubuntu1~17.04.0_amd64.deb
lxc exec z-test-gce -- apt-get purge -y openssh-server
lxc exec z-test-gce -- apt-get update
# this step will fail as long as the fixed version is not in release
lxc exec z-test-gce -- apt-get install -y google-compute-engine-oslogin
lxc exec z-test-gce -- bash -c "echo 'deb http://archive.ubuntu.com/ubuntu zesty-proposed main restricted universe multiverse' >> /etc/apt/sources.list"
lxc exec z-test-gce -- apt-get update
lxc exec z-test-gce -- apt-get install -y google-compute-engine-oslogin
lxc exec z-test-gce -- dpkg --configure -a
lxc exec z-test-gce -- apt-get install -y google-compute-engine-oslogin

tags: added: id-5a1deea9adadd3374070c05b
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.