Problem when restarting Orthanc via API /tools/reset

Hi,
I have an application on Django that interacts with Orthanc via the API. Sometimes it is necessary to restart Orthanc using the /tools/reset method, but the server does not rise. I get such errors in the logs at startup:

W0920 13:36:08.094874             MAIN OrthancConfiguration.cpp:109] Scanning folder "/pacs-config" for configuration files
W0920 13:36:08.099868             MAIN OrthancConfiguration.cpp:58] Reading the configuration from: "/pacs-config/credentials.json"
W0920 13:36:08.110576             MAIN OrthancConfiguration.cpp:58] Reading the configuration from: "/pacs-config/dicomweb.json"
W0920 13:36:08.121667             MAIN OrthancConfiguration.cpp:58] Reading the configuration from: "/pacs-config/orthanc.json"
W0920 13:36:08.136097             MAIN OrthancConfiguration.cpp:58] Reading the configuration from: "/pacs-config/postgresql.json"
W0920 13:36:08.140760             MAIN OrthancConfiguration.cpp:58] Reading the configuration from: "/pacs-config/serve-folders.json"
W0920 13:36:08.144613             MAIN OrthancConfiguration.cpp:58] Reading the configuration from: "/pacs-config/worklists.json"
I0920 13:36:08.148676             MAIN Toolbox.cpp:1577] Using locale: "en_US.UTF-8" for case-insensitive comparison of strings
I0920 13:36:08.149127             MAIN Toolbox.cpp:1873] OpenSSL version: OpenSSL 3.1.4
I0920 13:36:08.149291             MAIN FromDcmtkBridge.cpp:295] (dicom) Using DCMTK version: 368
I0920 13:36:08.150567             MAIN FromDcmtkBridge.cpp:303] (dicom) Loading the embedded dictionaries
I0920 13:36:08.171228             MAIN FromDcmtkBridge.cpp:315] (dicom) Loading the embedded dictionary of private tags
I0920 13:36:08.180787             MAIN FromDcmtkBridge.cpp:2473] (dicom) Registering JPEG Lossless codecs in DCMTK
I0920 13:36:08.181500             MAIN FromDcmtkBridge.cpp:2481] (dicom) Registering JPEG codecs in DCMTK
I0920 13:36:08.182005             MAIN FromDcmtkBridge.cpp:2488] (dicom) Registering RLE codecs in DCMTK
I0920 13:36:08.182487             MAIN Enumerations.cpp:2385] Default encoding for DICOM was changed to: Latin1
I0920 13:36:08.182754             MAIN FromDcmtkBridge.cpp:420] (dicom) Registering tag in dictionary: (7053,1003) LO MedicalCardNumber (multiplicity: 1-1)
W0920 13:36:08.183046             MAIN FromDcmtkBridge.cpp:434] Warning: You are registering a private tag (7053,1003), but no private creator was associated with it
I0920 13:36:08.183330             MAIN FromDcmtkBridge.cpp:420] (dicom) Registering tag in dictionary: (7053,1004) LO OriginalDeviceAET (multiplicity: 1-1)
W0920 13:36:08.183566             MAIN FromDcmtkBridge.cpp:434] Warning: You are registering a private tag (7053,1004), but no private creator was associated with it
I0920 13:36:08.183965             MAIN FromDcmtkBridge.cpp:420] (dicom) Registering tag in dictionary: (7053,1005) LO OriginalPatientID (multiplicity: 1-1)
I0920 13:36:08.184217             MAIN FromDcmtkBridge.cpp:420] (dicom) Registering tag in dictionary: (7053,1006) LO OriginalStudyUID (multiplicity: 1-1)
I0920 13:36:08.184642             MAIN OrthancInitialization.cpp:242] Configured Extra Main Dicom Tags for Instance:
I0920 13:36:08.186186             MAIN OrthancInitialization.cpp:262]   - MedicalCardNumber
I0920 13:36:08.186710             MAIN OrthancInitialization.cpp:242] Configured Extra Main Dicom Tags for Study:
I0920 13:36:08.188435             MAIN OrthancInitialization.cpp:262]   - MedicalCardNumber
I0920 13:36:08.197284             MAIN OrthancInitialization.cpp:397] Your platform does not support mallopt(), ignoring configuration option "MallocArenaMax"
W0920 13:36:08.199109             MAIN main.cpp:917] Loading plugin(s) from: /usr/share/orthanc/plugins/
I0920 13:36:08.199414             MAIN PluginsManager.cpp:293] (plugins) Scanning folder /usr/share/orthanc/plugins/ for plugins
I0920 13:36:08.202142             MAIN PluginsManager.cpp:316] (plugins) Found a shared library: "/usr/share/orthanc/plugins/libOrthancPostgreSQLStorage.so"
W0920 13:36:08.205931             MAIN PluginsManager.cpp:274] Registering plugin 'postgresql-storage' (version 6.2)
I0920 13:36:08.206401             MAIN PluginsManager.cpp:162] (plugins) OpenSSL version: OpenSSL 3.1.4
W0920 13:36:08.207384             MAIN PluginsManager.cpp:158] The PostgreSQL storage area is currently disabled, set "EnableStorage" to "true" in the "PostgreSQL" section of the configuration file of Orthanc
I0920 13:36:08.207727             MAIN PluginsManager.cpp:316] (plugins) Found a shared library: "/usr/share/orthanc/plugins/libModalityWorklists.so"
W0920 13:36:08.209156             MAIN PluginsManager.cpp:274] Registering plugin 'worklists' (version 1.12.4)
W0920 13:36:08.209540             MAIN worklists:/Plugin.cpp:229] Sample worklist plugin is initializing
W0920 13:36:08.210484             MAIN worklists:/Plugin.cpp:256] Worklist server is disabled by the configuration file
I0920 13:36:08.210766             MAIN PluginsManager.cpp:316] (plugins) Found a shared library: "/usr/share/orthanc/plugins/libOrthancPostgreSQLIndex.so"
W0920 13:36:08.215687             MAIN PluginsManager.cpp:274] Registering plugin 'postgresql-index' (version 6.2)
I0920 13:36:08.216457             MAIN PluginsManager.cpp:162] (plugins) OpenSSL version: OpenSSL 3.1.4
W0920 13:36:08.217418             MAIN PluginsManager.cpp:158] PostgreSQL: using SERIALIZABLE transaction mode
W0920 13:36:08.217750             MAIN PluginsManager.cpp:158] The index plugin will use 8 connection(s) to the database, and will retry up to 10 time(s) in the case of a collision
I0920 13:36:08.218058             MAIN OrthancPlugins.cpp:5764] (plugins) Plugin has registered a custom database back-end
I0920 13:36:08.218342             MAIN OrthancPluginDatabaseV4.cpp:1293] (plugins) Identifier of this Orthanc server for the global properties of the custom database: "e72637a9-49e1713b-d0bff64b-ed0502be-aa5450c6"
I0920 13:36:08.218689             MAIN PluginsManager.cpp:316] (plugins) Found a shared library: "/usr/share/orthanc/plugins/libServeFolders.so"
W0920 13:36:08.220266             MAIN PluginsManager.cpp:274] Registering plugin 'serve-folders' (version 1.12.4)
I0920 13:36:08.220827             MAIN OrthancPlugins.cpp:2789] (plugins) Plugin has registered a REST callback without mutual exclusion on: /app/plugin-serve-folders.html
W0920 13:36:08.221953             MAIN serve-folders:/Plugin.cpp:415] ServeFolders: Empty configuration file: No additional folder will be served!
I0920 13:36:08.222206             MAIN PluginsManager.cpp:316] (plugins) Found a shared library: "/usr/share/orthanc/plugins/libOrthancPython.so"
W0920 13:36:08.224367             MAIN PluginsManager.cpp:274] Registering plugin 'python' (version mainline)
W0920 13:36:08.224715             MAIN PluginsManager.cpp:158] Python plugin is initializing
W0920 13:36:08.226498             MAIN PluginsManager.cpp:158] Using Python script "Preprocessing.py" from directory: /etc/pacs-intermed
W0920 13:36:08.226808             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/lib/x86_64-linux-gnu/libpython3.9.so.1.0
W0920 13:36:08.227122             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/lib/python3.9/lib-dynload/_decimal.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.227433             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/lib/python3.9/lib-dynload/_json.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.227675             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/numpy/core/_multiarray_umath.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.227902             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/numpy/core/../../numpy.libs/libopenblas64_p-r0-0cf96a72.3.23.dev.so
W0920 13:36:08.228139             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/numpy/core/../../numpy.libs/libgfortran-040039e1.so.5.0.0
W0920 13:36:08.228381             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/numpy/core/../../numpy.libs/libquadmath-96973f99.so.0.0.0
W0920 13:36:08.228614             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/lib/python3.9/lib-dynload/_contextvars.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.228870             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/numpy/core/_multiarray_tests.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.229100             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/lib/python3.9/lib-dynload/_ctypes.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.229100             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/lib/python3.9/lib-dynload/_ctypes.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.229332             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/numpy/linalg/_umath_linalg.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.229517             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/numpy/fft/_pocketfft_internal.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.229708             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/numpy/random/mtrand.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.229867             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/numpy/random/bit_generator.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.230025             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/numpy/random/_common.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.230180             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/lib/python3.9/lib-dynload/_hashlib.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.230340             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/numpy/random/_bounded_integers.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.230497             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/numpy/random/_mt19937.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.230655             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/numpy/random/_philox.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.230811             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/numpy/random/_pcg64.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.230969             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/numpy/random/_sfc64.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.231125             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/numpy/random/_generator.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.231283             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/lib/python3.9/lib-dynload/_opcode.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.231459             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/lib/python3.9/lib-dynload/_ssl.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.231617             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/lib/python3.9/lib-dynload/_bz2.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.231772             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/lib/python3.9/lib-dynload/_lzma.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.231929             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/lib/python3.9/lib-dynload/_queue.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.232084             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/charset_normalizer/md.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.232242             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/charset_normalizer/md__mypyc.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.232407             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/lib/python3.9/lib-dynload/_multibytecodec.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.232567             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/simplejson/_speedups.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.232722             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/lib/python3.9/lib-dynload/_uuid.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.232880             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/PIL/_imaging.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.233035             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/PIL/../Pillow.libs/libjpeg-f2134fdd.so.62.3.0
W0920 13:36:08.233198             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/PIL/../Pillow.libs/libopenjp2-78c47f58.so.2.5.0
W0920 13:36:08.233383             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/PIL/../Pillow.libs/libtiff-b9364ff1.so.6.0.0
W0920 13:36:08.233594             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/PIL/../Pillow.libs/libxcb-3e83370d.so.1.1.0
W0920 13:36:08.233778             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/PIL/../Pillow.libs/liblzma-95592ee6.so.5.4.2
W0920 13:36:08.233948             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/PIL/../Pillow.libs/libXau-154567c4.so.6.0.0
W0920 13:36:08.234110             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/psycopg2/_psycopg.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.234270             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/psycopg2/../psycopg2_binary.libs/libpq-e8a033dd.so.5.16
W0920 13:36:08.234483             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/psycopg2/../psycopg2_binary.libs/libssl-3e69114b.so.1.1
W0920 13:36:08.234651             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/psycopg2/../psycopg2_binary.libs/libcrypto-75e66d43.so.1.1
W0920 13:36:08.234814             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/psycopg2/../psycopg2_binary.libs/libgssapi_krb5-497db0c6.so.2.2
W0920 13:36:08.235003             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/psycopg2/../psycopg2_binary.libs/libldap-7a982b46.so.2.0.200
W0920 13:36:08.235180             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/psycopg2/../psycopg2_binary.libs/libkrb5-fcafa220.so.3.3
W0920 13:36:08.235375             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/psycopg2/../psycopg2_binary.libs/libk5crypto-b1f99d5c.so.3.1
W0920 13:36:08.235549             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/psycopg2/../psycopg2_binary.libs/libcom_err-2abe824b.so.2.1
W0920 13:36:08.235714             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/psycopg2/../psycopg2_binary.libs/libkrb5support-d0bcff84.so.0.1
W0920 13:36:08.235924             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/psycopg2/../psycopg2_binary.libs/libkeyutils-dfe70bd6.so.1.5
W0920 13:36:08.236096             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/psycopg2/../psycopg2_binary.libs/liblber-a070ad53.so.2.0.200
W0920 13:36:08.236259             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/psycopg2/../psycopg2_binary.libs/libsasl2-883649fd.so.3.0.0
W0920 13:36:08.236444             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/psycopg2/../psycopg2_binary.libs/libselinux-0922c95c.so.1
W0920 13:36:08.236612             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/psycopg2/../psycopg2_binary.libs/libpcre-9513aab5.so.1.2.0
W0920 13:36:08.236778             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/lib/python3.9/lib-dynload/_asyncio.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.236937             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/lib/python3.9/lib-dynload/_sqlite3.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.237237             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/cryptography/hazmat/bindings/_rust.abi3.so
W0920 13:36:08.237503             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/_cffi_backend.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.237742             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/lib/python3.9/lib-dynload/_multiprocessing.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.237923             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/lib/python3.9/lib-dynload/resource.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.238100             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/greenlet/_greenlet.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.238263             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/lib/python3.9/lib-dynload/_zoneinfo.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.238477             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/_ldap.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.238748             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/lib/python3.9/lib-dynload/termios.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.238916             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/markupsafe/_speedups.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.239081             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/lxml/etree.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.239241             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/lxml/_elementpath.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.239407             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/multidict/_multidict.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.239567             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/yarl/_quoting_c.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.239730             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/aiohttp/_helpers.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.239927             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/aiohttp/_http_writer.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.240094             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/aiohttp/_http_parser.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.240253             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/aiohttp/_websocket.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.240418             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/frozenlist/_frozenlist.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.240577             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/pandas_parser.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.240741             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/pandas_datetime.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.240902             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/interval.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.241065             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/hashtable.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.241224             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/missing.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.241392             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/tslibs/dtypes.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.241552             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/tslibs/np_datetime.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.241715             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/tslibs/conversion.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.241876             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/tslibs/base.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.242038             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/tslibs/offsets.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.242196             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/tslibs/timestamps.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.242364             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/tslibs/nattype.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.242524             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/tslibs/timedeltas.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.242687             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/tslibs/timezones.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.242847             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/tslibs/fields.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.243010             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/tslibs/ccalendar.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.243194             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/tslibs/tzconversion.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.243381             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/properties.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.243564             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/tslibs/parsing.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.243791             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/tslibs/strptime.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.243966             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/tslibs/period.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.244146             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/tslibs/vectorized.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.244306             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/ops_dispatch.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.244467             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/algos.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.244626             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/lib.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.244793             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/ops.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.244952             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/arrays.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.245120             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/tslib.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.245279             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/sparse.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.245446             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/indexing.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.245606             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/index.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.245770             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/internals.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.245928             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/join.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.246096             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/writers.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.246264             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/lib/python3.9/lib-dynload/mmap.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.246432             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/window/aggregations.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.246634             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/window/indexers.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.246802             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/reshape.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.246967             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/groupby.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.247134             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/json.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.247299             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/parsers.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.247462             MAIN PluginsManager.cpp:158] Force global loading of Python shared library: /usr/local/lib/python3.9/dist-packages/pandas/_libs/testing.cpython-39-x86_64-linux-gnu.so
W0920 13:36:08.247734             MAIN PluginsManager.cpp:158] Program name: /usr/sbin/Orthanc
E0920 13:36:08.322652     7f35c2895700 PluginsManager.cpp:154] Error while executing a Python command

