crashes on startup, Ubuntu 12.04, TypeError on pantry

Bug #1010659 reported by Alan Jackson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gourmet
Fix Released
Undecided
Unassigned

Bug Description

New install of Ubuntu 12.04, database loaded from another machine with an older version.
Gourmet 0.15.9-1

~$ gourmet
sqlite:////home/ajackson/.gourmet/recipes.db
TRYING TO GET ingkey pantry from pantry
ERROR!!!
Traceback (most recent call last):
  File "/usr/share/gourmet/gourmet/backends/db.py", line 2027, in items
    val = getattr(i,self.vp)
TypeError: an integer is required
IGNORING
TRYING TO GET ingkey pantry from pantry
ERROR!!!
Traceback (most recent call last):
  File "/usr/share/gourmet/gourmet/backends/db.py", line 2027, in items
    val = getattr(i,self.vp)
TypeError: an integer is required
IGNORING
TRYING TO GET ingkey pantry from pantry
.......
ERROR!!!
Traceback (most recent call last):
  File "/usr/share/gourmet/gourmet/backends/db.py", line 2027, in items
    val = getattr(i,self.vp)
TypeError: an integer is required
IGNORING
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 918, in __init__
    GourmetApplication.__init__(self, splash_label=splash_label)
  File "/usr/share/gourmet/gourmet/GourmetRecipeManager.py", line 116, in __init__
    self.setup_shopping()
  File "/usr/share/gourmet/gourmet/GourmetRecipeManager.py", line 228, in setup_shopping
    self.sl = shopgui.ShopGui()
  File "/usr/share/gourmet/gourmet/shopgui.py", line 540, in __init__
    ShoppingList.__init__(self)
  File "/usr/share/gourmet/gourmet/shopping.py", line 266, in __init__
    self.data,self.pantry=self.grabIngsFromRecs([])
  File "/usr/share/gourmet/gourmet/shopping.py", line 282, in grabIngsFromRecs
    return self.organize_list(self.lst)
  File "/usr/share/gourmet/gourmet/shopping.py", line 285, in organize_list
    self.sh = self.get_shopper(lst)
  File "/usr/share/gourmet/gourmet/shopgui.py", line 572, in get_shopper
    return recipeManager.DatabaseShopper(lst, self.rd)
  File "/usr/share/gourmet/gourmet/recipeManager.py", line 25, in __init__
    shopping.Shopper.__init__(self,lst)
  File "/usr/share/gourmet/gourmet/shopping.py", line 23, in __init__
    self.init_pantry()
  File "/usr/share/gourmet/gourmet/recipeManager.py", line 56, in init_pantry
    self.pantry.initialize(dict([(i,True) for i in self.default_pantry]))
  File "/usr/share/gourmet/gourmet/backends/db.py", line 2006, in initialize
    self.vw.insert().execute(*dics)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/expression.py", line 2734, in execute
    return e._execute_clauseelement(self, multiparams, params)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 2304, in _execute_clauseelement
    return connection._execute_clauseelement(elem, multiparams, params)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1538, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1646, in _execute_context
    context)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1633, in _execute_context
    context)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 327, in do_executemany
    cursor.executemany(statement, parameters)
sqlalchemy.exc.IntegrityError: (IntegrityError) column ingkey is not unique u'INSERT INTO pantry (ingkey, pantry) VALUES (?, ?)' ((u'oil, olive', 1), (u'black pepper, ground', 1), (u'flour, all purpose', 1), (u'ice', 1), (u'sugar', 1), (u'water', 1), (u'oil, vegetable', 1), (u'salt', 1))

Revision history for this message
Alan Jackson (alan-ajackson) wrote :

Fixed. I installed sqlitebrowser and hand edited the database. In the pantry table the ing column had the text values ("butter") instead of an integer index, so I just deleted every record in the pantry. That allows the s/w to start up.

Revision history for this message
Bernhard Reiter (ockham-razor) wrote :

I believe this issue is fixed in Gourmet 0.16.0 -- please give it a try!

Changed in gourmet:
status: New → Fix Released
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.