gconf_resource throws an exception if gconftool-2 is not found

Bug #832321 reported by Daniel Manrique
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Checkbox
Fix Released
Medium
Brendan Donegan
checkbox (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

The following job defined in jobs/resource.txt fails with an exception on Oneiric server systems that don't have gconf2 installed:

name: gconf
plugin: resource
command: gconf_resource | filter_templates -w 'name=.*proxy.*'

If run through checkbox, this results in the following exception dump:
2011-08-22 11:39:39,180 INFO Running command: gconf_resource | filter_templates -w 'name=.*proxy.*'
2011-08-22 11:39:39,251 DEBUG Started firing message-result.
2011-08-22 11:39:39,251 DEBUG Calling /usr/share/checkbox/plugins/message_info.py MessageInfo.message_result(pass, /bin/sh: gconfto
ol-2: not found
, 0.0698437690735) for message-result with priority 0.
2011-08-22 11:39:39,252 DEBUG Started firing message-file.
2011-08-22 11:39:39,252 DEBUG Calling /usr/share/checkbox/plugins/message_info.py MessageInfo.message_file(<StringIO.StringIO ins
tance at 0x2c86998>) for message-file with priority 0.
2011-08-22 11:39:39,252 ERROR Error running event handler /usr/share/checkbox/plugins/message_info.py MessageInfo.message_file(<StringIO.StringIO instance at 0x2c86998>) for event type 'message-file'
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/checkbox/reactor.py", line 74, in fire
    results.append(handler(*args, **kwargs))
  File "/usr/share/checkbox/plugins/message_info.py", line 86, in message_file
    messages = template.load_file(file, filename)
  File "/usr/lib/python2.7/dist-packages/checkbox/lib/template_i18n.py", line 131, in load_file
    elements = super(TemplateI18n, self).load_file(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/checkbox/lib/template.py", line 132, in load_file
    % (filename, line)
Exception: Template <stream> parse error at: /bin/sh: gconftool-2: not found

Steps to reproduce:

On an Oneiric server system, which doesn't install gconf2 by default :

cd /usr/share/checkbox/scripts

./gconf_resource | ./filter_templates -w 'name=.*proxy.*'

Expected result:
A list of gconf name: and value: pairs

Actual result:

/bin/sh: gconftool-2: not found

Checkbox has problems parsing this, which results in the above error trace.

A possible solution would be to modify gconf_resource so that it outputs nothing if the command can't be run or found. An elegant solution would be to add a requires: package.name == 'gconf2' to the job definition, but requires (I think) aren't checked at this point during the gathering phase.

Related branches

Ara Pulido (ara)
Changed in checkbox:
assignee: nobody → Canonical Hardware Certification (canonical-hw-cert)
importance: Undecided → Medium
milestone: none → 0.12.5
status: New → Triaged
Ara Pulido (ara)
Changed in checkbox:
milestone: 0.12.5 → 0.12.6
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Working on this - just getting setup to reproduce the problem now.

Changed in checkbox:
assignee: Canonical Hardware Certification (canonical-hw-cert) → Brendan Donegan (brendan-donegan)
status: Triaged → In Progress
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

How is this bug possible? Checkbox depends on gconf2. Under what circumstances is it not installed?

Revision history for this message
Jeff Lane  (bladernr) wrote : Re: [Bug 832321] Re: gconf_resource throws an exception if gconftool-2 is not found

On 09/07/2011 06:23 AM, Brendan Donegan wrote:
> How is this bug possible? Checkbox depends on gconf2. Under what
> circumstances is it not installed?
>

Are you sure about that? For Oneiric, which the bug was opened about:

bladernr@klaatu:~/development/checkbox$ grep -i gconf debian/control;
echo $?
1

and looking in debian/control

Package: checkbox
Section: python
Architecture: all
Replaces: hwtest (<< 0.1-0ubuntu12)
Provides: hwtest
Depends: ${misc:Depends}, ${python:Depends}, debconf, udev
Recommends: dpkg (>= 1.13), lsb-release, pm-utils, python-apport,
python-apt, python-dateutil, python-gst0.10
Suggests: checkbox-cli | checkbox-gtk, bonnie++, bootchart, bzr, cvs,
ethtool, flex, fwts, git-core, hdparm, lshw, make, nmap, obexd-client,
python-pexpect, smartmontools, sox, stress, wodim
Conflicts: hwtest (<< 0.1-0ubuntu12)

Package: checkbox-cli
Architecture: all
Replaces: hwtest-cli (<< 0.1-0ubuntu12)
Provides: hwtest-cli
Depends: checkbox (= ${source:Version})
Conflicts: hwtest-cli (<< 0.1-0ubuntu12)

Package: checkbox-gtk
Section: gnome
Architecture: all
Replaces: hwtest-gtk (<< 0.1-0ubuntu12)
Provides: hwtest-gtk
Depends: checkbox (= ${source:Version}), gksu, python-gobject (>= 2.28),
gir1.2-gtk-3.0
Conflicts: hwtest-gtk (<< 0.1-0ubuntu12)

Same with checkbox 0.11.

And current checkbox-certification.

Perhaps we just assumed gconf2 was installed as it was previously part
of Main and installed by default?

bladernr@klaatu:~/development/checkbox-certification$ apt-cache policy
gconf2
gconf2:
   Installed: 2.32.2-0ubuntu2
   Candidate: 2.32.2-0ubuntu2
   Version table:
  *** 2.32.2-0ubuntu2 0
         500 http://us.archive.ubuntu.com/ubuntu/ natty/main amd64 Packages
         100 /var/lib/dpkg/status

Thats from my Natty system.

--
Jeff Lane - Hardware Certification Engineer and Test Tools Developer
Ubuntu Ham: W4KDH
Freenode IRC: bladernr or bladernr_
gpg: 1024D/3A14B2DD 8C88 B076 0DD7 B404 1417 C466 4ABD 3635 3A14 B2DD

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

What I really meant was that if you install checkbox on a non-Gtk system (e.g. Kubuntu) then it installs gconf2, so it indirectly depends on it. I'm just trying to understand where this bug is.

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Redirecting STDERR to PIPE in gconf_resource does the trick of avoiding the 'gconftool-2 not found' error being output. Second best solution (nicer would be to allow requires in resource jobs), but does the job.

Marc Tardif (cr3)
Changed in checkbox:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package checkbox - 0.12.7

---------------
checkbox (0.12.7) oneiric; urgency=low

  New upstream release (LP: #850395):

  [Brendan Donegan]
  * Redirecting stderr to pipe to fix the gconf_resource script (LP: #832321)
  * Clear jobs directory when user selects No to recover question (LP: #836623)

  [Daniel Manrique]
  * checkbox/job.py: Guard against bogus timeout values (LP: #827859)
  * More explicit handling of string decoding/encoding, avoids problems with
    non-ascii characters (LP: #833747)
  * Changed architecture from all to any for checkbox base, to build
    architecture-specific binaries (LP: #833696)

  [Jeff Lane]
  * Several corrections necessary due to test name changes or typos found in
    job files

  [Marc Tardif]
  * Connecting hyper text widgets only once (LP: #827904)
  * Detecting MMC readers as OTHER instead of DISK (LP: #822948)
  * Validating the hostname in the SSL certificate (LP: #625076)
  * Validating the submission.xml (LP: #838123)
 -- Daniel Manrique <email address hidden> Fri, 14 Sep 2011 17:15:26 -0400

Changed in checkbox (Ubuntu):
status: New → Fix Released
Marc Tardif (cr3)
Changed in checkbox:
status: Fix Committed → Fix Released
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.