Is plugin libOrthancPostgreSQLIndex.so compatible with libOrthancIndexer.so

So only index is stored in DB?
more /var/log/orthanc/Orthanc.log
W1103 16:36:57.536182 main.cpp:1956] Orthanc version: 1.9.7
W1103 16:36:57.536238 OrthancConfiguration.cpp:117] Scanning folder “/usr/local/etc/orthanc/” for configuration files
W1103 16:36:57.536269 OrthancConfiguration.cpp:66] Reading the configuration from: “/usr/local/etc/orthanc/orthanc.json”
W1103 16:36:57.536866 OrthancConfiguration.cpp:66] Reading the configuration from: “/usr/local/etc/orthanc/indexer.json”
W1103 16:36:57.536935 OrthancConfiguration.cpp:66] Reading the configuration from: “/usr/local/etc/orthanc/postgresql.json”
W1103 16:36:57.560020 main.cpp:878] Loading plugin(s) from: /usr/local/share/orthanc/plugins/libOrthancPostgreSQLIndex.so
W1103 16:36:57.566322 PluginsManager.cpp:269] Registering plugin ‘postgresql-index’ (version 4.0)
W1103 16:36:57.566665 PluginsManager.cpp:168] 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
W1103 16:36:57.566699 main.cpp:878] Loading plugin(s) from: /usr/local/share/orthanc/plugins/libOrthancIndexer.so
W1103 16:36:57.566974 PluginsManager.cpp:269] Registering plugin ‘indexer’ (version 1.0)
E1103 16:36:57.567348 PluginsManager.cpp:164] Native exception while initializing the plugin
E1103 16:36:57.567363 PluginsManager.cpp:102] Error while initializing plugin /usr/local/share/orthanc/plugins/libOrthancIndexer.so (code -1)
W1103 16:36:57.567524 PluginsManager.cpp:219] Unregistering plugin ‘postgresql-index’ (version 4.0)
W1103 16:36:57.567534 PluginsManager.cpp:168] PostgreSQL index is finalizing
E1103 16:36:57.568069 main.cpp:2013] Uncaught exception, stopping now: [Error while using a shared library (plugin)] (code 25)
W1103 16:36:57.568078 main.cpp:2044] Orthanc has stopped

Hi Robert,

Yes, both plugins should work together. I’ve just tested with our docker images and the following compose file (modified from https://bitbucket.org/osimis/orthanc-setup-samples/src/master/docker/indexer/):

version: “3”
services:
orthanc-pacs:
image: osimis/orthanc:21.10.0
restart: unless-stopped
ports: [“8042:8042”]
volumes:

  • “…/…/dicomFiles:/dicom-files”
  • “orthanc-storage:/var/lib/orthanc/db”
    environment:
    VERBOSE_STARTUP: “true”
    VERBOSE_ENABLED: “true”
    ORTHANC__NAME: “Orthanc with Indexer plugin”
    ORTHANC__REGISTERED_USERS: |
    {“demo”: “demo”}
    ORTHANC__INDEXER__FOLDERS: |
    [“/dicom-files”]
    ORTHANC__POSTGRESQL__HOST: “orthanc-index”

orthanc-index:
image: postgres
restart: unless-stopped
volumes: [“orthanc-index:/var/lib/postgresql/data:Z”]
environment:
POSTGRES_PASSWORD: “postgres”

volumes:
orthanc-storage:
orthanc-index:

How did you get the binaries ? Did you compile them by yourself ? Could there be a mix of LSB binaries and self built binaries ?

HTH

Alain

Salut Alain

Everything built from tar balls as per below. Ubuntu 20.04. Will revise my json config file based on your post.
a+
Normand

dpkg -l | grep postgres
ii orthanc-postgresql 3.2-1ubuntu4 amd64 Plugins to use PostgreSQL as a database back-end to Orthanc
ii postgresql 12+214ubuntu0.1 all object-relational SQL database (supported version)
ii postgresql-12 12.8-0ubuntu0.20.04.1 amd64 object-relational SQL database, version 12 server
ii postgresql-client-12 12.8-0ubuntu0.20.04.1 amd64 front-end programs for PostgreSQL 12
ii postgresql-client-common 214ubuntu0.1 all manager for multiple PostgreSQL client versions
ii postgresql-common 214ubuntu0.1 all PostgreSQL database-cluster manager
ii postgresql-contrib 12+214ubuntu0.1 all additional facilities for PostgreSQL (supported version)
ii postgresql-server-dev-12 12.8-0ubuntu0.20.04.1 amd64 development files for PostgreSQL 12 server-side programming
ii postgresql-server-dev-all 214ubuntu0.1 all extension build tool for multiple PostgreSQL versions

Get orthanc core an d plugins

curl https://www.orthanc-server.com/downloads/get.php?path=/orthanc/Orthanc-1.9.7.tar.gz -o Orthanc-1.9.7.tar.gz

curl https://www.orthanc-server.com/downloads/get.php?path=/plugin-postgresql/OrthancPostgreSQL-4.0.tar.gz -o OrthancPostgreSQL-4.0.tar.gz

curl https://www.orthanc-server.com/downloads/get.php?path=/plugin-indexer/OrthancIndexer-1.0.tar.gz# Get python plugin
curl https://www.orthanc-server.com/downloads/get.php?path=/plugin-python/OrthancPython-3.4.tar.gz -o OrthancPython-3.4.tar.gz

tar -xzf Orthanc-1.9.7.tar.gz
tar -xzf OrthancPostgreSQL-4.0.tar.gz

tar -xzf OrthancIndexer-1.0.tar.gz
tar -xzf OrthancPython-3.4.tar.gz

Modified /etc/init.d/orthanc service file to use binaries, libraries, and config files in /usr/local

and not apt installed versions because way to old/.

Problem happens identically if run in bash shell

sudo service orthanc stop

Build Orthanc

cd ~/SW/Orthanc-1.9.7/
mkdir Build
cd Build/
cmake --clean-first -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release …
make -j4
make doc

Check the tests passed. Only Korean and Japanese support failed.

./UnitTests

install puts everything in /usr/local so it does not overwrite version that might

have been obtained via apt and is dispersed in /usr, /etc, /var

sudo make install

Postgres plugin:

sudo apt -y install libpq-dev postgresql-server-dev-all
cd ~/SW/OrthancPostgreSQL-4.0
mkdir Build
cd Build
cmake …/PostgreSQL -DCMAKE_BUILD_TYPE=Release
-DALLOW_DOWNLOADS=ON
-DUSE_SYSTEM_GOOGLE_TEST=OFF \

-DUSE_SYSTEM_ORTHANC_SDK=OFF

make -j4

Run unit test later. It requires interaction with postgress

sudo make install

cd ~/SW/OrthancIndexer-1.0
mkdir Build
cd Build/
cmake --clean-first -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release …
make -j4

The test below passes
./UnitTests
#Install
sudo make install

Python plugin

cd OrthancPython-3.4
mkdir Build
cd Build

Using python 3.8 unlike instruction which use 3.7. No 3.7 official apt

package for Ubuntu 20.04

cmake … -DPYTHON_VERSION=3.8 -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release …
make -j4
sudo make install

So it only crashes when the plugin “Enable” is true. All jsons attached

Runs as user orthanc.orthanc on the command line and as a service also as user orthanc.orthanc with folder /home/orthanc/DICOM belonging and writable by user orthanc.orthanc:

sudo -u orthanc /usr/local/sbin/Orthanc --verbose .

I would consider building a version with debug symbols.

orthanc.json (35.8 KB)

postgresql.json (237 Bytes)

indexer.json (268 Bytes)