postinst script fails if data_path not set in client.conf

Bug #1728681 reported by Kellen Renshaw on 2017-10-30
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Landscape Client
Low
Simon Poirier
landscape-client (Ubuntu)
Low
Unassigned
Xenial
Undecided
Unassigned
Bionic
Undecided
Unassigned
Disco
Undecided
Unassigned

Bug Description

[Impact]

 * Manually editing landscape client.conf to unset the data_path
   blocks upgrade postinst. That field was not required to be present
   before 14.04, and older configurations can fail to upgrade without
   purging the existing configuration.

 * Although data_path is set by default, removing the line is accepted
   by landscape and it will use a default path. The fix simply makes sure
   the postinst script also has that default.

[Test Case]

 * sed -i -e '/data_path/d' /etc/landscape/client.conf

 * apt install --reinstall landscape-client

[Regression Potential]

 * The change is fairly trivial. Regression could be possible if the
   default paths were changed and not reflected in the postinst.
   In such a case the resync flag file wouldn't be created,
   resulting in an out-of-sync list of users; this would be low impact.

[Original Description]

Tested on 14.04.5, landscape-client (14.12-0ubuntu6.14.04).

If the data_path directive is not present in /etc/landscape/client.conf, the postinst script will fail with the following error:
Setting up landscape-client (14.12-0ubuntu6.14.04) ...
install: missing file operand
Try 'install --help' for more information.
dpkg: error processing package landscape-client (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 landscape-client
E: Sub-process /usr/bin/dpkg returned an error code (1)

Relevant section of the postinst script:
 # In response to bug 1508110 we need to trigger a complete update of
        # user information. The flag file will be removed by the client when
        # the update completes.
        DATA_PATH="`grep ^data_path /etc/landscape/client.conf | cut -d= -f2 | tr -d '[[:space:]]'`"
        install --owner=landscape --directory $DATA_PATH
        USER_UPDATE_FLAG_FILE="$DATA_PATH/user-update-flag"
        install --owner=landscape /dev/null $USER_UPDATE_FLAG_FILE

It would be helpful if the script checked for data_path's existence and emitted a more informative error message.

How to reproduce:

Install/configure/register landscape-client.
Remove landscape-client
Remove data_path from /etc/landscape/client.conf
Reinstall landscape-client.

Related branches

tags: added: sts
Andreas Hasenack (ahasenack) wrote :

Do you have any idea how the config file ended up missing that configuration key? Just trying to gauge how frequent this is (hint: it's the fist time I saw this)

Kellen Renshaw (krenshaw) wrote :

Hello Andreas,

Currently, I suspect that it was removed (on purpose or not) manually. My default client.conf contains it. I will attempt to get more information on how/why that change was made.

Launchpad Janitor (janitor) wrote :

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

Changed in landscape-client (Ubuntu):
status: New → Confirmed
Changed in landscape-client (Ubuntu):
importance: Undecided → Low
Changed in landscape-client:
status: New → Triaged
importance: Undecided → Critical
importance: Critical → Low
Simon Poirier (simpoir) on 2019-05-21
Changed in landscape-client:
status: Triaged → Confirmed
Simon Poirier (simpoir) on 2019-05-24
Changed in landscape-client:
assignee: nobody → Simon Poirier (simpoir)
Simon Poirier (simpoir) on 2019-05-24
Changed in landscape-client:
status: Confirmed → In Progress
Simon Poirier (simpoir) on 2019-06-18
description: updated
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package landscape-client - 18.01-0ubuntu9

---------------
landscape-client (18.01-0ubuntu9) eoan; urgency=medium

  * d/p/product-name-vminfo-1828217.patch: Add product_name to things scanned
    for vm_info (LP: #1828217)
  * d/landscape-client.postinst: Set default value if data_path is
    missing. (LP: #1728681)
  * d/p/stagger-launch-1788518.patch: Add option to stagger launch of broker
    plugins. (LP: #1788518)
  * d/landscape-client.init: Fix init script stop action (LP: #1833137)

 -- Simon Poirier <email address hidden> Fri, 14 Jun 2019 17:29:07 -0400

Changed in landscape-client (Ubuntu):
status: Confirmed → Fix Released

Hello Kellen, or anyone else affected,

Accepted landscape-client into disco-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/landscape-client/18.01-0ubuntu7.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 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-disco to verification-done-disco. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-disco. In either case, without details of your testing we will not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in landscape-client (Ubuntu Disco):
status: New → Fix Committed
tags: added: verification-needed verification-needed-disco
Brian Murray (brian-murray) wrote :

Hello Kellen, or anyone else affected,

Accepted landscape-client into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/landscape-client/18.01-0ubuntu3.4 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-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in landscape-client (Ubuntu Bionic):
status: New → Fix Committed
tags: added: verification-needed-bionic
Simon Poirier (simpoir) wrote :

I verified upgrading to the -proposed packages without data_path on bionic and disco.
They installed and upgraded cleanly with the new version.

tags: added: verification-done-bionic verification-done-disco
removed: verification-needed-bionic verification-needed-disco
Brian Murray (brian-murray) wrote :

Hello Kellen, or anyone else affected,

Accepted landscape-client into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/landscape-client/16.03-0ubuntu2.16.04.7 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, without details of your testing we will not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in landscape-client (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed-xenial
tags: added: verification-done-xenial
removed: verification-needed-xenial

The verification of the Stable Release Update for landscape-client 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.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package landscape-client - 18.01-0ubuntu3.4

---------------
landscape-client (18.01-0ubuntu3.4) bionic; urgency=medium

  * d/p/product-name-vminfo-1828217.patch: Add product_name to things scanned
    for vm_info (LP: #1828217)
  * d/landscape-client.postinst: Set default value if data_path is
    missing. (LP: #1728681)
  * d/p/stagger-launch-1788518.patch: Add option to stagger launch of broker
    plugins. (LP: #1788518)
  * d/landscape-client.init: Fix init script stop action (LP: #1833137)

 -- Simon Poirier <email address hidden> Thu, 27 Jun 2019 11:07:30 -0400

Changed in landscape-client (Ubuntu Bionic):
status: Fix Committed → Fix Released
Łukasz Zemczak (sil2100) wrote :

Please include some more information when changing the verification tags (for xenial here). What versions have been used for the verification? Was the test case followed correctly?

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package landscape-client - 18.01-0ubuntu7.1

---------------
landscape-client (18.01-0ubuntu7.1) disco; urgency=medium

  * d/p/product-name-vminfo-1828217.patch: Add product_name to things scanned
    for vm_info (LP: #1828217)
  * d/landscape-client.postinst: Set default value if data_path is
    missing. (LP: #1728681)
  * d/p/stagger-launch-1788518.patch: Add option to stagger launch of broker
    plugins. (LP: #1788518)
  * d/landscape-client.init: Fix init script stop action (LP: #1833137)

 -- Simon Poirier <email address hidden> Thu, 27 Jun 2019 11:07:30 -0400

Changed in landscape-client (Ubuntu Disco):
status: Fix Committed → Fix Released
Robie Basak (racb) wrote :

Marking Incomplete pending an answer to Łukasz's comment 11.

Changed in landscape-client (Ubuntu Xenial):
status: Fix Committed → Incomplete
Simon Poirier (simpoir) wrote :

I've just verified this on xenial, with the package from xenial-proposed 16.03-0ubuntu2.16.04.7

I followed the above test case without any issue.

Changed in landscape-client (Ubuntu Xenial):
status: Incomplete → Fix Committed
tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package landscape-client - 16.03-0ubuntu2.16.04.7

---------------
landscape-client (16.03-0ubuntu2.16.04.7) xenial; urgency=medium

  * d/p/product-name-vminfo-1828217.patch: Add product_name to things scanned
    for vm_info (LP: #1828217)
  * d/landscape-client.postinst: Set default value if data_path is
    missing. (LP: #1728681)
  * d/p/stagger-launch-1788518.patch: Add option to stagger launch of broker
    plugins. (LP: #1788518)
  * d/landscape-client.init: Fix init script stop action (LP: #1833137)

 -- Simon Poirier <email address hidden> Fri, 28 Jun 2019 12:18:32 -0400

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

Duplicates of this bug

Other bug subscribers