Error upgrading SQLite database

Hi all, I was trying to upgrade an 0.8.6 Orthanc to the latest 0.9.5, as suggested by the command line, I run the binary with the --upgrade option … but get this:

root@srvpacs:~# /usr/local/sbin/Orthanc --upgrade --verbose /root/orthanc.json
W1204 21:28:51.501792 main.cpp:1102] Orthanc version: 0.9.5
W1204 21:28:51.507057 OrthancInitialization.cpp:128] Reading the configuration from: “/root/orthanc.json”
W1204 21:28:51.508453 HttpClient.cpp:386] No certificates are provided to validate peers, set “HttpsCACertificates” if you need to do HTTPS requests
W1204 21:28:51.509936 FromDcmtkBridge.cpp:200] Loading the embedded dictionaries
W1204 21:28:51.558795 OrthancInitialization.cpp:399] Registering JPEG Lossless codecs
W1204 21:28:51.558869 OrthancInitialization.cpp:404] Registering JPEG codecs
W1204 21:28:51.600024 main.cpp:618] Loading plugin(s) from: /root
I1204 21:28:51.600127 PluginsManager.cpp:283] Scanning folder /root for plugins
W1204 21:28:51.600308 OrthancInitialization.cpp:885] SQLite index directory: “/home/orthanc/storage”
W1204 21:28:51.699709 OrthancInitialization.cpp:955] Storage directory: “/home/orthanc/storage”
I1204 21:28:51.754967 DatabaseWrapper.cpp:307] Version of the Orthanc database: 5
W1204 21:28:51.755059 main.cpp:836] Upgrading the database from schema version 5 to 6
W1204 21:28:51.755175 DatabaseWrapper.cpp:371] Upgrading database version from 5 to 6
W1204 21:28:51.755213 ServerToolbox.cpp:309] Upgrade: Reconstructing the main DICOM tags of all the patients…
E1204 21:29:55.690202 main.cpp:1141] Uncaught exception, stopping now: [Bad file format] (code 15)
W1204 21:29:55.788865 main.cpp:1174] Orthanc has stopped

Any hit about what’s happening ?

Hello,

I am unable to reproduce this problem, upgrade from 0.8.6 to 0.9.5 should work. This most probably reflects a file that is corrupted.

In the case automated upgrade fails, please follow the replication instructions in the Orthanc Book:
https://orthanc.chu.ulg.ac.be/book/users/replication.html

If you are a developer, would it be possible for you to send a screenshot of the backtrace that leads to the exception (using either gdb, Visual Studio or any IDE)? This could help me to spot the source of the problem.

HTH,
Sébastien-

Hello,

This discussion with Raúl led to the detection of a bug inside Orthanc, that is now fixed in the mainline:
https://bitbucket.org/sjodogne/orthanc/commits/9b458e4484a12d43d638180ffc570c85881981c5

A maintenance release including this fix will soon follow.

Sébastien-