Orthanc (SQLite: unable to open database)

906 views
Skip to first unread message

Jonathan Vervaeke

unread,
Nov 19, 2021, 7:19:41 AM11/19/21
to Orthanc Users
Hello!
Running Orthanc v1.9.7 on ubuntu 18.04.
When I start Orthanc (via the /etc/init.d/orthanc startup script), it exists due to a SQL database error. Can somebody provide a pointer on what is wrong?

/etc/orthanc/OrthancStorage is an empty folder. Will Orthanc make the database? Should there be a file it expects? Or am I missing a (database?) library?

Thanks for your help,
Log below.
Jonathan.

---------------------------
W1119 13:10:03.006432 main.cpp:1956] Orthanc version: 1.9.7
I1119 13:10:03.006457 main.cpp:1988] Architecture: 64-bit, little endian
W1119 13:10:03.006497 OrthancConfiguration.cpp:117] Scanning folder "/etc/orthanc/" for configuration files   
W1119 13:10:03.006523 OrthancConfiguration.cpp:66] Reading the configuration from: "/etc/orthanc/orthanc.json"
I1119 13:10:03.007039 Toolbox.cpp:1488] Setting up the ICU common data                                           
I1119 13:10:03.179186 Toolbox.cpp:1467] Using locale: "en_US.UTF-8" for case-insensitive comparison of strings
I1119 13:10:03.179293 Toolbox.cpp:1759] OpenSSL version: OpenSSL 1.1.1k  25 Mar 2021                            
I1119 13:10:03.179466 FromDcmtkBridge.cpp:291] (dicom) Using DCTMK version: 366                                   
I1119 13:10:03.179494 FromDcmtkBridge.cpp:299] (dicom) Loading the embedded dictionaries                      
I1119 13:10:03.188754 FromDcmtkBridge.cpp:311] (dicom) Loading the embedded dictionary of private tags        
I1119 13:10:03.193491 FromDcmtkBridge.cpp:2293] (dicom) Registering JPEG Lossless codecs in DCMTK                 
I1119 13:10:03.193504 FromDcmtkBridge.cpp:2301] (dicom) Registering JPEG codecs in DCMTK                
I1119 13:10:03.193515 FromDcmtkBridge.cpp:2308] (dicom) Registering RLE codecs in DCMTK              
I1119 13:10:03.193529 Enumerations.cpp:2315] Default encoding for DICOM was changed to: Latin1      
I1119 13:10:03.197275 OrthancInitialization.cpp:332] Your platform does not support mallopt(), ignoring configuration option "MallocArenaMax"
W1119 13:10:03.197345 OrthancInitialization.cpp:358] SQLite index directory: "/etc/orthanc/OrthancStorage"                 
E1119 13:10:03.197444 main.cpp:2013] Uncaught exception, stopping now: [SQLite: Unable to open the database] (code 1002)
W1119 13:10:03.197454 main.cpp:2044] Orthanc has stopped
---------------------------


Alain Mazy

unread,
Nov 19, 2021, 8:13:16 AM11/19/21
to jonathan...@xeos.care, Orthanc Users
Hi,

Orthanc will create the DB when starting.  Here, I see it's trying to create it in /etc/orthanc/OrthancStorage and might not have the correct rights to do so.

I would advise you to use an absolute path for the "StorageDirectory" in your orthanc.json file.

HTH

Alain

--
You received this message because you are subscribed to the Google Groups "Orthanc Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orthanc-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orthanc-users/0f5e0bea-9e11-4048-aa38-a62035aeb079n%40googlegroups.com.

Jonathan Vervaeke

unread,
Nov 19, 2021, 8:15:12 AM11/19/21
to Alain Mazy, Orthanc Users
Thanks!
I figured it out, the OrthancStorage directory needs orthanc:orthanc user:group permissions, not root:root!
Thanks for your help,
Met vriendelijke groeten,
Kind regards,

Jonathan Vervaeke
Software Engineer

M +32 498 111 926



From: orthan...@googlegroups.com <orthan...@googlegroups.com> on behalf of Alain Mazy <alain...@osimis.io>
Sent: Friday, 19 November 2021 14:13
To: Jonathan Vervaeke <jonathan...@xeos.care>
Cc: Orthanc Users <orthan...@googlegroups.com>
Subject: Re: Orthanc (SQLite: unable to open database)
 
You received this message because you are subscribed to a topic in the Google Groups "Orthanc Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orthanc-users/EiRSrj3x83I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orthanc-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orthanc-users/CAHYKtyS17s6GQrHjHKC9_d-nfdNvxm78zLCohEoTcrkrU7ZFvg%40mail.gmail.com.

Dinesh Kumar Yadav

unread,
Apr 5, 2022, 7:01:44 AM4/5/22
to Orthanc Users
Hi Jonathan and Alain,

Can you elaborate a little more on the solution as I am also facing the same error on some machines when starting Orthanc from docker-compose.yml using command docker-compose up

SQLite index directory: "/etc/orthanc/OrthancStorage"                 

Uncaught exception, stopping now: [SQLite: Unable to open the database] (code 1002)
Orthanc has stopped

Thanks

Alain Mazy

unread,
Apr 5, 2022, 9:13:32 AM4/5/22
to Dinesh Kumar Yadav, Orthanc Users
Hi Dinesh,

Likely an invalid path or permission issues.

I would advise you to start from this working example and then modify it step by step: https://bitbucket.org/osimis/orthanc-setup-samples/src/master/docker/postgresql/

HTH

Alain.

Reply all
Reply to author
Forward
0 new messages