Bug 435387 - Crashes after not able to connect to database
Summary: Crashes after not able to connect to database
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Engine (show other bugs)
Version: 7.2.0
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-05 15:09 UTC by Wessel
Modified: 2021-04-05 19:22 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 7.3.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wessel 2021-04-05 15:09:31 UTC
SUMMARY

After installation I try to run digiKam.  It gives an error while opening the database, then try to reconnect until I click "Cancel.  

STEPS TO REPRODUCE
1. Do a fresh installation of Digikam (7.2.0) on Windows 10, after I downloaded the installation package.
2. Run DigiKam.  It gives an "error while opening the database", and tries to reconnect until I click "Cancel".  
3. It then responds with an error "Failed to open the database", saying that it will attempt to start, even tholugh it won't be functional.  I click OK.
4. The splacreen opens up, but it crashes shortly afterwards, sending an error report to Microsoft.

OBSERVED RESULT
DigiKam does not open

EXPECTED RESULT
DigiKam should connect to db and open.


SOFTWARE/OS VERSIONS
Windows: 10 Home, build 19041.867
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
The Readme after installation mentions "Internal database server require to install localy a database backend for Windows, as Mysql or MariaDB." I am not sure if this menas that the installation package would do it, or if the user need to do it manually?
Comment 1 Maik Qualmann 2021-04-05 15:26:26 UTC
If you start with digiKam, first select SQLite as the database backend. SQLite is nowhere near as much worse than MySQL to start with. Yes, MySQL requires an additional installation, e.g. from the MariaDB server.

Maik
Comment 2 Wessel 2021-04-05 15:44:17 UTC
(In reply to Maik Qualmann from comment #1)
> If you start with digiKam, first select SQLite as the database backend.
> SQLite is nowhere near as much worse than MySQL to start with. Yes, MySQL
> requires an additional installation, e.g. from the MariaDB server.
> 
> Maik

Thanks for the reply Maik.  My current issue is that it crashes before I get an opportunity to set a database.  Is there a config file that I can edit (set to the correct db) before I start digiKam?
Comment 3 Maik Qualmann 2021-04-05 15:45:44 UTC
Upload the DebugView Log so that we can see which configuration you are using, as described here for Windows:

https://www.digikam.org/contribute/

Don't forget to set the debug environment variable.

Maik
Comment 4 Maik Qualmann 2021-04-05 15:49:07 UTC
You can also start a new configuration by renaming or deleting the "digikamrc":

C:\Users\%USERNAME%\AppData\Local\digikamrc

Maik
Comment 5 Maik Qualmann 2021-04-05 15:52:13 UTC
I wonder how it is possible to create an invalid database configuration in the first setup? We test everything, path available, path writable, binary files available for MySQL, etc. The setup cannot be completed without a valid configuration.

Maik
Comment 6 Wessel 2021-04-05 16:05:03 UTC
(In reply to Maik Qualmann from comment #4)
> You can also start a new configuration by renaming or deleting the
> "digikamrc":
> 
> C:\Users\%USERNAME%\AppData\Local\digikamrc
> 
> Maik

I have deleted the existing digikamrc file, and digikam started successfully afterwards..  I had previously had a previous version of digikam installed, and thought I had removed all previous files - it could be possible that this file still remained.

I have a backup of the file before I deleted it, if it would still help (or otherwise close this issue as "user error").
Comment 7 Wessel 2021-04-05 16:07:52 UTC
I makes sense now: my HD had crashed a few months ago, and the dcirectory structure (users) was slightly different after the rebuilt.  The path under the database settings in the digikamrc file did not exist any more.
Comment 8 Maik Qualmann 2021-04-05 19:22:31 UTC
Git commit f4c918d254a47c2dc7b15c3705ba8273d82bcf3e by Maik Qualmann.
Committed on 05/04/2021 at 19:20.
Pushed by mqualmann into branch 'master'.

show database settings dialog when database not found
FIXED-IN: 7.3.0

M  +51   -34   core/libs/album/manager/albummanager_database.cpp

https://invent.kde.org/graphics/digikam/commit/f4c918d254a47c2dc7b15c3705ba8273d82bcf3e