gourmet crashed with TypeError in __nonzero__()

Bug #618643 reported by Steve Holmes
134
This bug affects 30 people
Affects Status Importance Assigned to Milestone
Gentoo Linux
Fix Released
Critical
gourmet (Ubuntu)
Fix Released
Undecided
Unassigned
Maverick
Fix Released
High
Steve Langasek

Bug Description

Binary package hint: gourmet

SRU justification: the sqlalchemy API changed between lucid and maverick, and due to a lack of pre-release testing of the gourmet package, gourmet is completely unusable in Ubuntu 10.10. This SRU makes the package usable again.

Regression potential: none; the package currently is unusable.

TEST CASE:
1. try to launch gourmet
2. get a backtrace
3. upgrade to the maverick-proposed version
4. try to launch gourmet again
5. get a window instead of a backtrace

Stack trace:

bouncysteve@sv-eee:~$ /usr/share/gourmet/gourmet/backends/db.py:294: SADeprecationWarning: The Binary type has been renamed to LargeBinary.
  Column('image',Binary(),**{}),
/usr/share/gourmet/gourmet/backends/db.py:295: SADeprecationWarning: The Binary type has been renamed to LargeBinary.
  Column('thumb',Binary(),**{}),
Traceback (most recent call last):
  File "/usr/bin/gourmet", line 35, in <module>
    gourmet.GourmetRecipeManager.startGUI()
  File "/usr/share/gourmet/gourmet/GourmetRecipeManager.py", line 715, in startGUI
    r=RecGui(splash_label=splash.label)
  File "/usr/share/gourmet/gourmet/GourmetRecipeManager.py", line 917, in __init__
    GourmetApplication.__init__(self, splash_label=splash_label)
  File "/usr/share/gourmet/gourmet/GourmetRecipeManager.py", line 114, in __init__
    self.setup_recipes() # Setup recipe database
  File "/usr/share/gourmet/gourmet/GourmetRecipeManager.py", line 204, in setup_recipes
    self.rd = recipeManager.default_rec_manager()
  File "/usr/share/gourmet/gourmet/recipeManager.py", line 131, in default_rec_manager
    return get_recipe_manager(**dbargs)
  File "/usr/share/gourmet/gourmet/recipeManager.py", line 126, in get_recipe_manager
    return RecipeManager(**args)
  File "/usr/share/gourmet/gourmet/backends/db.py", line 1742, in __init__
    self.km = keymanager.get_keymanager(rm=self)
  File "/usr/share/gourmet/gourmet/keymanager.py", line 531, in get_keymanager
    return KeyManager(*args,**kwargs)
  File "/usr/share/gourmet/gourmet/keymanager.py", line 40, in __init__
    self.initialize_categories()
  File "/usr/share/gourmet/gourmet/keymanager.py", line 81, in initialize_categories
    for k in self.rm.get_unique_values('ingkey',self.rm.ingredients_table,deleted=False):
  File "/usr/share/gourmet/gourmet/backends/db.py", line 797, in get_unique_values
    if not table: table=self.recipe_table
  File "/usr/lib/python2.6/dist-packages/sqlalchemy/sql/expression.py", line 1296, in __nonzero__
    raise TypeError("Boolean value of this clause is not defined")
TypeError: Boolean value of this clause is not defined

ProblemType: Crash
DistroRelease: Ubuntu 10.10
Package: gourmet 0.15.4-2ubuntu1
ProcVersionSignature: Ubuntu 2.6.35-14.20-generic 2.6.35
Uname: Linux 2.6.35-14-generic i686
Architecture: i386
Date: Mon Aug 16 13:16:24 2010
EcryptfsInUse: Yes
ExecutablePath: /usr/bin/gourmet
InstallationMedia: Ubuntu-Netbook 10.10 "Maverick Meerkat" - Alpha i386 (20100803.1)
InterpreterPath: /usr/bin/python2.6
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/bin/gourmet
ProcEnviron:
 SHELL=/bin/bash
 LANG=en_GB.utf8
PythonArgs: ['/usr/bin/gourmet']
SourcePackage: gourmet
Title: gourmet crashed with TypeError in __nonzero__()
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare

Revision history for this message
Steve Holmes (bouncysteve) wrote :
description: updated
tags: removed: need-duplicate-check
visibility: private → public
Revision history for this message
Someone561 (someone561) wrote :

I can confirm this bug. On the Gentoo bugzilla is a simple patch for this: http://bugs.gentoo.org/show_bug.cgi?id=317555
Change the in line 797 of /usr/share/gourmet/gourmet/backends/db.py from "not table" to "table is None" fix the Problem.

Changed in gourmet (Ubuntu):
status: New → Confirmed
Revision history for this message
Someone561 (someone561) wrote :
Revision history for this message
Someone561 (someone561) wrote :
Changed in gentoo:
status: Unknown → Fix Released
Revision history for this message
Stefano Rivera (stefanor) wrote :

I see there's a newer version of gourmet in Debian which already fixes this. I'll look at a merge...

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

This bug was fixed in the package gourmet - 0.15.6-1ubuntu1

