Bug 432531 - After running DB maintenance digiKam won't start can't connect to DB then crashes
Summary: After running DB maintenance digiKam won't start can't connect to DB then cra...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Engine (show other bugs)
Version: 7.2.0
Platform: macOS (DMG) macOS
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-05 10:49 UTC by benjcmin
Modified: 2021-02-12 22:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 7.2.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description benjcmin 2021-02-05 10:49:23 UTC
SUMMARY
After running some DB maintenance via the Tools > Maintenance Digikam won't start can't connect to DB

Reconneting fails and after that Digikam won't start at all. It crashes. 


Error Message:
Details: Die Datenbank-Initialisierung kann nicht gestartet werden.
Programm: /Applications/digiKam.org/digikam.app/Contents/lib/mariadb/bin/mysql_install_db
Argumente: --defaults-file=/Applications/digiKam.org/digikam.app/Contents/Resources/digikam/database/mysql-global.conf, --basedir=/Applications/digiKam.org/digikam.app/Contents/, --datadir=/Users/benjcmin/Pictures/Datenbanken/DigiKam/.mysql.digikam/db_data
Prozess-Fehler: Unknown error

Terminal output:
digikam.databaseserver: "Die Datenbank-Initialisierung kann nicht gestartet werden."
digikam.databaseserver: Executable: "/Applications/digiKam.org/digikam.app/Contents/lib/mariadb/bin/mysql_install_db"
digikam.databaseserver: Arguments: "--defaults-file=/Applications/digiKam.org/digikam.app/Contents/Resources/digikam/database/mysql-global.conf, --basedir=/Applications/digiKam.org/digikam.app/Contents/, --datadir=/Users/benjcmin/Pictures/Datenbanken/DigiKam/.mysql.digikam/db_data"
digikam.databaseserver: Stdout: "\nFATAL ERROR: Could not find my_print_defaults\n\nThe following directories were searched:\n\n    /Applications/digiKam.org/digikam.app/Contents//bin\n    /Applications/digiKam.org/digikam.app/Contents//extra\n\nIf you compiled from source, you need to either run 'make install' to\ncopy the software into the correct location ready for operation.\nIf you don't want to do a full install, you can use the --srcdir\noption to only install the mysql database and privilege tables.\n\nIf you are using a binary release, you must either be at the top\nlevel of the extracted archive, or pass the --basedir option\npointing to that location.\n\nThe latest information about mysql_install_db is available at\nhttps://mariadb.com/kb/en/installing-system-tables-mysql_install_db\n"
digikam.databaseserver: Stderr: ""
digikam.databaseserver: Exit code: 1
digikam.databaseserver: Process error: "Unknown error"
digikam.databaseserver: Cannot start internal database server


SOFTWARE/OS VERSIONS
macOS: 10.15.7 
Digikam: digiKam-7.2.0-rc-20210204T161941-MacOS-x86-64

Not able to get it up and running even with a new / empty installation.
Comment 1 benjcmin 2021-02-05 12:40:39 UTC
Forgot the MacOS error report which you get after Digikam crashes (I tried to narrow it down to the essential parts, I hope I got them right):

Process:               digikam [33427]
Path:                  /Applications/digiKam.org/digikam.app/Contents/MacOS/digikam
Identifier:            digikam
Version:               7.2.0 (7.2.0-rc)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           digikam [33427]
User ID:               501

Date/Time:             2021-02-05 11:35:53.432 +0100
OS Version:            Mac OS X 10.15.7 (19H512)
Report Version:        12
Anonymous UUID:        175E5624-9F37-76E9-3F20-44D023840F9D

Sleep/Wake UUID:       2E50CA02-AE89-4EED-807A-689A04F5149B

Time Awake Since Boot: 190000 seconds
Time Since Wake:       3100 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000010
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [33427]

