Upgrade lost Ingredients

Help
Ed Wood
2008-10-24
2013-05-14
  • Ed Wood
    Ed Wood
    2008-10-24

    Upgraded Ubuntu 8.04 to Ubuntu 8.10rc and when I started Gourmet the first time it had error message " Cannot connect to Database ".
    Restarted Gourmet and it connected to database but none of the recipes show anything in the Ingredients pane. I ran sqlite3 PRAGMA integrity_check on the recipe.db file and it gave ok as result but still no Ingredients. I replaced recipe.db with a backup copy with same results. Also just realized that the Nutritional information is missing.
    The Gourmet version is now .14.0

     
    • tom
      tom
      2008-10-25

      This sounds like I bug I've also experienced -- you might have luck with the CVS version. It's handy that you've got a backup database -- I assume you can reproduce the problem then? If so, can you e-mail me a copy of your original database so I can see if I can reproduce your problem? E-mail to thomas_hinkle@users.sourceforge.net

       
    • Ed Wood
      Ed Wood
      2008-10-25

      Got the CVS version. It didn't help. I sent my recipe.db file to address you listed.
      Thank you for responding. I wonder if going back to 0.13.8 would help?

       
    • Jonathan Daley
      Jonathan Daley
      2008-10-26

      me too, though I am on debian.  0.14.0-1.
      I have an older backup, so we aren't too bad off.
      I'll try the CVS version.  Do you want my database as well?

       
    • Jonathan Daley
      Jonathan Daley
      2008-10-26

      Downloaded 0.14.1.
      I am not sure if I got it installed correctly.  I get the "there is a problem with the database information you gave gourmet" error dialog.  The details say:

      Traceback (most recent call last):
        File "/usr/lib/python2.5/site-packages/gourmet/GourmetRecipeManager.py", line 201, in setup_recipes
        File "/usr/lib/python2.5/site-packages/gourmet/recipeManager.py", line 134, in default_rec_manager
        File "/usr/lib/python2.5/site-packages/gourmet/recipeManager.py", line 129, in get_recipe_manager
        File "/usr/lib/python2.5/site-packages/gourmet/backends/db.py", line 1528, in __init__
        File "/usr/lib/python2.5/site-packages/gourmet/backends/db.py", line 148, in __init__
        File "/usr/lib/python2.5/site-packages/gourmet/plugin_loader.py", line 269, in __init__
        File "/usr/lib/python2.5/site-packages/gourmet/plugin_loader.py", line 181, in get_master_loader
        File "/usr/lib/python2.5/site-packages/gourmet/plugin_loader.py", line 51, in __init__
        File "/usr/lib/python2.5/site-packages/gourmet/plugin_loader.py", line 78, in load_active_plugins
        File "/usr/lib/python2.5/site-packages/gourmet/plugin_loader.py", line 220, in __getattr__
        File "/usr/lib/python2.5/site-packages/gourmet/plugin_loader.py", line 226, in get_plugins
        File "/usr/lib/python2.5/site-packages/gourmet/plugin_loader.py", line 211, in get_module
      ImportError: No module named archive_plugin

      which kind of sounds like I installed it incorrectly.

      Any ideas?

       
      • tom
        tom
        2008-10-27

        The database bit is a red herring (I have to fix that error message -- that's a try/except block that's far too broad).

        It looks like there's a problem with the installation -- could well be on the packaging end, though, and not your fault. Can you check whether you have any folder called archive_plugin in your src/lib/plugins/ and whether it installed into site-packages...?

         
        • Jonathan Daley
          Jonathan Daley
          2008-10-27

          I don't see archive_plugin in that directory.  Also, I forgot to mention that recipes.dtd isn't included in the tar file, so I had to comment out the line that referenced it during setup.

          ~/gourmet-0.14.1/src/lib/plugins>ls -1
          __init__.py
          duplicate_finder
          duplicate_finder.gourmet-plugin
          duplicate_finder.gourmet-plugin.in
          import_export
          key_editor
          key_editor.gourmet-plugin
          key_editor.gourmet-plugin.in
          nutritional_information
          nutritional_information.gourmet-plugin
          nutritional_information.gourmet-plugin.in
          unit_converter
          unit_converter.gourmet-plugin
          unit_converter.gourmet-plugin.in

           
        • Jonathan Daley
          Jonathan Daley
          2008-10-27

          Also, note that I got the database error on 0.14.0 (debian package), so unrelated (or at least different) than the archive_plugin error I am now getting.

           
    • Jonathan Daley
      Jonathan Daley
      2008-10-27

      I manually copied the archive_plugin directory to the plugins/import_export directory, and got past that error.

      I now get:
      Connecting to file  /home/jondaley/.gourmet/recipes.db
      /var/lib/python-support/python2.5/sqlalchemy/databases/sqlite.py:461: SADeprecationWarning: Using String type with no length for CREATE TABLE is deprecated; use the Text type explicitly for column "plugin_info.plugin"
        colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect, _for_ddl=column).get_col_spec()

      /var/lib/python-support/python2.5/sqlalchemy/databases/sqlite.py:461: SADeprecationWarning: Using String type with no length for CREATE TABLE is deprecated; use the Text type explicitly for column "plugin_info.plugin_version"
        colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect, _for_ddl=column).get_col_spec()

      Upgrade from < 0.14

      Attempting to alter  categories <bound method RecipeManager.setup_category_table of <gourmet.backends.db.RecipeManager instance at 0x8e456ec>> {'id': 'recipe_id'} ['category']

      /var/lib/python-support/python2.5/sqlalchemy/databases/sqlite.py:461: SADeprecationWarning: Using String type with no length for CREATE TABLE is deprecated; use the Text type explicitly for column "categories.category"
        colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect, _for_ddl=column).get_col_spec()

      RECREATE INGREDIENTS TABLE (This could take a while...)
      Attempting to alter  ingredients <bound method RecipeManager.setup_ingredient_table of <gourmet.backends.db.RecipeManager instance at 0x8e456ec>> {'id': 'recipe_id'} ['refid', 'unit', 'amount', 'rangeamount', 'item', 'ingkey', 'optional', 'shopoptional', 'inggroup', 'position', 'deleted']

      /var/lib/python-support/python2.5/sqlalchemy/databases/sqlite.py:461: SADeprecationWarning: Using String type with no length for CREATE TABLE is deprecated; use the Text type explicitly for column "ingredients.unit"
        colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect, _for_ddl=column).get_col_spec()

      /var/lib/python-support/python2.5/sqlalchemy/databases/sqlite.py:461: SADeprecationWarning: Using String type with no length for CREATE TABLE is deprecated; use the Text type explicitly for column "ingredients.item"
        colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect, _for_ddl=column).get_col_spec()

      /var/lib/python-support/python2.5/sqlalchemy/databases/sqlite.py:461: SADeprecationWarning: Using String type with no length for CREATE TABLE is deprecated; use the Text type explicitly for column "ingredients.ingkey"
        colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect, _for_ddl=column).get_col_spec()

      /var/lib/python-support/python2.5/sqlalchemy/databases/sqlite.py:461: SADeprecationWarning: Using String type with no length for CREATE TABLE is deprecated; use the Text type explicitly for column "ingredients.inggroup"
        colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect, _for_ddl=column).get_col_spec()

      Traceback (most recent call last):
        File "/usr/local/bin/gourmet", line 35, in <module>
          gourmet.GourmetRecipeManager.startGUI()
        File "/usr/lib/python2.5/site-packages/gourmet/GourmetRecipeManager.py", line 708, in startGUI
        File "/usr/lib/python2.5/site-packages/gourmet/GourmetRecipeManager.py", line 1114, in __init__
        File "/usr/lib/python2.5/site-packages/gourmet/GourmetRecipeManager.py", line 112, in __init__
        File "/usr/lib/python2.5/site-packages/gourmet/GourmetRecipeManager.py", line 201, in setup_recipes
        File "/usr/lib/python2.5/site-packages/gourmet/recipeManager.py", line 134, in default_rec_manager
        File "/usr/lib/python2.5/site-packages/gourmet/recipeManager.py", line 129, in get_recipe_manager
        File "/usr/lib/python2.5/site-packages/gourmet/backends/db.py", line 1528, in __init__
        File "/usr/lib/python2.5/site-packages/gourmet/backends/db.py", line 151, in __init__
        File "/usr/lib/python2.5/site-packages/gourmet/backends/db.py", line 449, in update_version_info
        File "/usr/lib/python2.5/site-packages/gourmet/backends/db.py", line 828, in alter_table
        File "/usr/lib/python2.5/site-packages/gourmet/backends/db.py", line 1093, in do_add
        File "/var/lib/python-support/python2.5/sqlalchemy/sql/expression.py", line 1087, in execute
          return e.execute_clauseelement(self, multiparams, params)
        File "/var/lib/python-support/python2.5/sqlalchemy/engine/base.py", line 1219, in execute_clauseelement
          return connection.execute_clauseelement(elem, multiparams, params)
        File "/var/lib/python-support/python2.5/sqlalchemy/engine/base.py", line 895, in execute_clauseelement
          return self._execute_compiled(elem.compile(dialect=self.dialect, column_keys=keys, inline=len(params) > 1), distilled_params=params)
        File "/var/lib/python-support/python2.5/sqlalchemy/engine/base.py", line 904, in _execute_compiled
          context = self.__create_execution_context(compiled=compiled, parameters=distilled_params)
        File "/var/lib/python-support/python2.5/sqlalchemy/engine/base.py", line 948, in __create_execution_context
          return self.engine.dialect.create_execution_context(connection=self, **kwargs)
        File "/var/lib/python-support/python2.5/sqlalchemy/databases/sqlite.py", line 271, in create_execution_context
          return SQLiteExecutionContext(self, connection, **kwargs)
        File "/var/lib/python-support/python2.5/sqlalchemy/engine/default.py", line 185, in __init__
          self.parameters = self.__convert_compiled_params(self.compiled_parameters)
        File "/var/lib/python-support/python2.5/sqlalchemy/engine/default.py", line 241, in __convert_compiled_params
          param.append(processors[key](compiled_params[key]))
        File "/var/lib/python-support/python2.5/sqlalchemy/databases/sqlite.py", line 40, in process
          return type_(value)
      ValueError: empty string for float()

       
      • Jonathan Daley
        Jonathan Daley
        2008-10-27

        Ok, I think I am at the end of my muddling through python.

        Here is what I found:

        /var/lib/python-support/python2.5/sqlalchemy/sql/expression.py (line 1087, just before "return e.execute_clauseelement(self, multiparams, params)")
        I ADDED:
          "print 'Jondaley-debug:',self,multiparams,params"
        AND GOT:
        Jondaley-debug: INSERT INTO ingredients (id, recipe_id, refid, unit, amount, rangeamount, item, ingkey, optional, shopoptional, inggroup, position, deleted) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) () {'item': u'hot peppers', 'rangeamount': None, 'shopoptional': None, 'inggroup': None, 'amount': u'', 'recipe_id': 1, 'deleted': 1, 'position': 0, 'ingkey': u'peppers, hot', 'optional': 0, 'refid': None, 'unit': None}

        That help any?

         
    • Jonathan Daley
      Jonathan Daley
      2008-10-27

      Strange - I now notice the traceback is referencing files that don't exist - I have it installed in /usr/local, maybe python is "magically" finding them in the local directory, but not remembering where it found them?  Probably unrelated.

       
    • Jonathan Daley
      Jonathan Daley
      2008-10-27

      Ok, I think I am at the end of my muddling through python.

      Here is what I found:

      /var/lib/python-support/python2.5/sqlalchemy/sql/expression.py (line 1087, just before "return e.execute_clauseelement(self, multiparams, params)")
      I ADDED:
        "print 'Jondaley-debug:',self,multiparams,params"
      AND GOT:
      Jondaley-debug: INSERT INTO ingredients (id, recipe_id, refid, unit, amount, rangeamount, item, ingkey, optional, shopoptional, inggroup, position, deleted) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) () {'item': u'hot peppers', 'rangeamount': None, 'shopoptional': None, 'inggroup': None, 'amount': u'', 'recipe_id': 1, 'deleted': 1, 'position': 0, 'ingkey': u'peppers, hot', 'optional': 0, 'refid': None, 'unit': None}

      That help any?

       
    • Jonathan Daley
      Jonathan Daley
      2008-10-27

      hrm - sourceforge is having trouble - sorry for the double post.

      Let me know if I can help any further.

      Thanks for great software - my wife loves it.

       
      • tom
        tom
        2008-10-28

        I've fixed this issue in CVS. Hopefully you have a backup of the DB you can use to restore the lost ingredients...

         
    • Ed Wood
      Ed Wood
      2008-10-28

      Absolutely great! Got the CVS download and it now works perfectly.

      Thank you very much. I do really like Gourmet. It is the best program of its kind that I have used.

       
    • Jonathan Daley
      Jonathan Daley
      2008-10-28

      Yes, looks good to me as well.  (and I see the change to make the backup - that's nice)  Thanks for the quick fix!

      Here is a bit of the run-time log, in case it means there is more to do in code or packaging:

      Connecting to file  /home/jondaley/.gourmet/recipes.db
      Plugin  gxml_plugin not found
      Plugin  html_plugin not found
      Plugin  archive_plugin not found

      /var/lib/python-support/python2.5/sqlalchemy/databases/sqlite.py:461: SADeprecationWarning: Using String type with no length for CREATE TABLE is deprecated; use the Text type explicitly for column "plugin_info.plugin"
        colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect, _for_ddl=column).get_col_spec()

      /var/lib/python-support/python2.5/sqlalchemy/databases/sqlite.py:461: SADeprecationWarning: Using String type with no length for CREATE TABLE is deprecated; use the Text type explicitly for column "plugin_info.plugin_version"
        colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect, _for_ddl=column).get_col_spec()

      Making a backup copy of DB in  /home/jondaley/.gourmet/recipes.db.backup-27-10-08
      You can use it to restore if something ugly happens.
      Upgrade from < 0.14

      Attempting to alter  categories <bound method RecipeManager.setup_category_table of <gourmet.backends.db.RecipeManager instance at 0x968b66c>> {'id': 'recipe_id'} ['category']

      /var/lib/python-support/python2.5/sqlalchemy/databases/sqlite.py:461: SADeprecationWarning: Using String type with no length for CREATE TABLE is deprecated; use the Text type explicitly for column "categories.category"
        colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect, _for_ddl=column).get_col_spec()

      RECREATE INGREDIENTS TABLE (This could take a while...)

      Attempting to alter  ingredients <bound method RecipeManager.setup_ingredient_table of <gourmet.backends.db.RecipeManager instance at 0x968b66c>> {'id': 'recipe_id'} ['refid', 'unit', 'amount', 'rangeamount', 'item', 'ingkey', 'optional', 'shopoptional', 'inggroup', 'position', 'deleted']

      /var/lib/python-support/python2.5/sqlalchemy/databases/sqlite.py:461: SADeprecationWarning: Using String type with no length for CREATE TABLE is deprecated; use the Text type explicitly for column "ingredients.unit"
        colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect, _for_ddl=column).get_col_spec()

      /var/lib/python-support/python2.5/sqlalchemy/databases/sqlite.py:461: SADeprecationWarning: Using String type with no length for CREATE TABLE is deprecated; use the Text type explicitly for column "ingredients.item"
        colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect, _for_ddl=column).get_col_spec()

      /var/lib/python-support/python2.5/sqlalchemy/databases/sqlite.py:461: SADeprecationWarning: Using String type with no length for CREATE TABLE is deprecated; use the Text type explicitly for column "ingredients.ingkey"
        colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect, _for_ddl=column).get_col_spec()

      /var/lib/python-support/python2.5/sqlalchemy/databases/sqlite.py:461: SADeprecationWarning: Using String type with no length for CREATE TABLE is deprecated; use the Text type explicitly for column "ingredients.inggroup"
        colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect, _for_ddl=column).get_col_spec()

      RECREATE KEYLOOKUP TABLE
      Attempting to alter  keylookup <bound method RecipeManager.setup_keylookup_table of <gourmet.backends.db.RecipeManager instance at 0x968b66c>> {} ['word', 'item', 'ingkey', 'count']

      /var/lib/python-support/python2.5/sqlalchemy/databases/sqlite.py:461: SADeprecationWarning: Using String type with no length for CREATE TABLE is deprecated; use the Text type explicitly for column "keylookup.word"
        colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect, _for_ddl=column).get_col_spec()

      /var/lib/python-support/python2.5/sqlalchemy/databases/sqlite.py:461: SADeprecationWarning: Using String type with no length for CREATE TABLE is deprecated; use the Text type explicitly for column "keylookup.item"
        colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect, _for_ddl=column).get_col_spec()

      /var/lib/python-support/python2.5/sqlalchemy/databases/sqlite.py:461: SADeprecationWarning: Using String type with no length for CREATE TABLE is deprecated; use the Text type explicitly for column "keylookup.ingkey"
        colspec = self.preparer.format_column(column) + " " + column.type.dialect_impl(self.dialect, _for_ddl=column).get_col_spec()

      /usr/local/lib/python2.5/site-packages/gourmet/GourmetRecipeManager.py:1198: GtkWarning: toggleRegexp: missing action toggleRegexp
        mb = self.ui_manager.get_widget('/RecipeIndexMenuBar'); mb.show()

      /usr/local/lib/python2.5/site-packages/gourmet/GourmetRecipeManager.py:1198: GtkWarning: toggleSearchAsYouType: missing action toggleSearchAsYouType
        mb = self.ui_manager.get_widget('/RecipeIndexMenuBar'); mb.show()

      /usr/local/lib/python2.5/site-packages/gourmet/reccard.py:358: GtkWarning: KeyEditor: missing action KeyEditor
        menu = self.ui_manager.get_widget('/RecipeDisplayMenuBar')