Docker image jodogne/orthanc-plugins:1.12.4 cannot use last postgres index plugin

Hello,

we have tried to use the latest version of jodogne/orthanc-plugins on our Linux server, to benefit of new transaction mode (ReadCommitted).

However the plugin libOrthancPostgreSQLIndex version embedded (V5) was not matching the requirement to support this new transaction mode.

I binded the plugin to my host, so that I can change manually the plugin up to V6.2.
When I start the container , I got the following error:

W1017 14:21:51.183997             MAIN main.cpp:2059] Orthanc version: 1.12.4
I1017 14:21:51.184036             MAIN main.cpp:2091] Architecture: 64-bit, little endian
W1017 14:21:51.184120             MAIN OrthancConfiguration.cpp:109] Scanning folder "/etc/orthanc" for configuration files
W1017 14:21:51.184198             MAIN OrthancConfiguration.cpp:58] Reading the configuration from: "/etc/orthanc/orthanc.json"
I1017 14:21:51.184826             MAIN Toolbox.cpp:1598] Setting up the ICU common data
I1017 14:21:51.393243             MAIN Toolbox.cpp:1577] Using locale: "en_US.UTF-8" for case-insensitive comparison of strings
I1017 14:21:51.393585             MAIN Toolbox.cpp:1873] OpenSSL version: OpenSSL 3.1.4
I1017 14:21:51.394199             MAIN FromDcmtkBridge.cpp:295] (dicom) Using DCMTK version: 368
I1017 14:21:51.394299             MAIN FromDcmtkBridge.cpp:303] (dicom) Loading the embedded dictionaries
I1017 14:21:51.408361             MAIN FromDcmtkBridge.cpp:315] (dicom) Loading the embedded dictionary of private tags
I1017 14:21:51.418393             MAIN FromDcmtkBridge.cpp:2473] (dicom) Registering JPEG Lossless codecs in DCMTK
I1017 14:21:51.418458             MAIN FromDcmtkBridge.cpp:2481] (dicom) Registering JPEG codecs in DCMTK
I1017 14:21:51.418500             MAIN FromDcmtkBridge.cpp:2488] (dicom) Registering RLE codecs in DCMTK
I1017 14:21:51.418537             MAIN Enumerations.cpp:2385] Default encoding for DICOM was changed to: Latin1
I1017 14:21:51.418566             MAIN FromDcmtkBridge.cpp:420] (dicom) Registering tag in dictionary: (1235,0010) LO PrivateCreatorIBA (multiplicity: 1-1)
I1017 14:21:51.418595             MAIN FromDcmtkBridge.cpp:420] (dicom) Registering tag in dictionary: (1235,1001) LO ReferenceDose (multiplicity: 1-1)
I1017 14:21:51.418607             MAIN FromDcmtkBridge.cpp:420] (dicom) Registering tag in dictionary: (1235,1002) LO EvaluatedDose (multiplicity: 1-1)
I1017 14:21:51.426247             MAIN OrthancInitialization.cpp:397] Your platform does not support mallopt(), ignoring configuration option "MallocArenaMax"
W1017 14:21:51.426564             MAIN main.cpp:917] Loading plugin(s) from: /usr/local/share/orthanc/plugins/libOrthancPostgreSQLIndex.so
W1017 14:21:51.427718             MAIN PluginsManager.cpp:274] Registering plugin 'postgresql-index' (version 6.2)
I1017 14:21:51.427800             MAIN PluginsManager.cpp:162] (plugins) OpenSSL version: OpenSSL 3.1.4
W1017 14:21:51.428231             MAIN PluginsManager.cpp:158] PostgreSQL: using SERIALIZABLE transaction mode
W1017 14:21:51.428262             MAIN PluginsManager.cpp:158] The index plugin will use 1 connection(s) to the database, and will retry up to 10 time(s) in the case of a collision
I1017 14:21:51.428304             MAIN OrthancPlugins.cpp:5764] (plugins) Plugin has registered a custom database back-end
I1017 14:21:51.428323             MAIN OrthancPluginDatabaseV4.cpp:1293] (plugins) Identifier of this Orthanc server for the global properties of the custom database: "2a5408e2-68b8a4bc-3058b09b-d9469b3c-16feda6b"
W1017 14:21:51.428343             MAIN main.cpp:917] Loading plugin(s) from: /usr/local/share/orthanc/plugins/libOrthancWebViewer.so
W1017 14:21:51.428946             MAIN PluginsManager.cpp:274] Registering plugin 'web-viewer' (version 2.9)
W1017 14:21:51.428977             MAIN PluginsManager.cpp:158] Initializing the Web viewer
W1017 14:21:51.429293             MAIN PluginsManager.cpp:158] Web viewer using 6 threads for the decoding of the DICOM images
W1017 14:21:51.429307             MAIN PluginsManager.cpp:158] Storing the cache of the Web viewer in folder: /var/lib/orthanc/db/WebViewerCache
E1017 14:21:51.430132             MAIN PluginsManager.cpp:154] boost::thread_resource_error: Resource temporarily unavailable
E1017 14:21:51.430154             MAIN PluginsManager.cpp:92] Error while initializing plugin /usr/local/share/orthanc/plugins/libOrthancWebViewer.so (code -1)
W1017 14:21:51.430414             MAIN PluginsManager.cpp:224] Unregistering plugin 'postgresql-index' (version 6.2)
W1017 14:21:51.430438             MAIN PluginsManager.cpp:158] PostgreSQL index is finalizing
E1017 14:21:51.430632             MAIN main.cpp:2116] Uncaught exception, stopping now: [Error while using a shared library (plugin)] (code 25)
W1017 14:21:51.430641             MAIN main.cpp:2147] Orthanc has stopped

