Bug 1217061

Summary: [abrt] gpodder: dbsqlite.py:708:upgrade_table:ValueError: too many values to unpack
Product: [Fedora] Fedora Reporter: Mark <mark>
Component: gpodderAssignee: Gwyn Ciesla <gwync>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: bengt.sjogren, cbuissar, goths, gwync, jspaleta, Per.t.Sjoholm, stephen.hindmarch, vpvainio
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/2b165750de44d61906ad4dc51ce252706c4d7c1a
Whiteboard: abrt_hash:1f68ddb7659181954675b0b6c63f3a030e5ae168
Fixed In Version: gpodder-2.20.3-3.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-05-19 16:23:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: environ
none
Quick and dirty fix none

Description Mark 2015-04-29 13:17:40 UTC
Description of problem:
Starten von gPodder
$ gpodder
Traceback (most recent call last):
  File "/usr/bin/gpodder", line 218, in <module>
    gui.main(options)
  File "/usr/lib/python2.7/site-packages/gpodder/gui.py", line 4253, in main
    gp = gPodder(bus_name, config)
  File "/usr/lib/python2.7/site-packages/gpodder/gui.py", line 179, in __init__
    BuilderWidget.__init__(self, None)
  File "/usr/lib/python2.7/site-packages/gpodder/gtkui/interface/common.py", line 56, in __init__
    GtkBuilderWidget.__init__(self, gpodder.ui_folders, gpodder.textdomain, **kwargs)
  File "/usr/lib/python2.7/site-packages/gpodder/gtkui/base.py", line 70, in __init__
    self.new()
  File "/usr/lib/python2.7/site-packages/gpodder/gui.py", line 468, in new
    self.channels = PodcastChannel.load_from_db(self.db, self.config.download_dir)
  File "/usr/lib/python2.7/site-packages/gpodder/model.py", line 129, in load_from_db
    return db.load_channels(factory=cls.build_factory(download_dir))
  File "/usr/lib/python2.7/site-packages/gpodder/dbsqlite.py", line 343, in load_channels
    cur = self.cursor(lock=True)
  File "/usr/lib/python2.7/site-packages/gpodder/dbsqlite.py", line 199, in cursor
    return self.db.cursor()
  File "/usr/lib/python2.7/site-packages/gpodder/dbsqlite.py", line 193, in db
    self.__check_schema()
  File "/usr/lib/python2.7/site-packages/gpodder/dbsqlite.py", line 266, in __check_schema
    self.upgrade_table(self.TABLE_CHANNELS, self.SCHEMA_CHANNELS, self.INDEX_CHANNELS)
  File "/usr/lib/python2.7/site-packages/gpodder/dbsqlite.py", line 708, in upgrade_table
    for pos, idx_name, idx_is_unique in current_indices:
ValueError: too many values to unpack

Version-Release number of selected component:
gpodder-2.20.3-2.fc20

Additional info:
reporter:       libreport-2.2.3
cmdline:        /usr/bin/python /usr/bin/gpodder
executable:     /usr/bin/gpodder
kernel:         3.19.5-100.fc20.x86_64
runlevel:       N 5
type:           Python
uid:            1000

Truncated backtrace:
#1 upgrade_table in /usr/lib/python2.7/site-packages/gpodder/dbsqlite.py:708
#2 __check_schema in /usr/lib/python2.7/site-packages/gpodder/dbsqlite.py:266
#3 db in /usr/lib/python2.7/site-packages/gpodder/dbsqlite.py:193
#4 cursor in /usr/lib/python2.7/site-packages/gpodder/dbsqlite.py:199
#5 load_channels in /usr/lib/python2.7/site-packages/gpodder/dbsqlite.py:343
#6 load_from_db in /usr/lib/python2.7/site-packages/gpodder/model.py:129
#7 new in /usr/lib/python2.7/site-packages/gpodder/gui.py:468
#8 __init__ in /usr/lib/python2.7/site-packages/gpodder/gtkui/base.py:70
#9 __init__ in /usr/lib/python2.7/site-packages/gpodder/gtkui/interface/common.py:56
#10 __init__ in /usr/lib/python2.7/site-packages/gpodder/gui.py:179

Comment 1 Mark 2015-04-29 13:17:43 UTC
Created attachment 1020151 [details]
File: backtrace