But when I start the service manually, there are no such errors

Hi @brykov93

Well, I confirm the issue. It is actually already documented in the TODO of the python plugin.

However, I can’t commit on when it will be fixed.

Alain.

Thank you very much.
I hope for a speedy solution to the problem.

Hello,

As far as I’m concerned, I cannot reproduce this issue on Ubuntu 22.04 with Python 3.10.

Regards,
Sébastien-

Hello,
The problem occurs in the system with the following parameters:

  • Orthanc version 1.12.4
  • plugin ‘python’ version 4.3 (debian-bullseye-python-3.9)
  • Python 3.9.2

According to my notes in the TODO:

The plugin does not support calls to ‘curl http://localhost:8042/tools/reset -d “”’
if the script registers the OnChangeCallback:

import orthanc

def OnChange(changeType, level, resource):
  print("OnChange")
orthanc.RegisterOnChangeCallback(OnChange)

But, on my side, I have no time to investigate right now.

Alain

Hello,
Yes, my script uses the onChange Callback.
But after commenting on line
orthanc.RegisterOnChangeCallback(OnChange)
restart does not occur, I see the same errors in the log.

Hi there!

I think I’ve hit this issue but with a different setup: I’ve written a Python plugin that implements `RegisterFindCallback2` and `RegisterMoveCallback` (so no OnChange). I’ve also written a Lua plugin that implements `Initialize` and `OnHeartBeat`. The reason is this Lua plugin will query for any config changes to an external system, and if any, will create a dynamic config file in the right path and restart the server using the ‘/tools/reset’ API endpoint.

