GNOME Bugzilla – Bug 790469
0.7.2->0.26.4 shotwell DB upgrade fails: Db.vala:308: upgrade_database: adding comment column to VideoTable
Last modified: 2017-12-12 19:50:37 UTC
After OS upgrade from Ubuntu 10.04.4 LTS to Lubuntu 16.04 LTS including shotwell upgrade from 0.7.2 to 0.26.4 shotwell startup fails. shotwell.log contains: main.vala:385: Shotwell Photo Manager 0.26.4 (5bd7d9a736997289de10c3bcdbaa089955e46233) Db.vala:71: Upgrading database from schema version 8 to 20 Db.vala:308: upgrade_database: adding comment column to VideoTable An earlier attempt to debug same photo.db with 0.26.3 shows: ERROR:/build/shotwell-acRo6P/shotwell-0.26.3/src/db/DatabaseTable.vala:341:database_table_add_column: assertion failed: (res == Sqlite.OK) Viewing shotwell database with DB browser for SQLite shows only EventTable, PhotoTable, TagTable, and VersionTable--_no_ VideoTable. Creating a fresh shotwell 0.26.4 database includes several more tables including VideoTable. ie it seems shotwell upgrade program assumes VideoTable already exists.
An additional clue: Db Browser for SQLite shows Version Table contents as: id:1 schema_version:8 app_version 0.7.2 user_data: null While trying to get this working, I have invoked shotwell many times. It always aborts. Not sure if schema_version:8 and app_version:0.7.2 is the source of the problem or not.
Can you provide the photo.db somehow?
Thank-you very much for your quick response Jens. As the photo collection is quite large, and not owned by me, I thought I would just provide a test case for your analysis. So I created an empty 0.7.2 photo.db and invoked shotwell 0.26.4 against it. It came up without error! Please put on hold until I analyse further. Spike
Hi Jens: Turns out shotwell 0.26.4 physically moved the 0.7.2 photo.db from ./.shotwell/data/ to ./.local/share/shotwell/data, which initially confused me for comment 3 above. Therefore, please ignore comment 3 above. And accept this additional, more detailed information in response to your request for copy of the photo.db. To demonstrate the problem, I simply invoked shotwell 0.7.2, and exited without adding any photos, thereby creating a ./.shotwell/data/photo.db file. Then I simply invoked shotwell 0.26.4 Please see below for both the console log ending in the abort, and the shotwell log showing the attempt to add a column to the (non-existent) VideoTable. Is this enough information for you to further assist me in resolving the problem? Thank-you for your help. Spike console log for Shotwell 0.26.4 invocation against newly created, empty 0.7.2 photo.db : =============== SHOTWELL_LOG=1 shotwell ** (shotwell:3868): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files L 3868 2017-11-18 14:29:56 [CRT] Plugins.vala:418: Not loading module /usr/lib/i386-linux-gnu/shotwell/plugins/builtin/shotwell-transitions.so (SPIT 0): module with name "org.yorba.shotwell.transitions" already loaded L 3868 2017-11-18 14:29:56 [CRT] Plugins.vala:418: Not loading module /usr/lib/i386-linux-gnu/shotwell/plugins/builtin/shotwell-publishing.so (SPIT 0): module with name "org.yorba.shotwell.publishing.core_services" already loaded L 3868 2017-11-18 14:29:56 [CRT] Plugins.vala:418: Not loading module /usr/lib/i386-linux-gnu/shotwell/plugins/builtin/shotwell-data-imports.la (SPIT 0): module with name "org.yorba.shotwell.data_imports.core_services" already loaded L 3868 2017-11-18 14:29:56 [CRT] Plugins.vala:418: Not loading module /usr/lib/i386-linux-gnu/shotwell/plugins/builtin/shotwell-publishing-extras.so (SPIT 0): module with name "org.yorba.shotwell.publishing.extras" already loaded ** ERROR:/build/shotwell-t5uaby/shotwell-0.26.4/src/db/DatabaseTable.vala:341:database_table_add_column: assertion failed: (res == Sqlite.OK) Aborted (core dumped) ======================== Shotwell 0.26.4 log file when invoked against newly created empty 0.7.2 photo.db: ========================= cat ./.cache/shotwell/shotwell.log L 3868 2017-11-18 14:29:55 [MSG] main.vala:385: Shotwell Photo Manager 0.26.4 (5bd7d9a736997289de10c3bcdbaa089955e46233)^M L 3868 2017-11-18 14:29:55 [DBG] main.vala:393: Shotwell is running in timezone PST^M L 3868 2017-11-18 14:29:55 [DBG] Plugins.vala:316: Searching /home/testshot/.local/share/shotwell/plugins for plugins…^M L 3868 2017-11-18 14:29:55 [DBG] Plugins.vala:135: Unable to search directory /home/testshot/.local/share/shotwell/plugins for plugins: Error opening directory '/home/testshot/.local/share/shotwell/plugins': No such file or directory^M L 3868 2017-11-18 14:29:55 [DBG] Plugins.vala:316: Searching /usr/lib/i386-linux-gnu/shotwell/plugins for plugins…^M L 3868 2017-11-18 14:29:55 [DBG] Plugins.vala:316: Searching /usr/lib/i386-linux-gnu/shotwell/plugins/builtin for plugins…^M L 3868 2017-11-18 14:29:56 [DBG] shotwell-publishing.vala:22: Looking for resources in /usr/lib/i386-linux-gnu/shotwell/plugins/builtin^M L 3868 2017-11-18 14:29:56 [DBG] shotwell-publishing.vala:23: Found 4 authenicators^M L 3868 2017-11-18 14:29:56 [DBG] Plugins.vala:424: Loaded SPIT module "Core Publishing Services 0.26.4" (org.yorba.shotwell.publishing.core_services) [/usr/lib/i386-linux-gnu/shotwell/plugins/builtin/shotwell-publishing.la]^M L 3868 2017-11-18 14:29:56 [DBG] Plugins.vala:424: Loaded SPIT module "Core Slideshow Transitions 0.26.4" (org.yorba.shotwell.transitions) [/usr/lib/i386-linux-gnu/shotwell/plugins/builtin/shotwell-transitions.la]^M L 3868 2017-11-18 14:29:56 [CRT] Plugins.vala:418: Not loading module /usr/lib/i386-linux-gnu/shotwell/plugins/builtin/shotwell-transitions.so (SPIT 0): module with name "org.yorba.shotwell.transitions" already loaded^M L 3868 2017-11-18 14:29:56 [DBG] shotwell-publishing.vala:22: Looking for resources in /usr/lib/i386-linux-gnu/shotwell/plugins/builtin^M L 3868 2017-11-18 14:29:56 [DBG] shotwell-publishing.vala:23: Found 4 authenicators^M L 3868 2017-11-18 14:29:56 [CRT] Plugins.vala:418: Not loading module /usr/lib/i386-linux-gnu/shotwell/plugins/builtin/shotwell-publishing.so (SPIT 0): module with name "org.yorba.shotwell.publishing.core_services" already loaded^M L 3868 2017-11-18 14:29:56 [DBG] Plugins.vala:424: Loaded SPIT module "Core Data Import Services 0.26.4" (org.yorba.shotwell.data_imports.core_services) [/usr/lib/i386-linux-gnu/shotwell/plugins/builtin/shotwell-data-imports.so]^M L 3868 2017-11-18 14:29:56 [DBG] Plugins.vala:424: Loaded SPIT module "Shotwell Extra Publishing Services 0.26.4" (org.yorba.shotwell.publishing.extras) [/usr/lib/i386-linux-gnu/shotwell/plugins/builtin/shotwell-publishing-extras.la]^M L 3868 2017-11-18 14:29:56 [CRT] Plugins.vala:418: Not loading module /usr/lib/i386-linux-gnu/shotwell/plugins/builtin/shotwell-data-imports.la (SPIT 0): module with name "org.yorba.shotwell.data_imports.core_services" already loaded^M L 3868 2017-11-18 14:29:56 [CRT] Plugins.vala:418: Not loading module /usr/lib/i386-linux-gnu/shotwell/plugins/builtin/shotwell-publishing-extras.so (SPIT 0): module with name "org.yorba.shotwell.publishing.extras" already loaded^M L 3868 2017-11-18 14:29:56 [MSG] main.vala:43: Verifying database…^M L 3868 2017-11-18 14:29:56 [DBG] Db.vala:40: Database schema version 8 created by app version 0.7.2^M L 3868 2017-11-18 14:29:56 [MSG] Db.vala:71: Upgrading database from schema version 8 to 20^M L 3868 2017-11-18 14:29:56 [MSG] Db.vala:183: upgrade_database: adding metadata_dirty column to PhotoTable^M L 3868 2017-11-18 14:29:56 [MSG] Db.vala:209: upgrade_database: adding primary_source_id column to EventTable^M L 3868 2017-11-18 14:29:56 [MSG] Db.vala:234: upgrade_database: adding developer column to PhotoTable^M L 3868 2017-11-18 14:29:56 [MSG] Db.vala:240: upgrade_database: adding develop_shotwell_id column to PhotoTable^M L 3868 2017-11-18 14:29:56 [MSG] Db.vala:246: upgrade_database: adding develop_camera_id column to PhotoTable^M L 3868 2017-11-18 14:29:56 [MSG] Db.vala:252: upgrade_database: adding develop_embedded_id column to PhotoTable^M L 3868 2017-11-18 14:29:56 [MSG] Db.vala:303: upgrade_database: adding comment column to PhotoTable^M L 3868 2017-11-18 14:29:56 [MSG] Db.vala:308: upgrade_database: adding comment column to VideoTable^M ==================================== Note that the original 0.7.2 database ./.shotwell/data/photo.db contains only four main tables: EventTable, PhotoTable, TagTable, and VersionTable. ie there is no_ VideoTable, and the VersionTable contains : id:1 schema_version:8 app_version 0.7.2 user_data: null After the attempt to invoke shotwell 0.26.4 against the original 0.7.2 photo.db, the photo.db has moved to ./.local/share/shotwell/data/photo.db , but still contains only the fours same tables: EventTable, PhotoTable, TagTable, and VersionTable, and the VersionTable still contains: id:1 schema_version:8 app_version 0.7.2 user_data: null And yes, still no VideoTable.
If you could attach the freshly created db from 0.7.2, that would be awesome. THen I could just debug it. I don't have the environment around to build a 0.7.2
Created attachment 364016 [details] newly ctrated shotwell 0.7.2 photo.db with no photos--before upgrade attempt As requested, attached is the original photo.db created by shotwell 0.7.2. Thanks for offering to look into this issue for me. --Spike
Created attachment 365462 [details] [review] Fix upgrading from Shotwell 0.7.2 There was a check missing for the existence of VideoTable
Created attachment 365463 [details] [review] Fix type of primary_source_id table on upgrade This is TEXT now, not INTEGER
Attachment 365462 [details] pushed as 7f932b0 - Fix upgrading from Shotwell 0.7.2 Attachment 365463 [details] pushed as 7d3034f - Fix type of primary_source_id table on upgrade