Gourmet Recipe Manager won't open

Asked by Tema

I seem to have an error that I don't know how to fix. Every time I start to open Gourmet, the program starts and then never opens. Here is a copy of the terminal in Ubuntu 12.04. I have very little experience using the command line so please assume I am dumb as a rock. I would just remove and install a new version, but I don't know if I will lose my recipes. If I can save them some how, that's what I will do. Thanks for the help, Tema

Tema:~$ gourmet
Attempting to alter usda_weights <bound method NutritionDataPlugin.setup_usda_weights_table of <nutritional_information.data_plugin.NutritionDataPlugin instance at 0x9bedfec>> {} ['ndbno', 'seq', 'amount', 'unit', 'gramwt', 'ndata', 'stdev']
Traceback (most recent call last):
  File "/usr/share/gourmet/gourmet/backends/db.py", line 931, in alter_table
    self.db.execute('ALTER TABLE %(t)s RENAME TO %(t)s_temp'%{'t':table_name})
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 2297, in execute
    return connection.execute(statement, *multiparams, **params)
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1405, in execute
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1582, in _execute_text
    statement, parameters
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1646, in _execute_context
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1639, in _execute_context
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 330, in do_execute
    cursor.execute(statement, parameters)
OperationalError: (OperationalError) there is already another table or index with this name: usda_weights_temp 'ALTER TABLE usda_weights RENAME TO usda_weights_temp' ()
Problem updating plugin <nutritional_information.data_plugin.NutritionDataPlugin instance at 0x9bedfec> nutritondata
Traceback (most recent call last):
  File "/usr/bin/gourmet", line 35, in <module>
  File "/usr/share/gourmet/gourmet/GourmetRecipeManager.py", line 715, in startGUI
  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 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 1769, in __init__
  File "/usr/share/gourmet/gourmet/backends/db.py", line 165, in __init__
  File "/usr/share/gourmet/gourmet/backends/db.py", line 598, in update_version_info
  File "/usr/share/gourmet/gourmet/backends/db.py", line 640, in update_plugin_version
    plugin_current = plugin.version,
  File "/usr/share/gourmet/gourmet/plugins/nutritional_information/data_plugin.py", line 68, in update_version
    [name for lname,name,typ in parser_data.WEIGHT_FIELDS])
  File "/usr/share/gourmet/gourmet/backends/db.py", line 944, in alter_table
    del self.metadata.tables[table_name]
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/util/_collections.py", line 38, in _immutable
    raise TypeError("%s object is immutable" % self.__class__.__name__)
TypeError: immutabledict object is immutable

Question information

English Edit question
Ubuntu gourmet Edit question
No assignee Edit question
Solved by:
Manfred Hampl
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Tema (tkellstrom) said :

I still would like to get to my recipes..... help

Revision history for this message
Best Manfred Hampl (m-hampl) said :

Googling for the error message brings up a bug report https://bugs.launchpad.net/ubuntu/+source/gourmet/+bug/944464 with a proposed workaround

In /usr/share/gourmet/gourmet/backends/db.py
replace line 944 or so (mentioned in traceback)
    del self.metadata.tables[table_name]
    self.metadata._remove_table(table_name, self.metadata.schema)

(disclaimer: no warranty, have not tried that myself!)

Revision history for this message
Tema (tkellstrom) said :

Thanks Manfred Hampl, that solved my question.