But the server crashes. I’ve enabled Python verbose setting and this is what I see:

W0105 14:56:54.268798       LUA-EVENTS LuaContext.cpp:95] Lua says: >>> Restarting Orthanc with new config...
I0105 14:56:54.367354             MAIN LuaJobManager.cpp:99] (lua) Awaking trailing sleep
I0105 14:56:54.367403             MAIN LuaScripting.cpp:959] Stopping the Lua engine
I0105 14:56:54.470778             MAIN LuaScripting.cpp:965] The Lua engine has stopped
W0105 14:56:54.470846             MAIN main.cpp:1036] Reset request received, restarting Orthanc
W0105 14:56:54.470852             MAIN main.cpp:1040] Orthanc is stopping
I0105 14:56:55.368471             MAIN OrthancWebDav.cpp:1702] Stopping the WebDAV upload thread
W0105 14:56:55.387172             MAIN main.cpp:1288]     HTTP server has stopped
I0105 14:56:56.362614     DICOM-SERVER DicomServer.cpp:88] (dicom) DICOM server stopping
W0105 14:56:56.405990             MAIN main.cpp:1405]     DICOM server has stopped
I0105 14:56:56.510601             MAIN JobsEngine.cpp:293] (jobs) Stopping the jobs engine
W0105 14:56:56.587986             MAIN JobsEngine.cpp:317] The jobs engine has stopped
I0105 14:56:56.860194         DB-FLUSH ServerIndex.cpp:308] Stopping the database flushing thread
I0105 14:56:56.860364     UNSTABLE-MON ServerIndex.cpp:513] Closing the monitor thread for stable resources
W0105 14:56:56.867121             MAIN PluginsManager.cpp:225] Unregistering plugin 'gdcm' (version 1.8)
I0105 14:56:56.867165             MAIN PluginsManager.cpp:163] (plugins) Finalizing the decoder/transcoder of medical images using GDCM
W0105 14:56:56.869765             MAIN PluginsManager.cpp:225] Unregistering plugin 'orthanc-explorer-2' (version 1.10.1)
W0105 14:56:56.869895             MAIN PluginsManager.cpp:225] Unregistering plugin 'python' (version 7.0)
W0105 14:56:56.869919             MAIN python:/Plugin.cpp:747] Python plugin is finalizing
# clear sys.path_importer_cache
# clear sys.path_hooks
# clear builtins._
# clear sys.path
# clear sys.argv
# clear sys.ps1
... (more cleanup stuff)
# destroy _operator
# destroy _typing
# destroy types
# destroy typing_inspection.typing_objects
# destroy functools
# destroy posix
# destroy _functools
# clear sys.audit hooks
ERROR: Trying to log a message after the finalization of the logging engine (or did you forgot to initialize it?)
W0105 14:56:56.930736             MAIN OrthancConfiguration.cpp:110] Scanning folder "/etc/orthanc/" for configuration files
W0105 14:56:56.930863             MAIN OrthancConfiguration.cpp:59] Reading the configuration from: /etc/orthanc/scp-dynamic-config.json
W0105 14:56:56.930969             MAIN OrthancConfiguration.cpp:59] Reading the configuration from: /etc/orthanc/scp-fixed-config.json
I0105 14:56:56.931094             MAIN Toolbox.cpp:1760] Using locale: "en_US.UTF-8" for case-insensitive comparison of strings
I0105 14:56:56.931141             MAIN Toolbox.cpp:2069] OpenSSL version: OpenSSL 3.1.4
I0105 14:56:56.931155             MAIN FromDcmtkBridge.cpp:364] (dicom) Using DCMTK version: 369
I0105 14:56:56.932392             MAIN FromDcmtkBridge.cpp:372] (dicom) Loading the embedded dictionaries
I0105 14:56:56.939467             MAIN FromDcmtkBridge.cpp:384] (dicom) Loading the embedded dictionary of private tags
I0105 14:56:56.944113             MAIN FromDcmtkBridge.cpp:2624] (dicom) Registering JPEG Lossless codecs in DCMTK
I0105 14:56:56.944125             MAIN FromDcmtkBridge.cpp:2632] (dicom) Registering JPEG codecs in DCMTK
I0105 14:56:56.944131             MAIN FromDcmtkBridge.cpp:2639] (dicom) Registering RLE codecs in DCMTK
I0105 14:56:56.944144             MAIN Enumerations.cpp:2424] Default encoding for DICOM was changed to: Utf8
I0105 14:56:56.949607             MAIN OrthancInitialization.cpp:405] Calling mallopt(M_ARENA_MAX, 5)
W0105 14:56:56.949739             MAIN main.cpp:966] Loading plugin(s) from: "/usr/share/orthanc/plugins-available/libOrthancPython.so"
W0105 14:56:56.950110             MAIN PluginsManager.cpp:287] Registering plugin 'python' (version 7.0)
W0105 14:56:56.950127             MAIN python:/Plugin.cpp:616] Python plugin is initializing
W0105 14:56:56.950138             MAIN python:/Plugin.cpp:634] Version of the Orthanc SDK in use by the Python plugin: 1.12.10
W0105 14:56:56.950238             MAIN python:/Plugin.cpp:689] Using Python script "scp.py" from directory: /etc/orthanc
W0105 14:56:56.950251             MAIN python:/Plugin.cpp:580] Force global loading of Python shared library: /lib/aarch64-linux-gnu/libpython3.12.so.1.0
W0105 14:56:56.950254             MAIN python:/Plugin.cpp:580] Force global loading of Python shared library: /usr/lib/python3.12/lib-dynload/_json.cpython-312-aarch64-linux-gnu.so
W0105 14:56:56.950257             MAIN python:/Plugin.cpp:580] Force global loading of Python shared library: /usr/lib/python3.12/lib-dynload/_hashlib.cpython-312-aarch64-linux-gnu.so
W0105 14:56:56.950260             MAIN python:/Plugin.cpp:580] Force global loading of Python shared library: /usr/lib/python3.12/lib-dynload/_ssl.cpython-312-aarch64-linux-gnu.so
W0105 14:56:56.950263             MAIN python:/Plugin.cpp:580] Force global loading of Python shared library: /usr/lib/python3.12/lib-dynload/_bz2.cpython-312-aarch64-linux-gnu.so
W0105 14:56:56.950266             MAIN python:/Plugin.cpp:580] Force global loading of Python shared library: /usr/lib/python3.12/lib-dynload/_lzma.cpython-312-aarch64-linux-gnu.so
W0105 14:56:56.950268             MAIN python:/Plugin.cpp:580] Force global loading of Python shared library: /usr/lib/python3.12/lib-dynload/_contextvars.cpython-312-aarch64-linux-gnu.so
W0105 14:56:56.950271             MAIN python:/Plugin.cpp:580] Force global loading of Python shared library: /usr/lib/python3.12/lib-dynload/_asyncio.cpython-312-aarch64-linux-gnu.so
W0105 14:56:56.950273             MAIN python:/Plugin.cpp:580] Force global loading of Python shared library: /usr/lib/python3.12/lib-dynload/_zoneinfo.cpython-312-aarch64-linux-gnu.so
W0105 14:56:56.950276             MAIN python:/Plugin.cpp:580] Force global loading of Python shared library: /usr/lib/python3.12/lib-dynload/_decimal.cpython-312-aarch64-linux-gnu.so
W0105 14:56:56.950278             MAIN python:/Plugin.cpp:580] Force global loading of Python shared library: /usr/local/lib/python3.12/dist-packages/pydantic_core/_pydantic_core.cpython-312-aarch64-linux-gnu.so
W0105 14:56:56.950282             MAIN python:/Plugin.cpp:580] Force global loading of Python shared library: /usr/lib/python3.12/lib-dynload/_queue.cpython-312-aarch64-linux-gnu.so
W0105 14:56:56.950285             MAIN python:/Plugin.cpp:580] Force global loading of Python shared library: /usr/lib/python3.12/lib-dynload/_multiprocessing.cpython-312-aarch64-linux-gnu.so
W0105 14:56:56.950303             MAIN python:/PythonLock.cpp:358] Program name: /usr/local/bin/Orthanc

And the container stops. Not sure if that error message may be the key:

ERROR: Trying to log a message after the finalization of the logging engine (or did you forgot to initialize it?)

The Orthanc-Python plugin TODO states the problem happens when registering ‘OnChangeCallback’, right? is this something different?

Thank you! Regards,

Alberto

Hello,

Please provide a minimal working example (i.e., a minimal configuration file with a minimal Python plugin and the way you trigger the crash). Indeed, our resources are limited, and a problem can only be investigated if it can be reproduced without extensive effort on our side to understand your intended workflow.

Regards,
Sébastien-

Hello @brykov93 - did upgrading to a newer version of Orthanc and python fix your issue?

Hello @Alberto - what version of Orthanc are you experiencing this issue on?

Sorry for the delay! I’m using 25.12.0. Thanks!

Note that this issue has been confirmed with the latest version of the python plugin but it has not been fixed yet.

Hello,

As a quick update, I am still unable to reproduce this issue on Ubuntu 22.04. I have tested the following two configurations:

  • Orthanc 1.12.4, Python 3.10, and Python plugin 4.3 (close to original poster).
  • Orthanc 1.12.10, Python 3.10, and Python plugin 7.0.

I have followed Alain’s instructions.

Regards,
Sébastien-