Bug 641743 - [abrt] gourmet-0.15.4-5.fc14: expression.py:1375:__nonzero__:TypeError: Boolean value of this clause is not defined
Summary: [abrt] gourmet-0.15.4-5.fc14: expression.py:1375:__nonzero__:TypeError: Boole...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gourmet
Version: 14
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jef Spaleta
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:15d44b18
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-10-10 21:54 UTC by Andrea V.
Modified: 2011-06-02 18:56 UTC (History)
22 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:04:59 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (3.35 KB, text/plain)
2010-10-10 21:54 UTC, Andrea V.
no flags Details
Patch against Fedora git Repo to move to gourmet-0.15.6 (4.18 KB, patch)
2010-11-16 07:05 UTC, Jeff Raber
no flags Details | Diff

Description Andrea V. 2010-10-10 21:54:53 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.4-28.fc14.x86_64
package: gourmet-0.15.4-5.fc14
reason: expression.py:1375:__nonzero__:TypeError: Boolean value of this clause is not defined
release: Fedora release 14 (Laughlin)
time: 1286747581
uid: 500

How to reproduce
-----
1. Start gourmet ($ gourmet)
2. Crash
3.

Comment 1 Andrea V. 2010-10-10 21:54:56 UTC
Created attachment 452616 [details]
File: backtrace

Comment 2 Rudolf Kastl 2010-10-29 11:02:46 UTC
Package: gourmet-0.15.4-5.fc14
Architecture: x86_64
OS Release: Fedora release 15 (Rawhide)


How to reproduce
-----
1. installed it
2. started it
3. watched it crash


Comment
-----
install it and start it up... watch it crash then.

Comment 3 mark 2010-11-06 00:13:14 UTC
Package: gourmet-0.15.4-5.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. opened the application and it crashed immediately
2.
3.

Comment 4 Trapper 2010-11-06 03:07:39 UTC
Package: gourmet-0.15.4-5.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. gourmet-0.15.4-5.fc14 crashes at launch.
2.
3.


Comment
-----
I removed the package and then reinstalled it but get the same results. Application crashes during launch.

Comment 5 Gregor Neumeyer 2010-11-06 20:20:49 UTC
Package:    	gourmet-0.15.4-5.fc14 x86_64
Latest Crash:	Sa 06 Nov 2010 21:03:00 
Command:    	/usr/bin/python /usr/bin/gourmet
Reason:     	expression.py:1375:__nonzero__:TypeError: Boolean value of this clause is not defined
Comment:    	None
Bug Reports:	

How to reproduce
-----
1. install
2. launch
3. immediate crash

I removed gourmet and did a re-installation of its dependencies via yum. Reinstalled gourmet, it's crashing again, with the same backtrace.

My backtrace is equal to that already attached here, except for the username.

Comment 6 Andrew Kornak 2010-11-08 07:13:38 UTC
Package: gourmet-0.15.4-5.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. Run Gourmet Recipe Manager from accessories menu
2. Crash!
3.

Comment 7 jjsvdsr1 2010-11-08 23:25:52 UTC
Package: gourmet-0.15.4-5.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1.starting gourmet for the first time. after installation I *didnot* reboot.
2.
3.


Comment
-----
starting gourmet for the first time. after installation I *didnot* reboot.

Comment 8 jjsvdsr1 2010-11-09 00:26:57 UTC
Package: gourmet-0.15.4-5.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1.starting gourmet for the first time. after installation I *didnot* reboot.
then I rebooted, same result.

3.


Comment
-----
.starting gourmet for the first time. after installation I *didnot* reboot.
then I rebooted, same result...

Comment 9 clifford snow 2010-11-09 03:18:51 UTC
Package: gourmet-0.15.4-5.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. Clicked on Gourmet Recipe Manager in Menu
2. Saw a flash of the opening Gourmet Screen
3. Then crash


Comment
-----
Just tried to open.  First attempt since upgrading to F14.

Comment 10 Jeff Raber 2010-11-16 03:17:56 UTC
Package: gourmet-0.15.4-5.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. First time opening gourmet since upgrading to F14.
2.
3.


