GNOME Bugzilla – Bug 418818
F-spot fails to load when photos.db is in sqlite2 format
Last modified: 2007-03-21 22:58:38 UTC
Please describe the problem: At some point in the past, f-spot switched from using sqlite2 to sqlite3 format for the photos.db file. Many users, however, will still have a photos.db file that's in sqlite2 format -- and most of them won't know how to upgrade their photos.db file. Furthermore, the failure is absolutely silent when f-spot is launched graphically (e.g., from the GNOME Applications menu). A meaningful error message only appears when f-spot is run from the command line. This will not be helpful to a Linux newbie, who will not know how to proceed. Steps to reproduce: 1. Have a photos.db file in sqlite2 format. 2. Run f-spot. 3. Observe the error message. Actual results: The following error message is produced: Starting new FSpot server XXXXX Mono.Data.SqliteClient.SqliteSyntaxException: file is encrypted or is not a database at Mono.Data.SqliteClient.SqliteCommand.GetNextStatement (IntPtr pzStart, System.IntPtr& pzTail, System.IntPtr& pStmt) [0x00000] at Mono.Data.SqliteClient.SqliteCommand.ExecuteReader (CommandBehavior behavior, Boolean want_results, System.Int32& rows_affected) [0x00000] at Mono.Data.SqliteClient.SqliteCommand.ExecuteNonQuery () [0x00000] at DbStore.TrySqliteCommand (System.String command_text, System.Int32& retries) [0x00000] at DbStore.ExecuteSqlCommand (System.String command_text) [0x00000] at MetaStore.CreateTable () [0x00000] at MetaStore..ctor (Mono.Data.SqliteClient.SqliteConnection connection, Boolean is_new) [0x00000] at Db.Init (System.String path, Boolean create_if_missing) [0x00000] at FSpot.Core..ctor (Boolean nodb) [0x00000] at FSpot.Driver.Main (System.String[] args) [0x00000] XXXXX Cant' get a connection to the dbus. Trying again... Starting new FSpot server Cant' get a connection to the dbus. Trying again... (etc.) Expected results: F-Spot should detect the old version of photos.db and upgrade it to an sqlite3 database automatically. Perhaps the user should be prompted prior to the upgrade, or perhaps it should be done silently -- but the user should not need to know details of SQLite's database format in order to work with his photos. Does this happen every time? Yes. Other information: Upgrading the photos.db file from the command-line is simple. Simply install both sqlite2 and sqlite3 ("apt-get install sqlite sqlite3" on Ubuntu), then run: sqlite photos.db .dump | sqlite3 photos.db.new mv photos.db photos.db.old mv photos.db.new photos.db However, anyone new to Linux won't have a clue how to proceed, so the application really should handle this sort of thing smoothly for them.
Forgot to mention: I'm running F-spot 0.3.5, installed on Ubuntu Feisty. Oh, and the word "can't" is misspelled in the error message, too. :-)
Hi Robin, can you please send me (stephane AT delcroix DOT org) your sqlite2 photos.db ? I think the problem is that you had only sqlite2 installed... regards s
photos.db file mailed as requested. On further testing, I find that the bug happens when (and only when) I *don't* have sqlite2 installed. Installing sqlite2, then running F-Spot, works. But removing sqlite2 (via "apt-get remove sqlite libsqlite0" in Ubuntu) produces the error I reported above. So perhaps the fix should be changed to detect this error and present a meaningful message to the user: "You seem to not have SQLite version2 installed. Please install it, then try again." With -- perhaps -- some autodetection of common distros and customization of the message. ("You appear to be running Ubuntu -- to install SQLite version 2 in Ubuntu, run "sudo apt-get install sqlite" from the command prompt.")
I can confirm this bug as present in both 0.3.4 and 0.3.5... This is especially annoying when starting f-spot from a menu (as opposed to the command line), since it will loop forever, eventually eating up all resources. I deleted my old db and started from scratch. I also only had v3.x of sqlite installed, since sqlite-2.x is not a dependency of f-spot on gentoo.
Robin, Morten, this is a packaging issue. If gentoo or ubuntu bundled f-spot with sqlite2 in the past, they shouldn't had removed that dependency without providing an upgrade script or mechanism. the general solution for this is to install both sqlite and sqlite3 and do the upgrade manually with a command like this: cd ~/.gnome2/f-spot mv photos.db photos.db.v2 sqlite photos.db.v2 .dump | sqlite3 photos.db Robin, thanks for the typo, I'm fixing that in trunk... regards s
This is not a packaging issue. f-spot should handle errors in a much more graceful manner than this. Allowing an application to go into an infinite loop because it has problems reading a file is imho not good error handling. That said, the dependencies should of course be better checked by the various distros... I'll file a bug in the gentoo bugzilla, referencing this bug.