I’ve tried to bind libOrthancWebViewer plugin to use the latest one, but no luck.

Here is my docker compose:

services:
  database:
    image: postgres:15.4-alpine
    deploy:
      restart_policy:
        condition: on-failure
    volumes:
      - ${POSTGRES_VOLUME}:/var/lib/postgresql/data/pgdata/
    environment:
      POSTGRES_PASSWORD: ${APP_POSTGRES_PASSWORD}
      POSTGRES_USER: ${APP_POSTGRES_USER}
      POSTGRES_DB: ${APP_POSTGRES_DB}
      PGDATA: /var/lib/postgresql/data/pgdata
    sysctls:
      - net.ipv4.tcp_keepalive_time=600
      - net.ipv4.tcp_keepalive_intvl=30
      - net.ipv4.tcp_keepalive_probes=10
    ports:
      - 5432:5432

  pacs:
    image: jodogne/orthanc-plugins:1.12.4
    deploy:
      restart_policy:
        condition: on-failure
    volumes:
      - ${ORTHANC_RUNTIME_PATH_LOGS}:/var/log/orthanc/
      - ${ORTHANC_RUNTIME_PATH_STORAGE}:/var/lib/orthanc/db/
      - ${ORTHANC_RUNTIME_PATH_SCRIPTS}:/usr/share/orthanc/scripts
      - ${ORTHANC_RUNTIME_PATH_CONFIG}:/etc/orthanc/orthanc.json
      - ${ORTHANC_RUNTIME_PATH_PLUGIN_POSTGRES}:/usr/local/share/orthanc/plugins/libOrthancPostgreSQLIndex.so
      - ${ORTHANC_RUNTIME_PATH_PLUGIN_VIEWER}:/usr/local/share/orthanc/plugins/libOrthancWebViewer.so
    command: "--logdir=/var/log/orthanc /etc/orthanc --verbose"
    ports:
      - 4242:4242
      - 8042:8042
    depends_on:
      - database

and .env file

POSTGRES_VOLUME=$RUNTIME_ENV/postgres
APP_POSTGRES_DB=app_db
APP_POSTGRES_PASSWORD=postgres
APP_POSTGRES_USER=postgres
ORTHANC_RUNTIME_PATH_LOGS=$RUNTIME_ENV/orthanc/logs
ORTHANC_RUNTIME_PATH_STORAGE=$RUNTIME_ENV/orthanc/storage
ORTHANC_RUNTIME_PATH_SCRIPTS=$RUNTIME_ENV/orthanc/scripts
ORTHANC_RUNTIME_PATH_CONFIG=$RUNTIME_ENV/orthanc/Configuration.json
ORTHANC_RUNTIME_PATH_PLUGIN_POSTGRES=$RUNTIME_ENV/orthanc/plugins/libOrthancPostgreSQLIndex.so
ORTHANC_RUNTIME_PATH_PLUGIN_VIEWER=$RUNTIME_ENV/orthanc/plugins/libOrthancWebViewer.so