Comment
-----
First time opening gourmet since upgrading to F14.  The .db was created with Gourmet in F13.

Comment 11 Jeff Raber 2010-11-16 03:32:06 UTC
Upstream bug report: http://sourceforge.net/tracker/?func=detail&aid=3107472&group_id=108118&atid=649652



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

Comment 12 Jeff Raber 2010-11-16 04:39:44 UTC
The following patch fixes this crash, but exposes bug 653769 (which does not really affect the usability of the program)

--- db.py	2009-12-17 20:24:33.000000000 -0600
+++ db.py2	2010-11-15 22:30:30.101479070 -0600
@@ -794,7 +794,7 @@
 
     def get_unique_values (self, colname,table=None,**criteria):
         """Get list of unique values for column in table."""
-        if not table: table=self.recipe_table
+        if table is None: table=self.recipe_table
         if criteria: table = table.select(*make_simple_select_arg(criteria,table))
         if colname=='category' and table==self.recipe_table:
             print 'WARNING: you are using a hack to access category values.'




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

Comment 13 Jeff Raber 2010-11-16 07:05:54 UTC
Created attachment 460751 [details]
Patch against Fedora git Repo to move to gourmet-0.15.6

Jef,  It seems to me that gourmet-0.15.4-5 is completely unusable.  I humbly request that we move to the latest upstream release.  I have attached a patch and a scratch build is available[1].  My testing shows that the scratch build resolves this bug and bug 653769 .  

Please, let me know if there is anything additional that I can do to assist in making this change.

1:http://koji.fedoraproject.org/koji/taskinfo?taskID=2603413

Comment 14 Jeff Raber 2010-11-16 07:06:42 UTC

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