---------------
gourmet (0.15.6-1ubuntu1) natty; urgency=low

  * Merge from Debian unstable (LP: #618643), remaining changes:
    - debian/patches/03_dont_remove_nonexistent_plugin.patch: don't remove an
      inactive plugin in plugin_loader.py and don't deactivate a plugin from a
      non-existent database
  * Dropped changes, superseded in Debian:
    - debian/control:
      + Recommend python-gtkspell for printing
    - debian/patches/01_fix_raise_str.patch: don't raise str exception
      in src/lib/plugin_gui.py
    - Don't set debian/pyversions to 2.5, this is obviously wrong.

gourmet (0.15.6-1) unstable; urgency=low

  * New upstream release.
  * Removed 02_sqlalchemy-bug patch included upstream.

gourmet (0.15.5-2) unstable; urgency=low

  * Patch from upstream git to fix a sqlalchemy bug (Ctrl+Q doesn't work).

gourmet (0.15.5-1) unstable; urgency=low

  * New upstream release.
  * Removed 02_sqlalchemy patch included upstream.
  * Bump Standards-Version to 3.9.0 (no changes).

gourmet (0.15.4-4) unstable; urgency=low

  * New patch (02_sqlalchemy) from upstream git to fix sqlalchemy 0.6 bugs
    (Closes: #585009 #585093).
  * Added python-gtkspell in recommends. Thsi package is needed if the
    spellcheck plugin is enabled. (Closes: #586881).
  * Seems to works with python-pysqlite2 and thus remove the conflicts for
    this package (Closes: #586880).

gourmet (0.15.4-3) unstable; urgency=low

  * Don't set a python version in debian/pyversions (Closes: 584834).
  * Don't raise str exception in src/lib/plugin_gui.py (Closes: 584833)
    thanks to Steve Langasek for the patch.
 -- Stefano Rivera <email address hidden> Sun, 17 Oct 2010 20:26:17 +0200

Changed in gourmet (Ubuntu):
status: Confirmed → Fix Released
Steve Langasek (vorlon)
Changed in gourmet (Ubuntu Maverick):
status: New → Triaged
importance: Undecided → High
assignee: nobody → Steve Langasek (vorlon)
Revision history for this message
Magnus (koma-lysator) wrote :

Does anyone know of a PPA (or something) that we can use until the fixed package is in the official repositories?

Revision history for this message
Someone561 (someone561) wrote :

Yes, I have build a ppa with gourmet taken from natty: https://launchpad.net/~someone561/+archive/gourmet

Revision history for this message
Magnus (koma-lysator) wrote :

Thanks, works like a charm!

Revision history for this message
Shawn Sonnema (pumpkinson) wrote :

Still waiting for the fix... here's the official PPA linked from the Gourmet site:

https://launchpad.net/~thomas-hinkle/+archive/gourmet

Steve Langasek (vorlon)
Changed in gourmet (Ubuntu Maverick):
status: Triaged → In Progress
Steve Langasek (vorlon)
description: updated
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted gourmet into maverick-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in gourmet (Ubuntu Maverick):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Tomas Cassidy (tomas-cassidy) wrote :

Error when closing gourmet (maverick-proposed):

Ignoring sqlalchemy problem
Traceback (most recent call last):
  File "/usr/share/gourmet/gourmet/backends/db.py", line 223, in save
    self.db.commit()
  File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/threadlocal.py", line 78, in commit
    trans = self._connections.trans.pop(-1)
IndexError: pop from empty list

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 618643] Re: gourmet crashed with TypeError in __nonzero__()

On Tue, Jan 25, 2011 at 12:01:02PM -0000, Tomas Cassidy wrote:
> Error when closing gourmet (maverick-proposed):

> Ignoring sqlalchemy problem
> Traceback (most recent call last):
> File "/usr/share/gourmet/gourmet/backends/db.py", line 223, in save
> self.db.commit()
> File "/usr/lib/python2.6/dist-packages/sqlalchemy/engine/threadlocal.py", line 78, in commit
> trans = self._connections.trans.pop(-1)
> IndexError: pop from empty list

This is the expected behavior; note that it says 'Ignoring sqlalchemy
problem' at the top. Indeed, this is the *improved* behavior resulting from
the second patch mentioned in the changelog - without that patch, this would
be a crash rather than merely a backtrace message, and the crash also will
happen mid-execution (not just at shutdown) due to autosave support.

So I would call this a successful verification.

Thanks,
--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
<email address hidden> <email address hidden>

Revision history for this message
dunc (duncansimons) wrote :

thanks to all it now works on my machine I'm newish to this operating system but am getting there slowly I have it installed alongside windows 7 via the wubi installer which I made and ISO disc from after many nightmares and disasters trying to download it from the site.Maybe one day I'll go the whole hog and ditch Windows but not yet.
Dunc
l

Steve Langasek (vorlon)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gourmet - 0.15.4-2ubuntu1.1

---------------
gourmet (0.15.4-2ubuntu1.1) maverick-proposed; urgency=low

  * Grab patch 02_sqlalchemy from Debian: backport fix from upstream git
    for compatibility with sqlalchemy 0.6. LP: #618643.
  * 02_sqlalchemy-bug: further patch from upstream git to fix a sqlalchemy
    bug (Ctrl+Q doesn't work).
 -- Steve Langasek <email address hidden> Fri, 21 Jan 2011 16:01:37 -0800

Changed in gourmet (Ubuntu Maverick):
status: Fix Committed → Fix Released
Changed in gentoo:
importance: Unknown → Critical
tags: added: testcase
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.