Bug 496747 - python-sqlite2 causes errors when using "vacuum" and "pragma legacy_file_format = off"
Summary: python-sqlite2 causes errors when using "vacuum" and "pragma legacy_file_form...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-sqlite2
Version: 10
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Xavier Lamien
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-04-20 22:03 UTC by Christian Krause
Modified: 2009-07-12 10:38 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-07-12 10:38:00 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
anki data file which triggers the problem (47.00 KB, application/octet-stream)
2009-04-20 22:03 UTC, Christian Krause
no flags Details

Description Christian Krause 2009-04-20 22:03:01 UTC
Created attachment 340445 [details]
anki data file which triggers the problem

Description of problem:
Anki, a education program, stores its information in sqlite databases.
The newest version of anki tries to update the databases. E.g. columns are added and then it calls "vacuum". Usually with legacy_file_format set to off. This should regenerate the database files according to the new layout.

I'm getting this backtrace when doing this operation:

  File "/usr/lib/python2.5/site-packages/anki/deck.py", line 2479, in Deck
    deck = DeckStorage._upgradeDeck(deck, path)
  File "/usr/lib/python2.5/site-packages/anki/deck.py", line 2960, in _upgradeDeck
    deck.s.execute("vacuum")
  File "/usr/lib/python2.5/site-packages/anki/db.py", line 68, in execute
    x = self._session.execute(*a, **ka)
  File "/usr/lib/python2.5/site-packages/sqlalchemy/orm/session.py", line 628, in execute
    return self.__connection(engine, close_with_result=True).execute(clause, params or {})
  File "/usr/lib/python2.5/site-packages/sqlalchemy/engine/base.py", line 844, in execute
    return Connection.executors[c](self, object, multiparams, params)
  File "/usr/lib/python2.5/site-packages/sqlalchemy/engine/base.py", line 854, in _execute_text
    self.__execute_raw(context)
  File "/usr/lib/python2.5/site-packages/sqlalchemy/engine/base.py", line 916, in __execute_raw
    self._cursor_execute(context.cursor, context.statement, context.parameters[0], context=context)
  File "/usr/lib/python2.5/site-packages/sqlalchemy/engine/base.py", line 961, in _cursor_execute
    self._handle_dbapi_exception(e, statement, parameters, cursor)
  File "/usr/lib/python2.5/site-packages/sqlalchemy/engine/base.py", line 943, in _handle_dbapi_exception
    raise exceptions.DBAPIError.instance(statement, parameters, e, connection_invalidated=is_disconnect)
DatabaseError: (DatabaseError) database disk image is malformed 'vacuum' {}

I've communicated this problem with anki's upstream maintainer, and he couldn't reproduce the problem on his side. We've compared the versions of the relevant components and it turns out that python-sqlite2-2.3.3 is causing the problem.

I've compiled python-sqlite2-2.3.5 and the problem went away.


Version-Release number of selected component (if applicable):
python-sqlite2.i386 1:2.3.3-3.fc9 (there is no F10 build)


How reproducible:
100% on my side

Steps to Reproduce:
1. install newest anki (0.9.9.7.4): "yum update --enablerepo updates-testing anki"
2. download the attached file test.anki
3. start "anki /path/to/test.anki"
4. problem occurs (although there is no data loss)
5. kill the anki process, delete ~/.anki
6. download the attached file again (this is important, since anki has altered this file)
7. install python-sqlite2 scratch build from here: 
https://koji.fedoraproject.org/koji/taskinfo?taskID=1310129
8. start "anki /path/to/test.anki"
9. problem is gone ;-)

Actual results:
error message above

Expected results:
no error ;-)

Comments:
I know that the package is quite old, but it looks like that it is still in use by some other packages:
        python-sqlite2 is needed by (installed) synce-sync-engine-0.11.1-1.fc10.noarch
        python-sqlite2 is needed by (installed) nmap-frontend-2:4.68-3.fc10.i386
        python-sqlite2 is needed by (installed) PackageKit-0.3.15-2.fc10.i386
        python-sqlite2 is needed by (installed) gcompris-8.4.12-1.fc10.i386
Since rebuilding version 2.3.5 was really no problem, I hope that we can do this for F10 (and later as an update for F11).

Comment 1 Xavier Lamien 2009-05-10 15:07:23 UTC
hey, sorry I omitted to let you know that there's a new release in the pipe.
Could you give it a try ?

Comment 2 Christian Krause 2009-05-10 16:59:35 UTC
(In reply to comment #1)
> hey, sorry I omitted to let you know that there's a new release in the pipe.
> Could you give it a try ?  

Great - the package available in koji: https://koji.fedoraproject.org/koji/buildinfo?buildID=98953 fixes the problem. Thanks! It would be good if you could push it as an update to F10 and F11... ;-)

Comment 3 Christian Krause 2009-06-03 18:14:50 UTC
*ping*

Any news regarding the update of python-sqlite2? ;-) It would be great if there would be an update for F10 and F11 - thanks!

Comment 4 Xavier Lamien 2009-06-03 18:23:29 UTC
That should already be done.
Let me look at this.

Comment 5 Christian Krause 2009-06-03 18:52:05 UTC
(In reply to comment #4)
> That should already be done.
> Let me look at this.  

Unfortunately not yet... :-(

F10 build: 
https://koji.fedoraproject.org/koji/buildinfo?buildID=98953
only tagged as updates-testing-candidate, not in bodhi

F11 builds:
a) https://koji.fedoraproject.org/koji/buildinfo?buildID=90881 is tagged as f11-final (which is still 2.3.3)

b) https://koji.fedoraproject.org/koji/buildinfo?buildID=99848 only updates-testing-candidate, not in bodhi

Thanks for having a look!

Comment 6 Xavier Lamien 2009-06-03 20:37:47 UTC
ho crap!
Could you give it a karma so that i'll push it, thanks.

Comment 7 Christian Krause 2009-06-05 08:46:47 UTC
(In reply to comment #6)
> Could you give it a karma so that i'll push it, thanks.  

Are you sure you have already pushed it into testing? It is only possible to give karma to packages which are in bodhi (e.g. in testing): 
https://admin.fedoraproject.org/updates/search/python-sqlite2

Please can you submit python-sqlite2 for F10 as well as for F11 as update via bodhi for updates-testing? Then I and others can test it and give a positive karma...

Comment 8 Christian Krause 2009-06-19 16:39:01 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > Could you give it a karma so that i'll push it, thanks.  

I've just seen the new packages in updates-testing. I've tested them and I've given them sama (positive) karma in bodhi. ;-)

Comment 9 Christian Krause 2009-07-12 09:12:38 UTC
*ping*
Any news regarding the update of python-sqlite2?

Looks like that package in now over a month in updates-testing - do you think it would be safe now to push it to stable?

Thanks!

Comment 10 Xavier Lamien 2009-07-12 10:38:00 UTC
Mared as stable for both fedora release.


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