Bug 656951 - [abrt] gourmet-0.15.6-1.fc14: db.py:891:add_column_to_table:AttributeError: 'Float' object has no attribute 'get_col_spec'
Summary: [abrt] gourmet-0.15.6-1.fc14: db.py:891:add_column_to_table:AttributeError: '...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gourmet
Version: 14
Hardware: x86_64
OS: Unspecified
low
medium
Target Milestone: ---
Assignee: Jef Spaleta
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:ff2ba1ee
: 651871 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-24 15:16 UTC by George Galt
Modified: 2011-06-02 18:57 UTC (History)
3 users (show)

Fixed In Version: gourmet-0.15.9-1.fc13
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-12-12 20:05:05 UTC


Attachments (Terms of Use)
File: backtrace (4.10 KB, text/plain)
2010-11-24 15:16 UTC, George Galt
no flags Details
Zip file of old database that is causing the crash (907.06 KB, application/zip)
2010-11-25 02:55 UTC, George Galt
no flags Details
Patch to fix DB Update related crash (747 bytes, patch)
2010-11-25 04:57 UTC, Jeff Raber
no flags Details | Diff
Patch to fix DB Update related crash (747 bytes, patch)
2010-11-25 05:00 UTC, Jeff Raber
no flags Details | Diff

Description George Galt 2010-11-24 15:16:25 UTC
abrt version: 1.1.13
architecture: x86_64
Attached file: backtrace
cmdline: /usr/bin/python /usr/bin/gourmet
component: gourmet
executable: /usr/bin/gourmet
kernel: 2.6.35.6-48.fc14.x86_64
package: gourmet-0.15.6-1.fc14
reason: db.py:891:add_column_to_table:AttributeError: 'Float' object has no attribute 'get_col_spec'
release: Fedora release 14 (Laughlin)
time: 1290611401
uid: 500

How to reproduce
-----
1. open gourmet
2. watch it crash
3.

Comment 1 George Galt 2010-11-24 15:16:26 UTC
Created attachment 462661 [details]
File: backtrace

Comment 2 Jef Spaleta 2010-11-24 17:29:52 UTC
George,

I take it you have a pre-existing recipe database on your system?  Would be willing to give me your recipe database so that I can try to reproduce this on my systems.  

Clean installs of gourmet with no pre-existing recipe database works for me.  In fact you can test that on your system by creating a new user for testing, login as that new user and run gourmet.

-jef

Comment 4 Jeff Raber 2010-11-24 20:31:26 UTC
*** Bug 651871 has been marked as a duplicate of this bug. ***

Comment 5 Fedora Update System 2010-11-24 20:59:18 UTC
gourmet-0.15.6-2.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/gourmet-0.15.6-2.fc13

Comment 6 Fedora Update System 2010-11-24 21:02:01 UTC
gourmet-0.15.6-2.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/gourmet-0.15.6-2.fc14

Comment 7 Fedora Update System 2010-11-24 22:42:19 UTC
gourmet-0.15.6-2.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update gourmet'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/gourmet-0.15.6-2.fc13