Hello,

The jodogne/orthanc-plugins Docker images are conservative and do not package the latest database plugins, as they are primarily aimed at research environments that require a stable database schema. Please switch to the orthancteam/orthanc images if you want to benefit from the latest releases for enterprise-ready setups.

Kind Regards,
Sébastien-

Hi Sebastien,

thanks for pointing this. Even we don’t use the docker image in our production environment, I’ve made the “switch”.

So I defined this in my docker compose:

services:
  database:
    image: postgres:15.4-alpine
    logging:
      driver: "json-file"
      options:
        max-file: 5
        max-size: 10m
    deploy:
      restart_policy:
        condition: on-failure
    volumes:
      - ${RUNTIME_PATH}/${POSTGRES_INIT_DB}:/docker-entrypoint-initdb.d/init.sql
    environment:
      POSTGRES_PASSWORD: ${APP_POSTGRES_PASSWORD}
      POSTGRES_USER: ${APP_POSTGRES_USER}
      POSTGRES_DB: ${APP_POSTGRES_DB}
    sysctls:
      - net.ipv4.tcp_keepalive_time=600
      - net.ipv4.tcp_keepalive_intvl=30
      - net.ipv4.tcp_keepalive_probes=10
    ports:
      - 5432

  pacs:
    image: orthancteam/orthanc:24.10.2
    logging:
      driver: "json-file"
      options:
        max-file: 5
        max-size: 10m
    deploy:
      restart_policy:
        condition: on-failure
    volumes:
      - ${RUNTIME_PATH}/${ORTHANC_RUNTIME_PATH_LOGS}:/var/log/orthanc/
      - ${RUNTIME_PATH}/${ORTHANC_RUNTIME_PATH_STORAGE}:/var/lib/orthanc/db/
      - ${RUNTIME_PATH}/${ORTHANC_RUNTIME_PATH_SCRIPTS}:/usr/share/orthanc/scripts
      - ${RUNTIME_PATH}/${ORTHANC_RUNTIME_PATH_CONFIG}:/etc/orthanc/orthanc.json
    environment:
      VERBOSE_STARTUP: "true"
      VERBOSE_ENABLED: "true"
      POSTGRESQL_PLUGIN_ENABLED: "true"
    
    ports:
      - 4242
      - 8042
    depends_on:
      - database

I enabled the postgres plugin, but I see in the logs that a sqlLiteIndex is used…
and I got the error making the server stop:
17:33:11.822114 MAIN main.cpp:2133] Uncaught exception, stopping now: [boost::thread_resource_error: Resource temporarily unavailable]
I attached the output of the logs with the verbose mode

Thanks again for your help
orthanc.txt (8.3 KB)

Hi @frederic.striepe

If you check the startup logs, you’ll notice this:

"Plugins": [],

which means that no plugins are loaded. You should not specify any Plugins entry in your config file, the image will take care of it.

This error has already been observed a few times. It seems upgrading Docker might help (see 1.12.4 crashing). If you find a way to reproduce it, let me know.

Best regards,

Alain.

Thanks a lot Alain.

Indeed, even with the removal of the key “Plugins”, I still got the error message.
I was using Docker V20 ( on old ubuntu 18…)
By upgrading to V24, I get rid of this error, and the server started with no issue.

Since the plugins section is no more defined in the configuration, is it the reason why I don’t see any plugins in the UI plugins dashboard ?
or should I see the default loaded ? (I defined a postgres plugin as enabled )

I strongly recommend to set the env var VERBOSE_STARTUP to true in order to debug configuration and plugins loading issue.
Normally, to enable a plugin, you should either define the related env var or have its section defined in the configuration file.

The documentation is worth reading and there are also a lot of sample usages here.

Best,

Alain