VM Regions Near 0x10:
--> 
    __TEXT                 000000010d72f000-000000010d73f000 [   64K] r-x/r-x SM=COW  /Applications/digiKam.org/digikam.app/Contents/MacOS/digikam

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libdigikamcore.7.2.0.dylib    	0x000000010ef5f5b0 0x10e505000 + 10855856
1   libdigikamcore.7.2.0.dylib    	0x000000010ef624e5 Digikam::BdEngineBackend::status() const + 21
2   libdigikamgui.7.2.0.dylib     	0x000000010d778535 0x10d748000 + 197941
3   libdigikamgui.7.2.0.dylib     	0x000000010d8e7b54 Digikam::FaceDbAccess::FaceDbAccess() + 116
4   libdigikamgui.7.2.0.dylib     	0x000000010d8e7bd5 Digikam::FaceDbAccess::FaceDbAccess() + 21
5   libdigikamgui.7.2.0.dylib     	0x000000010d8de8ec 0x10d748000 + 1665260
6   libdigikamgui.7.2.0.dylib     	0x000000010d8dd17b 0x10d748000 + 1659259
7   libdigikamgui.7.2.0.dylib     	0x000000010d8dd12a Digikam::OpenCVDNNFaceRecognizer::OpenCVDNNFaceRecognizer(Digikam::OpenCVDNNFaceRecognizer::Classifier) + 58
8   libdigikamgui.7.2.0.dylib     	0x000000010d8dd1ab Digikam::OpenCVDNNFaceRecognizer::OpenCVDNNFaceRecognizer(Digikam::OpenCVDNNFaceRecognizer::Classifier) + 27
9   libdigikamgui.7.2.0.dylib     	0x000000010d8cb6ea 0x10d748000 + 1586922
10  libdigikamgui.7.2.0.dylib     	0x000000010d8cb9c5 0x10d748000 + 1587653
11  libdigikamgui.7.2.0.dylib     	0x000000010d8ca53a Digikam::FacialRecognitionWrapper::FacialRecognitionWrapper() + 58
12  libdigikamgui.7.2.0.dylib     	0x000000010d8ca5a5 Digikam::FacialRecognitionWrapper::FacialRecognitionWrapper() + 21
13  libdigikamgui.7.2.0.dylib     	0x000000010dc80fbe 0x10d748000 + 5476286
14  libdigikamgui.7.2.0.dylib     	0x000000010dc8104d 0x10d748000 + 5476429
15  libdigikamgui.7.2.0.dylib     	0x000000010dc6179c 0x10d748000 + 5347228
16  libdigikamgui.7.2.0.dylib     	0x000000010d7f6587 0x10d748000 + 714119
17  libdigikamgui.7.2.0.dylib     	0x000000010d7f77fd 0x10d748000 + 718845
18  libdigikamgui.7.2.0.dylib     	0x000000010d879104 0x10d748000 + 1249540
19  libdigikamgui.7.2.0.dylib     	0x000000010d87aa9d 0x10d748000 + 1256093
20  libdigikamgui.7.2.0.dylib     	0x000000010d862549 0x10d748000 + 1156425
21  libdigikamgui.7.2.0.dylib     	0x000000010d866425 0x10d748000 + 1172517
22  libdigikamgui.7.2.0.dylib     	0x000000010d792f36 Digikam::DigikamApp::setupView() + 198
23  libdigikamgui.7.2.0.dylib     	0x000000010d77938f Digikam::DigikamApp::DigikamApp() + 3583
24  digikam                       	0x000000010d73a8ac 0x10d72f000 + 47276
25  libdyld.dylib                 	0x00007fff6e3edcc9 start + 1


Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x0000000000000000  rcx: 0x0000000000000001  rdx: 0x000000010d8de8e3
  rdi: 0x0000000000000000  rsi: 0x00000000ffffffff  rbp: 0x00007ffee24ce610  rsp: 0x00007ffee24ce600
   r8: 0x0000000000000001   r9: 0x0000000000000701  r10: 0x0000000115b68cb8  r11: 0x000000010ef624d0
  r12: 0x0000000000000000  r13: 0x0000000000000000  r14: 0x0000000000000000  r15: 0x0000000000000000
  rip: 0x000000010ef5f5b0  rfl: 0x0000000000010206  cr2: 0x0000000000000010

Logical CPU:     1
Error Code:      0x00000004 (no mapping for user data read)
Trap Number:     14
Comment 2 Maik Qualmann 2021-02-05 12:54:49 UTC
For whatever reason your database seems to be destroyed because digiKam tries to start "mysql_install_db". It also doesn't seem to find the path to "my_print_defaults" of a MySQL component. I think you will have to start with a completely new DB. It is no longer possible to repair the DB.

Maik
Comment 3 benjcmin 2021-02-05 12:58:08 UTC
Sure if it be like that, thats ok but I still can't start fresh. From my perspective I cleaned up every conf file etc but after installing Digikam again, I get the same errors. 
So what do I need to delete to get a fresh start?
Comment 4 Maik Qualmann 2021-02-05 13:05:05 UTC
I think the missing file is a bug from the MacOS bundle. I think I remember that we even fixed the problem after restructuring the MacOS bundle. Gilles needs to look into this. 

Maik
Comment 5 benjcmin 2021-02-08 19:46:41 UTC
After using the new 7.2.0 rc the crashing on startup seems to be fixed. I need to start over, as I couldn't get the backuped DB to work. Maybe it was even corrupt before but the fatal error was triggert by using the DB maintenance.