Comment 8 George Galt 2010-11-25 00:38:22 UTC
(In reply to comment #7)
> gourmet-0.15.6-2.fc13 has been pushed to the Fedora 13 testing repository.  If
> problems still persist, please make note of it in this bug report.
>  If you want to test the update, you can install it with 
>  su -c 'yum --enablerepo=updates-testing update gourmet'.  You can provide
> feedback for this update here:
> https://admin.fedoraproject.org/updates/gourmet-0.15.6-2.fc13

I built the src.rpm file for fc13 for my fc14 x86_64 system.  It seemed to get past the updating database stage -- at least it through up a dialog box saying that it would update the database and that it was making a backup -- it seems to have successfully created the backup and then died.  Here is the output:

[ggalt@george noarch]$ gourmet
Database older than 0.14.7 -- updating 0.13.4
Database older than 0.14.0 -- updating 0.13.4
Making a backup copy of DB in  /home/ggalt/.gourmet/recipes.db.backup-24-11-10
You can use it to restore if something ugly happens.
Upgrade from < 0.14 0.13.4
Attempting to alter  categories <bound method RecipeManager.setup_category_table of <gourmet.backends.db.RecipeManager instance at 0x3985488>> {'id': 'recipe_id'} ['category']
Traceback (most recent call last):
  File "/usr/bin/gourmet", line 35, in <module>
    gourmet.GourmetRecipeManager.startGUI()
  File "/usr/lib/python2.7/site-packages/gourmet/GourmetRecipeManager.py", line 715, in startGUI
    r=RecGui(splash_label=splash.label)
  File "/usr/lib/python2.7/site-packages/gourmet/GourmetRecipeManager.py", line 918, in __init__
    GourmetApplication.__init__(self, splash_label=splash_label)
  File "/usr/lib/python2.7/site-packages/gourmet/GourmetRecipeManager.py", line 114, in __init__
    self.setup_recipes() # Setup recipe database
  File "/usr/lib/python2.7/site-packages/gourmet/GourmetRecipeManager.py", line 204, in setup_recipes
    self.rd = recipeManager.default_rec_manager()
  File "/usr/lib/python2.7/site-packages/gourmet/recipeManager.py", line 131, in default_rec_manager
    return get_recipe_manager(**dbargs)
  File "/usr/lib/python2.7/site-packages/gourmet/recipeManager.py", line 126, in get_recipe_manager
    return RecipeManager(**args)
  File "/usr/lib/python2.7/site-packages/gourmet/backends/db.py", line 1760, in __init__
    RecData.__init__(self,*args,**kwargs)
  File "/usr/lib/python2.7/site-packages/gourmet/backends/db.py", line 165, in __init__
    self.update_version_info(gourmet.version.version)
  File "/usr/lib/python2.7/site-packages/gourmet/backends/db.py", line 510, in update_version_info
    except sqlite3.OperationalError:
NameError: global name 'sqlite3' is not defined

I currently have the following installed:

qt-sqlite-4.7.0-8.fc14.x86_64
sqlite-3.6.23.1-1.fc14.x86_64
python-sqlite2-2.3.5-3.fc14.x86_64
mono-data-sqlite-2.6.7-3.fc14.x86_64

I'm happy to run other tests or do additional builds if needed.

George

Comment 9 Jef Spaleta 2010-11-25 01:15:12 UTC
This error is somewhat of a red herring. the sqlite3.OperationalError statement is stale code that shouldn't even get hit by a user anymore.

The problem here is with a change in in how sqlalchemy does what it does and there's a chunk of code to try to deal with the changes in the sql schema that different versions of sqlalchemy have used over time.

How old is that recipe database?

You may need to manually update it. 

The best thing you could do for me is give me access to your recipe database so I can look at it and figure out exactly why gourmet is failing. Once I have a failing database, I'm pretty sure I can track down the problem in an hour or two.

This is basically going to involve a hunt through the logic of db.py and trying different things to correctly read the old database.

-jef

Comment 10 George Galt 2010-11-25 02:55:30 UTC
Created attachment 462797 [details]
Zip file of old database that is causing the crash

Comment 11 George Galt 2010-11-25 02:57:08 UTC
Jef:

Sorry, I thought I had sent the database to you separately in an email.  I've attached it.  While I am curious to see what is in the database, I can live without it, so it will be no big loss to just start from scratch.

Thanks for all of your help.

George

Comment 12 Jef Spaleta 2010-11-25 04:17:55 UTC
thanks for the zip.

I should be able to dig into this over the weekend and send a patch upstream to get this fixed for everyone.

-jef

Comment 13 Jeff Raber 2010-11-25 04:57:05 UTC
Created attachment 462810 [details]
Patch to fix DB Update related crash

Attaching patch to fix the crash reported in comment 8.
Submitted upstream @ https://sourceforge.net/tracker/?func=detail&aid=3118096&group_id=108118&atid=649654

With this patch I was able to successfully update/open the DB attached to this bug

Comment 14 Jeff Raber 2010-11-25 05:00:28 UTC
Created attachment 462811 [details]
Patch to fix DB Update related crash

Oops.  That last patch was backwards.  Attaching corrected patch.

Comment 15 Jef Spaleta 2010-11-25 11:37:12 UTC
(In reply to comment #14)
Rock on!

Jeff, what is it going to take to get you signed up co-maintaining this package?
You obviously care about the package and are keen on working with upstream.  If want to get commit access for this package, I'm more than willing to back you up in the sponsorship process to get you the commit access.

I'll spin up a new testing package and get it into the que.

-jef

Comment 16 George Galt 2010-11-25 14:02:43 UTC
(In reply to comment #14)
> Created attachment 462811 [details]
> Patch to fix DB Update related crash
> 
> Oops.  That last patch was backwards.  Attaching corrected patch.

Jeff:

I tried your patch (changing except sqlite3.OperationalError to except sqlalchemy.exc.OperationalError on line 510 of db.py), but got the result below.  It looks like the error in converting the database is different, but still there.  Sorry.

George



[ggalt@george noarch]$ gourmet
Database older than 0.14.7 -- updating 0.13.4
FAILED TO EXECUTE ALTER TABLE recipe ADD yields FLOAT;
Ignoring error in add_column_to_table
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/gourmet/backends/db.py", line 898, in add_column_to_table
    self.db.execute(sql)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1791, in execute
    return connection.execute(statement, *multiparams, **params)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1194, in execute
    params)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1290, in _execute_text
    return self.__execute_context(context)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1305, in __execute_context
    context.parameters[0], context=context)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1404, in _cursor_execute
    context)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1397, in _cursor_execute
    context)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 299, in do_execute
    cursor.execute(statement, parameters)
