gourmet crashes when enabling nutritional information plugin

Bug #944464 reported by Jesse Johnson
36
This bug affects 5 people
Affects Status Importance Assigned to Milestone
gourmet (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

On a clean install of Gourmet (0.15.9-1) from universe repo I am experiencing crashes in Gourmet after enabling the nutritional database addon.

I am running a Precise Beta 1 guest in Virtualbox on Oneiric host with latest updates. No crashes outside of Gourmet have yet been seen. The crash does not occur in Oneiric.

Reproduction steps:
1. start Gourmet
2. go to Settings -> Plugins
3. enable Nutritional Information plugin
4. nutritional database download status window stalls at "Reading weight data for nutritional items"
5. close stalled download status window
6. close gourmet
7. start gourmet
8. gourmet splashscreen appears but main window never does

The following console output seems to indicate the source of the problem during the initial database update:

<console>
RECREATE USDA WEIGHTS TABLE
Attempting to alter usda_weights <bound method NutritionDataPlugin.setup_usda_weights_table of <nutritional_information.data_plugin.NutritionDataPlugin instance at 0x2d6ea70>> {} ['ndbno', 'seq', 'amount', 'unit', 'gramwt', 'ndata', 'stdev']
Problem updating plugin <nutritional_information.data_plugin.NutritionDataPlugin instance at 0x2d6ea70> nutritondata
WARNING: PLUGIN FAILED TO LOAD <nutritional_information.data_plugin.NutritionDataPlugin instance at 0x2d6ea70>
</console>

When restarting Gourmet and it crashes, you get a similar error:

<console>
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 0x4009998> nutritondata
</console>

ProblemType: Crash
DistroRelease: Ubuntu 12.04
Package: gourmet 0.15.9-1
ProcVersionSignature: Ubuntu 3.2.0-17.27-generic 3.2.6
Uname: Linux 3.2.0-17-generic x86_64
ApportVersion: 1.93-0ubuntu2
Architecture: amd64
Date: Thu Mar 1 19:21:07 2012
ExecutablePath: /usr/bin/gourmet
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Beta amd64 (20120301)
InterpreterPath: /usr/bin/python2.7
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/bin/gourmet
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
PythonArgs: ['/usr/bin/gourmet']
SourcePackage: gourmet
Title: gourmet crashed with TypeError in _immutable(): immutabledict object is immutable
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo

Revision history for this message
Jesse Johnson (holocronweaver) wrote :
tags: removed: need-duplicate-check
visibility: private → public
Revision history for this message
Hans Joachim Desserud (hjd) wrote :

Thanks for reporting this issue.

By following your steps, I was able to reproduce this issue. I have attached full log of the output I got when triggering this, which includes a traceback.

Changed in gourmet (Ubuntu):
status: New → Confirmed
Revision history for this message
Alex (alexandre-garce) wrote :

I've got the same problem since I installed Ubuntu 12.04. I used gourmet before and it was working fine. I removed the nutritional information plugin from the "active plugins" file and I can start it again.

Changed in gourmet (Ubuntu):
importance: Undecided → Medium
Revision history for this message
EliotBlennerhassett (eliot-blennerhassett) wrote :

A (possibly hackish) fix for this:

In /usr/share/gourmet/gourmet/backends/db.py

replace line 944 or so (mentioned in traceback)
    del self.metadata.tables[table_name]

with
        self.metadata._remove_table(table_name, self.metadata.schema)

I got this idea here https://code.google.com/p/sqlalchemy-migrate/issues/attachmentText?id=128&aid=1280000000&name=sqlalchemy-migrate-fix-rename.patch&token=0L28CRkMtEopR6L-nXX2PRBt5HY%3A1352500382790

(I have edited the code in-place, so don't have a patch handy.

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

Thanks, fixed by https://github.com/thinkle/gourmet/commit/4854358d6284233abb80da69f92e9506e0287483
 (and subsequently in the 0.16.0 release).

Changed in gourmet (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.