Comment 2 Mark 2015-04-29 13:17:44 UTC
Created attachment 1020152 [details]
File: environ

Comment 3 Per Sjoholm 2015-04-29 15:54:36 UTC
I removed  database
rm .config/gpodder/database.sqlite  .config/gpodder/mygpo.queue.sqlite

Started with a clean gpodder-downloads 
rm -rf gpodder-downloads

Added a new RSS feed

Downloaded the a episode.

quit gpodder

Started gpodder
Trace ended in
File "/usr/lib/python2.7/site-packages/gpodder/dbsqlite.py", line 708, in upgrade_table
    for pos, idx_name, idx_is_unique in current_indices:
ValueError: too many values to unpack

Comment 4 Mark 2015-04-30 06:10:42 UTC
It just startet recently, so I suspect this:
    Updated sqlite-3.8.8.3-1.fc20.i686                                 @updates
    Updated sqlite-3.8.8.3-1.fc20.x86_64                               @updates
    Update         3.8.9-1.fc20.i686                                   @updates
    Update         3.8.9-1.fc20.x86_64                                 @updates
    Updated sqlite-devel-3.8.8.3-1.fc20.x86_64                         @updates
    Update               3.8.9-1.fc20.x86_64                           @updates

Comment 5 goths 2015-05-01 12:58:08 UTC
Another user experienced a similar problem:

Works for me since many years. Thanks for that. But, since now crashes the program already at the start :(

reporter:       libreport-2.2.3
cmdline:        /usr/bin/python /usr/bin/gpo update
executable:     /usr/bin/gpo
kernel:         3.18.9-100.fc20.x86_64
package:        gpodder-2.20.3-2.fc20
reason:         dbsqlite.py:708:upgrade_table:ValueError: too many values to unpack
runlevel:       N 5
type:           Python
uid:            666

Comment 6 Mark 2015-05-04 07:13:22 UTC
Created attachment 1021560 [details]
Quick and dirty fix

I did a quick and dirty patch that seems to fix it for me.
Maybe there is a better solution to prevent breaking next time sqlite extends a set/array

Comment 7 goths 2015-05-04 20:46:08 UTC
Comment on attachment 1021560 [details]
Quick and dirty fix

Yes, really great. Changing line 708, works for me. thank you Mark

Comment 8 Per Sjoholm 2015-05-05 21:10:02 UTC
dbsqlite.py
        # Search for a unique index on the "guid" column in
        # the episodes table and drop it if it exists. It will
        # be recreated without the unique flag. (Maemo bug 12094)
        cur.execute('PRAGMA index_list(%s)' % self.TABLE_EPISODES)
        current_indices = cur.fetchall()
Line 708
        for pos, idx_name, idx_is_unique in current_indices:
fix:
        for pos, idx_name, idx_is_unique, ignore1, ignore2 in current_indices:

https://www.sqlite.org/pragma.html#pragma_index_list
Specific pragma statements may be removed and others added in future releases of SQLite. There is no guarantee of backwards compatibility. 

PRAGMA database.index_list(table-name);

This pragma returns one row for each index associated with the given table.

Output columns from the index_list pragma are as follows:

    A sequence number assigned to each index for internal tracking purposes.
    The name of the index.
    "1" if the index is UNIQUE and "0" if not.
    "c" if the index was created by a CREATE INDEX statement, "u" if the index was created by a UNIQUE constraint, or "pk" if the index was created by a PRIMARY KEY constraint.
    "1" if the index is a partial index and "0" if not. 


Why does line 708 for .... choke ?

Comment 9 Fedora Update System 2015-05-08 19:48:45 UTC
gpodder-2.20.3-3.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/gpodder-2.20.3-3.fc20

Comment 10 Fedora Update System 2015-05-11 00:12:29 UTC
Package gpodder-2.20.3-3.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing gpodder-2.20.3-3.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-7745/gpodder-2.20.3-3.fc20
then log in and leave karma (feedback).

Comment 11 Mark 2015-05-13 18:26:47 UTC
There is a better fix upstream now:

https://github.com/gpodder/gpodder/commit/e02b028

Comment 12 Fedora Update System 2015-05-19 16:23:36 UTC
gpodder-2.20.3-3.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.