OperationalError: (OperationalError) duplicate column name: yields 'ALTER TABLE recipe ADD yields FLOAT;' ()
FAILED TO EXECUTE ALTER TABLE recipe ADD yield_unit VARCHAR(32);
Ignoring error in add_column_to_table
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/gourmet/backends/db.py", line 898, in add_column_to_table
    self.db.execute(sql)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1791, in execute
    return connection.execute(statement, *multiparams, **params)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1194, in execute
    params)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1290, in _execute_text
    return self.__execute_context(context)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1305, in __execute_context
    context.parameters[0], context=context)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1404, in _cursor_execute
    context)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1397, in _cursor_execute
    context)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 299, in do_execute
    cursor.execute(statement, parameters)
OperationalError: (OperationalError) duplicate column name: yield_unit 'ALTER TABLE recipe ADD yield_unit VARCHAR(32);' ()
Database older than 0.14.0 -- updating 0.13.4
Making a backup copy of DB in  /home/ggalt/.gourmet/recipes.db.backup-25-11-10
You can use it to restore if something ugly happens.
Upgrade from < 0.14 0.13.4
Attempting to alter  categories <bound method RecipeManager.setup_category_table of <gourmet.backends.db.RecipeManager instance at 0x1d8c488>> {'id': 'recipe_id'} ['category']
Traceback (most recent call last):
  File "/usr/bin/gourmet", line 35, in <module>
    gourmet.GourmetRecipeManager.startGUI()
  File "/usr/lib/python2.7/site-packages/gourmet/GourmetRecipeManager.py", line 715, in startGUI
    r=RecGui(splash_label=splash.label)
  File "/usr/lib/python2.7/site-packages/gourmet/GourmetRecipeManager.py", line 918, in __init__
    GourmetApplication.__init__(self, splash_label=splash_label)
  File "/usr/lib/python2.7/site-packages/gourmet/GourmetRecipeManager.py", line 114, in __init__
    self.setup_recipes() # Setup recipe database
  File "/usr/lib/python2.7/site-packages/gourmet/GourmetRecipeManager.py", line 204, in setup_recipes
    self.rd = recipeManager.default_rec_manager()
  File "/usr/lib/python2.7/site-packages/gourmet/recipeManager.py", line 131, in default_rec_manager
    return get_recipe_manager(**dbargs)
  File "/usr/lib/python2.7/site-packages/gourmet/recipeManager.py", line 126, in get_recipe_manager
    return RecipeManager(**args)
  File "/usr/lib/python2.7/site-packages/gourmet/backends/db.py", line 1760, in __init__
    RecData.__init__(self,*args,**kwargs)
  File "/usr/lib/python2.7/site-packages/gourmet/backends/db.py", line 165, in __init__
    self.update_version_info(gourmet.version.version)
  File "/usr/lib/python2.7/site-packages/gourmet/backends/db.py", line 510, in update_version_info
    except sqlite3.exc.OperationalError:
NameError: global name 'sqlite3' is not defined

Comment 17 Jeff Raber 2010-11-25 16:39:24 UTC
Looks like you may have mis-applied that patch.
    You have: sqlite3.exc.OperationalError:
   Should be: sqlalchemy.exc.OperationalError:



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 18 George Galt 2010-11-25 18:07:37 UTC
(In reply to comment #17)
> Looks like you may have mis-applied that patch.
>     You have: sqlite3.exc.OperationalError:
>    Should be: sqlalchemy.exc.OperationalError:
> 
> 
> 
> -- 
> Fedora Bugzappers volunteer triage team
> https://fedoraproject.org/wiki/BugZappers

Jeff:

Your absolutely right.  I figured a one-line patch was easier to do in an editor and I blew it.  Corrected the line as you suggested and it works now!!

Thanks to both you and Jef for the extensive and speedy help!

George

Comment 19 Jef Spaleta 2010-11-25 20:57:24 UTC
Watch F13 and F14 updates-testing repo for gourmet-0.15.6-3  which has both patches included to deal with this old db compatibility.

To help this get out to users, it would be groovy if you would +1 the karma at 
http://admin.fedoraproject.org/updates/gourmet-0.15.6-3.fc13
and
http://admin.fedoraproject.org/updates/gourmet-0.15.6-3.fc14

-jef

Comment 20 George Galt 2010-11-26 17:13:19 UTC
(In reply to comment #19)
> Watch F13 and F14 updates-testing repo for gourmet-0.15.6-3  which has both
> patches included to deal with this old db compatibility.
> 
> To help this get out to users, it would be groovy if you would +1 the karma at 
> http://admin.fedoraproject.org/updates/gourmet-0.15.6-3.fc13
> and
> http://admin.fedoraproject.org/updates/gourmet-0.15.6-3.fc14
> 
> -jef

Jef:

I'd be happy to do so, but I'm not sure how.  I've searched google, but no luck.  The only thing I find is something about using fedora-easy-karma, but it doesn't seem to do anything for me.

George

Comment 21 Jeff Raber 2010-11-27 06:32:36 UTC
(In reply to comment #20)
...
> I'd be happy to do so, but I'm not sure how.  I've searched google, but no
> luck.  The only thing I find is something about using fedora-easy-karma, but it
> doesn't seem to do anything for me.
> 
> George

Click the 'Add a comment >>' link at the bottom of the 'update' page (the links were provided in comment 19).  You will then be prompted for comments and a rating (Untested=0, Works for me=+1, Does not work=-1).

See the "What to test, testing, and reporting results" section @ [1] for a better explanation.  (But note that a FAS account is not required to provide this feedback.)

1:http://fedoraproject.org/wiki/QA/Updates_Testing



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 22 Fedora Update System 2010-12-12 20:04:50 UTC
gourmet-0.15.6-4.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 23 Fedora Update System 2011-05-12 05:57:56 UTC
gourmet-0.15.9-1.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/gourmet-0.15.9-1.fc13

Comment 24 Fedora Update System 2011-06-02 10:57:30 UTC
gourmet-0.15.9-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 25 Fedora Update System 2011-06-02 18:56:48 UTC
gourmet-0.15.9-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.