After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 790469 - 0.7.2->0.26.4 shotwell DB upgrade fails: Db.vala:308: upgrade_database: adding comment column to VideoTable
0.7.2->0.26.4 shotwell DB upgrade fails: Db.vala:308: upgrade_database: addin...
Status: RESOLVED FIXED
Product: shotwell
Classification: Other
Component: general
0.26.x
Other Linux
: Normal normal
: ---
Assigned To: Shotwell Maintainers
Shotwell Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-11-17 00:30 UTC by Spike
Modified: 2017-12-12 19:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
newly ctrated shotwell 0.7.2 photo.db with no photos--before upgrade attempt (10.00 KB, application/x-sqlite3)
2017-11-19 23:59 UTC, Spike
  Details
Fix upgrading from Shotwell 0.7.2 (1.05 KB, patch)
2017-12-12 19:48 UTC, Jens Georg
committed Details | Review
Fix type of primary_source_id table on upgrade (973 bytes, patch)
2017-12-12 19:48 UTC, Jens Georg
committed Details | Review

Description Spike 2017-11-17 00:30:34 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.
Comment 1 Spike 2017-11-17 00:57:54 UTC
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.
Comment 2 Jens Georg 2017-11-17 07:59:42 UTC
Can you provide the photo.db somehow?
Comment 3 Spike 2017-11-18 01:57:56 UTC
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
Comment 4 Spike 2017-11-18 23:40:54 UTC
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.
Comment 5 Jens Georg 2017-11-19 16:56:12 UTC
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
Comment 6 Spike 2017-11-19 23:59:36 UTC
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
Comment 7 Jens Georg 2017-12-12 19:48:32 UTC
Created attachment 365462 [details] [review]
Fix upgrading from Shotwell 0.7.2

There was a check missing for the existence of VideoTable
Comment 8 Jens Georg 2017-12-12 19:48:47 UTC
Created attachment 365463 [details] [review]
Fix type of primary_source_id table on upgrade

This is TEXT now, not INTEGER
Comment 9 Jens Georg 2017-12-12 19:50:31 UTC
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