postinst package error: landscape-config: error: option --exchange-interval: invalid integer value: ''

Bug #932677 reported by Andreas Hasenack
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Landscape Client
Invalid
High
Jerry Seutter

Bug Description

Setting up landscape-client (11.11~bzr456-0ubuntu0~precise1) ...
Usage: landscape-config [options]

landscape-config: error: option --exchange-interval: invalid integer value: ''
dpkg: error processing landscape-client (--configure):
 subprocess installed post-installation script returned error exit status 2
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 landscape-client
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@nsn7:~#

Related branches

Jerry Seutter (jseutter)
Changed in landscape-client:
assignee: nobody → Jerry Seutter (jseutter)
Revision history for this message
Free Ekanayaka (free.ekanayaka) wrote :

After some investigation, I believe the problem is that we added some new entries to landscape-client.templates, which are not there in the released version of landscape-client. Apparently when you upgrade the released version to this new one, these new entries don't really get picked by landscape-client.postinst, in particular there won't be the default "900" value for exchange_interval, hence breaking landscape-config.

After looking at:

http://www.debian.org/doc/debian-policy/ap-pkg-conffiles.html

and

http://www.debian.org/doc/debian-policy/ch-binary.html#s-maintscriptprompt

I think what we are doing is basically good, however I'd suggest to make it so that we don't always blindly re-write an existing landscape.conf file in landscape-client.postinst, but we just do it if we actually notice that there are some changes. So that means either we are shipping in the new version some new conf values that *must* be in the landscape.conf file (very rare situation, probably never happened), or the user is running dpkg-reconfigure (the common use case).

We might also consider adding something like:

###################################################
# This file is managed by debconf, DO NOT EDIT IT MANUALLY, please run
# dpkg-reconfigure landscape-client instead
###################################################

to the auto-generated landscape.conf, as it seems to be an established practice.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

We need to remember about debconf now everytime a new setting is introduced.

Revision history for this message
Jerry Seutter (jseutter) wrote :

This is a valid setting in the config file:

exchange_interval =

However, if you parse the config file and try passing the value (empty string) to landscape-config on the command line, it will cause landscape-config to have an error.

root@ip-10-126-51-3:~# landscape-config --exchange-interval ""
Usage: landscape-config [options]

landscape-config: error: option --exchange-interval: invalid integer value: ''

At this point, if using dpkg-reconfigure, client.conf will be left in a half-written state and the package will be broken until you either reinstall or dpkg-reconfigure --force.

This does not happen with most other settings. The following command line works just fine:

landscape-config --computer-title "" --account-name "" --registration-password "" --http-proxy "" --https-proxy "" --silent --no-start

I am thinking the way to fix this is to fix the landscape-config command line parsing. Once this is done, the valid empty string in debconf will not cause an issue. This type of error can happen for the three integer arguments landscape-config accepts - exchange-interval, urgent-exchange-interval and ping-interval. I think these settings were added recently because of load testing.

Jerry Seutter (jseutter)
Changed in landscape-client:
status: New → In Progress
milestone: later → 12.02.2
Revision history for this message
Jerry Seutter (jseutter) wrote :

This bug was triggered due to a problem with an unreleased version of landscape-client. Won't fix.

Changed in landscape-client:
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.