Comment 15 Stephen Haffly 2010-11-17 02:59:08 UTC
Package: gourmet-0.15.4-5.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. started Gourmet (had upgraded to F14 from F13 via preupgrade
2. Gourmet abended with ABRT showing.
3.


Comment
-----
This is repeatable every time.

Comment 16 David G. Mackay 2010-11-19 13:50:36 UTC
Package: gourmet-0.15.4-5.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1.Start gourmet
2.
3.


Comment
-----
Change line 797 in gourmet/backends/db.py from
if not table: table=self.recipe_table
to 
if table==None: table=self.recipe_table

Comment 17 Stephen Haffly 2010-11-19 16:54:52 UTC
I applied the change suggested by David Macay.  The program launched, but while I was editing a recipe, ABRT still popped up.  I was able to complete the edit, and it appears to have been successful, but when I went to close Gourmet from the file menu, it just sits there. However, the exit button on the frame still shut it down.

This is the ABRT information from this crash:

Package:    	gourmet-0.15.4-5.fc14
Latest Crash:	Fri 19 Nov 2010 11:47:42 AM 
Command:    	/usr/bin/python /usr/bin/gourmet
Reason:     	threadlocal.py:78:commit:IndexError: pop from empty list
Comment:    	None
Bug Reports:	


I launched it again, and selected the quit option from the file menu, and the same thing happened. So the above fix lets the program run, but it does not completely solve the problems with Gourmet.

Comment 18 Jeff Raber 2010-11-19 18:30:24 UTC
(In reply to comment #17)
Stephen; You are now seeing bug 653769 which is harmless (except for the ABRT notification).  A workaround for that bug has already been applied upstream.

If you'd like to test the latest version, a scratch build is available at: http://koji.fedoraproject.org/koji/taskinfo?taskID=2603413

Comment 19 Stephen Haffly 2010-11-19 19:21:36 UTC
Okay.  That seems to have fixed it.  Thanks.

Comment 20 Matthew Gardner 2010-11-20 20:44:01 UTC
Package: gourmet-0.15.4-5.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1.  I installed Fedora 14, a fresh install, including gourmet in my list of packages to install.
2.  I tried to run gourmet.
3.  That's all.  It crashed on startup.


Comment
-----
If I downgrade sqlalchemy (a dependency of gourmet, and the place where the code crashes) to 0.5.8-3.fc12 things work just fine.  Apparently sqlalchemy changed and gourmet didn't change accordingly.

Comment 21 David G. Mackay 2010-11-22 16:43:36 UTC
Package: gourmet-0.15.4-5.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1.Start gourmet
2.Start entering a recipe name in the search bar
3.


Comment
-----
Change line 758 in backends/db.py from:
if subtable:
to
if subtable!=None:

Comment 22 Stephen Haffly 2010-11-23 00:37:10 UTC
I think that the modification in #21 is not fully sufficient to fix the problems.  The actual line in my db.py is not 758, but 779.  When I modified it, the program ran, but while trying to import a recipe from a web page, the program opened ABRT, but did not end.

I tried modifying the partially imported recipe, and it seemed after every modification, instead of saving, it would open ABRT again.  After re-opening the recipe, I would find ingredients missing, others with two or three copies (e.g. 1 c yogurt repeated 3 times)

With repeated attempts, I finally got the recipe entered, but it was a tedious process. I then tried to print a copy, and ABRT opened again.  The Traceback is:

base.py:2310:lastrowid:AttributeError: 'NoneType' object has no attribute 'lastrowid'

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/gourmet/reccard.py", line 1021, in save_cb
    newdict = m.save(newdict)
  File "/usr/lib/python2.7/site-packages/gourmet/reccard.py", line 1222, in save
    self.ingtree_ui.ingController.commit_ingredients()
  File "/usr/lib/python2.7/site-packages/gourmet/reccard.py", line 2120, in commit_ingredients
    n = commit_iter(iter,n)
  File "/usr/lib/python2.7/site-packages/gourmet/reccard.py", line 2111, in commit_iter
    self.commited_items_converter[ing] = self.rg.rd.add_ing_and_update_keydic(d)
  File "/usr/lib/python2.7/site-packages/gourmet/backends/db.py", line 1198, in add_ing_and_update_keydic
    return self.add_ing(dic)
  File "/usr/lib/python2.7/site-packages/gourmet/backends/db.py", line 1203, in add_ing
    return self.do_add_ing(dic)
  File "/usr/lib/python2.7/site-packages/gourmet/backends/db.py", line 1281, in do_add_ing
    return self.do_add_and_return_item(self.ingredients_table,dic,id_prop='id')
  File "/usr/lib/python2.7/site-packages/gourmet/backends/db.py", line 1277, in do_add_and_return_item
    select = table.select(getattr(table.c,id_prop)==result_proxy.lastrowid)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 2310, in lastrowid
    return self.cursor.lastrowid
AttributeError: 'NoneType' object has no attribute 'lastrowid'

Local variables in innermost frame:
self: <sqlalchemy.engine.base.ResultProxy object at 0x31c7090>

Comment 23 Jeff Raber 2010-11-23 02:26:39 UTC
Stephen; You might try using the scratch build mentioned in comment 13



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

Comment 24 Stephen Haffly 2010-11-23 02:39:08 UTC
I had already installed it (see comments 18 and 19 above). These latest errors are with the scratch build.

Comment 25 Jeff Raber 2010-11-23 15:56:39 UTC
Stephen; I cannot reproduce your issue.  Please do 'rpm -V gourmet' to ensure that the files that exist match those supplied by the scratch build.  (Also, please verify that 'rpm -q gourmet' shows 'gourmet-0.15.6-1.fc14.noarch'.)

Comment 26 Stephen Haffly 2010-11-23 16:34:27 UTC
rpm -V gourmet
S.5....T.    /usr/lib/python2.7/site-packages/gourmet/backends/db.py
rpm -q gourmet
gourmet-0.15.6-1.fc14.noarch

These are the results. Is it possible that the db.py did not update when I installed the scratch build?  I will try uninstalling and then reinstalling Gourmet (scratch build) and see what happens.

Comment 27 Stephen Haffly 2010-11-23 16:56:33 UTC
Okay, I just uninstalled gourmet and then reinstalled the scratch build (after ensuring that the /usr/lib/python*/site-packages directories no longer contained any gourmet entries.

I think what may have happened is that I upgraded my F13 to F14 using preupgrade. As part of this upgrade, the python version used must have changed as my previous db.py was found under the python2.6 structure, not the 2.7.

When I reinstalled the scratch build, it placed the python structure under the python2.7 directory.  I did a brief recipe edit, and it appears to be working now, even without the modification in comment 21.

Comment 28 Alexander Kurtakov 2010-11-23 21:23:36 UTC
Package: gourmet-0.15.4-5.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. yum install goumet
2. run it for first time

Comment 29 Jef Spaleta 2010-11-23 22:04:01 UTC
I need to apologize, somehow this bug was being incorrectly filtered in my mail folders and not showing up in my bug management workflow.

Jeff Raber contacted me in private email and made me aware of this bug today.  I'm pushing the srpm he put together into updates testing _now_ for F14 and F13. It's already passed the rawhide build.

Sorry about the late response, and thanks Jeff for contacting me.

-jef

Comment 30 Fedora Update System 2010-11-23 22:04:41 UTC
gourmet-0.15.6-1.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/gourmet-0.15.6-1.fc14

Comment 31 Fedora Update System 2010-11-23 23:35:23 UTC
gourmet-0.15.6-1.fc13 has been submitted as an update for Fedora 13.
https://admin.fedoraproject.org/updates/gourmet-0.15.6-1.fc13

Comment 32 Jef Spaleta 2010-11-24 21:05:57 UTC
Heads up:

Another testing update just go submitted to bodhi:
gourmet-0.15.6-2.fc13
https://admin.fedoraproject.org/updates/gourmet-0.15.6-2.fc13

gourmet-0.15.6-2.fc14
https://admin.fedoraproject.org/updates/gourmet-0.15.6-2.fc14

New upstream version and an upstream patch for sqlalchemy compatibility issues.


I've fixed my mail filtering so I should be able to stay on top of issues you find with these test updates.  Thanks again to Jeff Raber for staying on top of this.  


-jef

Comment 33 Fedora Update System 2010-11-24 22:42:12 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 34 Michael Vergallen 2010-11-25 04:54:39 UTC
Package: gourmet-0.15.4-5.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. starting the application under fedora 14
2.
3.


Comment
-----
start the app under fedora 14

Comment 35 Justin Willmert 2010-11-25 19:22:22 UTC
Package: gourmet-0.15.4-5.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. Copied the .gourmet directory from Fedora 13 installation to new Fedora 14 home directory.
2. Tried to start Gourmet to verify that database was still intact.
3. Gourmet crashes when showing the splash screen.

Comment 36 Jef Spaleta 2010-11-25 21:31:24 UTC
gourmet-0.15.6-3 should be hitting updates-testing soon.

Please if you are affected test the new builds and add a +1 karma into the updates system to help move these updates out of testing and into the released updates repo.

https://admin.fedoraproject.org/updates/gourmet-0.15.6-3.fc13
https://admin.fedoraproject.org/updates/gourmet-0.15.6-3.fc14

And if the gourmet-0.15.6-3 build doesn't fix your issues, please report back in this bug if you think its the same problem or open an new one.

Apologizes again for not seeing this bug prior to F14 release.
 
-jef

Comment 37 Robert Kief 2010-11-26 18:39:44 UTC
Package: gourmet-0.15.4-5.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1.  Attempted to start Gourmet Recipe Manager for the first time.

Comment 38 Gary Alsop 2010-11-26 23:28:48 UTC
Package: gourmet-0.15.4-5.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1.  Launch Gourmet via Applications menu.  It will not launch.


Comment
-----
I only tried to launch the application.  I have tried with an existing .gourmet directory (from gourmet in Fedora 13) and without an existing .gourmet directory.

Comment 39 Jef Spaleta 2010-11-27 19:05:12 UTC
To everyone affected by this. Please test the gourmet packages as they become available in the updates-testing  repository or directly install them from the Fedora build system.  

If the 0.15.6-3 update works for you please add a +1 to the update ticket to help move this from testing into updates.

The F14 update ticket is here:
 https://admin.fedoraproject.org/updates/gourmet-0.15.6-3.fc14

The F13 update ticket is here:
 https://admin.fedoraproject.org/updates/gourmet-0.15.6-3.fc13

There you will find a link to the binary packages in the build system which you can install now if you feel comfortable doing so.

Positive karma from active users on these tickets do help.  And please if you hit a different crash inducing problem in the 0.15.6-3 packages please file a new ticket in this bug tracker. Especially people who have older pre-existing recipe databases. There are some corner cases in the code for older recipe databases that I'm just not going to hit in packaging testing.

-jef

Comment 40 Eric D. 2010-11-27 21:57:08 UTC
Package: gourmet-0.15.4-5.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. I was just launching it by clicking on it
2. never started...
3.

Comment 41 David 2010-11-30 19:46:10 UTC
Package: gourmet-0.15.4-5.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1.Start from a Fedora 12 system, preupgrade to Fedora 14.
2.Start Gourment.
3.


Comment
-----
Checking out upgrade from Fedora 12 to Fedora 14

Comment 42 David 2010-12-03 20:05:47 UTC
Package: gourmet-0.15.4-5.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1.Pregrade from Fedora 12 to Fedora 14
2.Start gourmet
3.

Comment 43 mark 2010-12-04 03:23:59 UTC
how do we know if our pre-existing recipe database is considered "older"? is there a new recipe database format? how can i tell which one i am using? how do i upgrade to the new one? would an export all recipes and then a import all recipes work?

Comment 44 Jeff Raber 2010-12-04 04:28:03 UTC
(In reply to comment #43)
Hi mark!  I have tried to answer all of your questions below.

Q: how do we know if our pre-existing recipe database is considered "older"?
  A1. Upon opening gourmet, an DB upgrade wizard will appear.
  A2. Examine your recipes.db.  Look at the table 'info'.  If your 
        'db version' is <= 0.14.7, your DB needs to be updated.
      (if you want do this, do the following:
        $ sqlite3 ~/.gourmet/recipes.db 
        sqlite> select * from info;
        0|15|6|1291190078.45471|1     <--That is the result from my DB.
                                              My DB version is 0.15.6

Q:  is there a new recipe database format? 
  A: No. The format is the same, only the schema has changed.
      (The schema hasn't been updated since version 0.14.7.)

Q: how can i tell which one i am using?
  A: See Q #1

Q: how do i upgrade to the new one?
  A: Run gourmet, it will automagically detect that your DB is outdate 
       and it will handle the upgrade for you.

Q: would an export all recipes and then a import all recipes work?
  A: I think so.  If not, let us know.




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

Comment 45 Jef Spaleta 2010-12-04 04:46:16 UTC
Just FYI, due to a late breaking bug report from 0.15.6-3 I have rolled a
0.15.6-4 which has been submitted into the update system for release to updates-testing.

I'd appreciate it if everyone on this ticket could try to run 0.15.16-4 and confirm or re-confirm that this new package fixes their issues.

https://admin.fedoraproject.org/updates/gourmet-0.15.6-4.fc14
or
https://admin.fedoraproject.org/updates/gourmet-0.15.6-4.fc13

Jeff Raber has been really on top of tracking down corner case issues associated with the recipe database.

Please hang in there with us as we work our way through the cornercases and please file new bugs if you you run into a different issue than you originally experience and brought you to this report. We are making progress, and the more people beating on the update-testing packages the more confident we'll be about landing a stable update into the non-testing updates tree.


-jef

Comment 46 Sean 2010-12-04 19:10:32 UTC
Package: gourmet-0.15.4-5.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1.INstall Gourmet using yum
2.Opened the program
3.

Comment 47 Mr. King 2010-12-05 21:16:59 UTC
Package: gourmet-0.15.4-5.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. Try to start program
2. Program crashes
3. Reproducable ad infinitum

Comment 48 Fehmi Demiralp 2010-12-09 09:33:51 UTC
Package: gourmet-0.15.4-5.fc14
Architecture: i686
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. I just run the gourment from the menu
2. it has creashed
3.

Comment 49 Fedora Update System 2010-12-12 20:04:44 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 50 Fedora Update System 2011-05-12 05:57:46 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 51 Fedora Update System 2011-06-02 10:57:21 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 52 Fedora Update System 2011-06-02 18:56:41 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.