postinst script fails if data_path not set in client.conf

Bug #1728681 reported by Kellen Renshaw on 2017-10-30
26
This bug affects 4 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
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