Orthanc broke

Hi everyone!
I need help, my orthanc is broke…
He worked for more than two years, it has a lot of data…
Please help

W0916 16:52:02.538796 OrthancInitialization.cpp:301] SQLite index directory: “E:\ORTHANCSRVDIR\ORTHANC”

W0916 16:52:02.538796 OrthancInitialization.cpp:376] Storage directory: “E:\ORTHANCSRVDIR\DICOM”

E0916 16:52:02.550797 StatementReference.cpp:85] SQLite: database is locked (5)

W0916 16:52:02.550797 PluginsManager.cpp:219] Unregistering plugin ‘dicom-web’ (version 1.0)

W0916 16:52:02.559791 PluginsManager.cpp:219] Unregistering plugin ‘google-cloud-platform’ (version 1.0)

W0916 16:52:02.560792 PluginsManager.cpp:219] Unregistering plugin ‘mysql-index’ (version 2.0)

W0916 16:52:02.560792 PluginsManager.cpp:168] MySQL index is finalizing

W0916 16:52:02.560792 PluginsManager.cpp:219] Unregistering plugin ‘mysql-storage’ (version 2.0)

W0916 16:52:02.560792 PluginsManager.cpp:168] MySQL storage area is finalizing

W0916 16:52:02.561792 PluginsManager.cpp:219] Unregistering plugin ‘osimis-web-viewer’ (version 1.2.0.0-0d4bfbd5)

W0916 16:52:02.561792 PluginsManager.cpp:168] Finalizing the Web viewer

W0916 16:52:02.569790 PluginsManager.cpp:219] Unregistering plugin ‘postgresql-index’ (version 3.2)

W0916 16:52:02.570792 PluginsManager.cpp:168] PostgreSQL index is finalizing

W0916 16:52:02.570792 PluginsManager.cpp:219] Unregistering plugin ‘postgresql-storage’ (version 3.2)

W0916 16:52:02.570792 PluginsManager.cpp:168] PostgreSQL storage area is finalizing

W0916 16:52:02.571791 PluginsManager.cpp:219] Unregistering plugin ‘serve-folders’ (version 1.5.7)

W0916 16:52:02.571791 PluginsManager.cpp:219] Unregistering plugin ‘transfers’ (version 1.0)

W0916 16:52:02.572792 PluginsManager.cpp:168] Transfers accelerator plugin is finalizing

W0916 16:52:02.572792 PluginsManager.cpp:219] Unregistering plugin ‘web-viewer’ (version 2.5)

W0916 16:52:02.572792 PluginsManager.cpp:168] Finalizing the Web viewer

W0916 16:52:03.536817 PluginsManager.cpp:219] Unregistering plugin ‘worklists’ (version 1.5.7)

W0916 16:52:03.536817 PluginsManager.cpp:168] Sample worklist plugin is finalizing

W0916 16:52:03.536817 PluginsManager.cpp:219] Unregistering plugin ‘wsi’ (version 0.6)

E0916 16:52:03.584827 main.cpp:1468] Uncaught exception, stopping now: [SQLite: Cannot prepare a cached statement] (code 1012)

W0916 16:52:03.585819 main.cpp:1501] Orthanc has stopped

I have only one Orthanc server.

I dont know how this happened, I dont want to lose all the data.
How can I restore the work of the Orthanc?

Thanks for the help!

I’m writing this off the top of my head so please forgive any inaccuracies.

A certain log says your SQLite os locked. It might be a simple .lock file or something more elaborate. But it seems simple enough to open / fix in a SQLite client. In essence, this is what’s killing the process, rendering Orthanc unusable.

That said, I believe the best course of action is setting up a PostgreSQL database to be used for index and store your images in the filesystem. For the PostgreSQL, you just need to create a blank db and configure Orthanc accordingly; remember:index in the database, storage in the filesystem, making sure it’s a new directory.

Sèbastien said in an old thread that you’re better off with PostgreSQL for indexes that hold more than some 50.000 images.

With this, run a storescu scanning directories recursively (+sd +r) sending the images to the new Orthanc instance. Note that you won’t need to run the old Orthanc. You’ll just need to make sure the images are in a brand new directory.

That should do the trick of getting your Orthanc back online.

Best,

Be careful with SQLlite journal files, do NOT delete them thinking they are locking your database.

It does seem something left the db in an unclean state, look into recovering the dabatabse. If that is not possible, you can try to rebuild it by starting orthanc without a db and resending everything. As always, keeping backups and restore strategies is important for any critical data.

Best of luck,

Thank you for reply!

Please tell me, if create a new database on PostgreSQL, then all my data will be transferred automatically?

No, the data will not be transferred. You either manage to recover the database, find a backup, or resend the dicom files (inside “E:\ORTHANCSRVDIR\DICOM”, per the logs) to a new orthanc instance.

Best,

And for sending the DICOM files, I would suggest to consider a fresh Orthanc installation, with a proper DB Plugin setup, on a different hard disk, and then follow “Direct access to the filesystem” in https://book.orthanc-server.com/users/replication.html

Good luck!

The most direct way to replicate an instance of Orthanc consists in usi

What I had in mind is that you’ll need a fresh install to upload your old files to. Maybe I wasn’t quite on that, my bad.

I see two options:

  1. Find the what is locking your SQLite database and manually unlock it.
  2. Create a fresh installation of Orthanc with a Database’d Index Backend and reimport everything. DICOM protocol is probably faster for this purpose.

Upside from this is that you already are on downtime. Which is both a curse and a blessing.

HTH,