Bug 472438

Summary: Failed to update the database schema from version 15 to version 16.
Product: [Applications] digikam Reporter: Chris <crglasoe>
Component: Database-SchemaAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: crash CC: caulier.gilles, markus, metzpinguin
Priority: NOR    
Version First Reported In: 8.0.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 8.8.0
Sentry Crash Report:

Description Chris 2023-07-20 16:01:30 UTC
I am trying to use Digikam. Each time I start I receive the following:

Failed to update the database schema from version 15 to version 16.
Please read the error messages printed on the console and report this error as a bug at bugs.kde.org.

EXPECTED RESULT
Digikam would open.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version:  5.27.6
KDE Frameworks Version: 5.108.0
Qt Version: 5.15.0
Kernel Version: 6.4.3-1 default (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
Comment 1 Chris 2023-07-20 16:04:12 UTC
Not sure if I am posting this in the right category
Comment 2 Maik Qualmann 2023-07-20 16:16:47 UTC
What type of database are you using, MySQL or SQLite? Please start digiKam in a terminal, set the Debug Qt variable beforehand:

export QT_LOGGING_RULES="digikam*=true"
digikam

 Please post the complete output in the terminal.

Maik
Comment 3 Maik Qualmann 2023-07-22 16:59:22 UTC
Without the debug output from the terminal/console we can't help. The problem has not been reported so far, it is also a relatively "simple" database update, which normally should not cause any problems. Please provide the log.

Maik
Comment 4 Maik Qualmann 2023-07-28 09:44:33 UTC
We cannot help without feedback.

Maik
Comment 5 Bug Janitor Service 2023-08-12 03:45:14 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Bug Janitor Service 2023-08-27 03:45:20 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!
Comment 7 Markus 2025-10-07 10:45:34 UTC
Hi. It seems I'm a distinct guy stumbled over the very same issue with my system configured as follows:

---
OS: Ubuntu 24.04.3 LTS x86_64
Kernel: 6.14.0-33-generic
DE: KDE 5.115.0 / Plasma 5.27.12
Session: Wayland
App: digikam 8.2.0
---

Here I'd like to provide my log, as @Maik suggested to do:

---
digikam.qtav: Register QtAV Renderers:
digikam.qtav:    Qt have no OpenGL support.
digikam.qtav:    register QtAV::OpenGLWidget Renderer: true
digikam.qtav:    QtAV have OpenGL support.
digikam.qtav:    register QtAV::QGLWidget Renderer: true
digikam.qtav:    register QtAV::QGLWidget2 Renderer: true
digikam.qtav:    register QtAV::Widget Renderer: true
digikam.qtav:    QtAV have XVideo support.
digikam.qtav:    register QtAV::XV Renderer: true
digikam.qtav:    QtAV have X11 support.
digikam.qtav:    register QtAV::X11 Renderer: true
digikam.qtav:    register QtAV::GraphicsItem Renderer: true
digikam.widgets: Use installed icons
digikam.general: AlbumWatch is disabled
digikam.general: Database Parameters:
   Type:                        "QSQLITE"
   DB Core Name:                "/home/markus/Pictures/digikam4.db"
   DB Thumbs Name:              "/home/markus/Pictures/thumbnails-digikam.db"
   DB Face Name:                "/home/markus/Pictures/recognition.db"
   DB Similarity Name:          "/home/markus/Pictures/similarity.db"
   Connect Options:             ""
   Host Name:                   ""
   Host Port:                   -1
   WAL Mode:                    true
   Internal Server:             false
   Internal Server Path:        ""
   Internal Server Init Cmd:    ""
   Internal Server Admin Cmd:   ""
   Internal Server Server Cmd:  ""
   Internal Server Upgrade Cmd: ""
   Username:                    ""
   Password:                    ""

digikam.dbengine: Loading SQL code from config file "/usr/share/digikam/database/dbconfig.xml"
digikam.dbengine: Checking XML version ID => expected:  3  found:  3
digikam.dbengine: WAL mode is enabled for "digikam4.db"
digikam.coredb: Core database: running schema update
digikam.coredb: Core database: have a structure version  15
digikam.coredb: Core database: makeUpdates  15  to  16
digikam.dbengine: Failure executing query:
 "" 
Error messages: "Unable to execute statement" "duplicate column name: caseSensitivity" "1" 2 
Bound values:  ()
digikam.dbengine: Error while executing DBAction [ "UpdateSchemaFromV15ToV16" ] Statement [ "ALTER TABLE AlbumRoots ADD caseSensitivity INTEGER;" ]
digikam.coredb: Core database: schema update to V 16 failed!
digikam.coredb: Core database: cannot process schema initialization
qt.qpa.wayland: Wayland does not support QWindow::requestActivate()
digikam.general: Allowing a cache size of 1024 MB
QThreadStorage: Thread 0x7ca97e071c20 exited after QThreadStorage 13 destroyed
---
Comment 8 Maik Qualmann 2025-10-07 11:23:36 UTC
We won't be able to determine why the "caseSensitivity" column already exists in your "AlbumRoot" table. Have you tried digiKam test versions? Install the SQLiteBrowser, open the digikam4.db file, go to the "AlbumRoot" table, delete the "caseSensitivity" column, and save your changes.
Restart digiKam to perform the database update.
One more note: digiKam-8.2.0 is already quite old...

Maik
Comment 9 Markus 2025-10-07 14:25:22 UTC
> We won't be able to determine why the "caseSensitivity" column already
> exists in your "AlbumRoot" table. Have you tried digiKam test versions?
Indeed, I used to be a distro hopper, but decided to settle down with Kubuntu LTS, now.

> Install the SQLiteBrowser, open the digikam4.db file, go to the "AlbumRoot"
> table, delete the "caseSensitivity" column, and save your changes.
> Restart digiKam to perform the database update.
I did as you said and it worked. I can use digikam again. Thanks a lot <3

> One more note: digiKam-8.2.0 is already quite old...
That's the downside that comes with a LTS system I am willing to accept.