Mid transfer service stop

So been using Orthanc for a while now and up to (literally) an hour ago, I have had zero issues. Love this software. I have however, found an issue that (I believe) 1.11.1 fixes but I am not sure (I read the release notes) and I am hoping there is a short answer to this.

The scenario: I have a computer sending several dicoms to my server. While the dicoms are being sent, I had to stop the Orthanc service so I could make some config changes. Well, I go to start that service and it will not due to a SQL locked error.

I am able to reproduce this error on demand and I figured that while the server is “receiving” data that the SQL DB is in a locked state so it can be written to. I am assuming that when you stop the service, it does not get a chance to finish what it was designed to do, therefore the SQL DB stays locked.

When I go to start the service, it gives me this error: E0707 17:55:41.928936 StatementReference.cpp:88] SQLite: database is locked (5)

Aside from making sure that there are no dicoms coming into the server, is there a way to avoid this from happening? Most PC’s that send to me have a job queue and if for some reason I have to stop the service, I would like for some way to restart it again successfully without having to restart the PC, which is currently the only way for me to restart Orthanc when this happens.

Thank you for any help.


Hi Craig,

First thing: 1.11.1 will not solve that.

Everytime I see this message, There is really still a process locking the file, very likely the old Orthanc process.

I think that the Orthanc that you just tried to stop is still running trying to finish the current step of a job ? I could reproduce that with a Lua HeartBeat of 21 seconds in which it sleeps for 20 seconds → Orthanc will require 20 seconds to exit when I stop the service and I’m unable to restart a new Orthanc Service in the meantime.

I think that this happens because the Orthanc Service does not correctly detect that Orthanc is still running. I quite often get this error messages when stopping the service:

I’ll try to investigate this error message but not immediately …
Note that, once this is fixed, stopping the service will require more time because it will wait until Orthanc really has finished his current job step.

Best regards,


Hi Alan

According to my experience in the use of Orthanc in a Windows environment, the error shown is given when ordering to stop a server that has many studies stored or studies with many images, with lighter servers it does not give that error.

I think the important thing is that, even with the error notification, the Orthanc server does stop. At least in Windows, when the Orthanc service is ordered to stop, at that very moment the reception of images is blocked, so the medical equipment and other computers stop sending them.

In my personal case, I have an executable that I use daily to back up the index files off the server. This executable stops the Orthanc service, copies the index files to an external drive, and when finished starts the Orthanc service again. Even with the indicated error message, the copy is made perfectly and without errors and if someone was sending information to the server at that time, in the next re-send, either manually or automatically, the images continue to be received without problem. I do this procedure daily, in 4 Orthanc servers but using SQlite, I don’t know if using a different indexer (for example Mysql) the indexed could present some failure.