Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Can S3 and Postgres both be configured?

331 views
Skip to first unread message

Yi Lu

unread,
May 27, 2021, 10:46:33 AM5/27/21
to Orthanc Users
Having worked with many imaging system I carry the assumption that we can store pixel data on S3 while non-pixel data (e.g. demographics) in database (e.g. Postgres).  This other thread seems to support this.

As I continuing with my infra project, with that model in mind, i made to the point the s3 library is loaded (along with postgres) as i bring up docker container. However S3 is not being used. i noticed the following line in the log:
------------------
W0527 14:07:52.973045 main.cpp:864] Loading plugin(s) from: /usr/local/share/orthanc/plugins/libOrthancAwsS3Storage.so
W0527 14:07:53.076865 PluginsManager.cpp:269] Registering plugin 'AWS S3 Storage' (version mainline)
W0527 14:07:53.089193 PluginsManager.cpp:168] AWS S3 Storage plugin is initializing
W0527 14:07:55.129326 PluginsManager.cpp:168] AWS S3 Storage: client-side encryption is disabled
E0527 14:07:55.145958 PluginsManager.cpp:197] Exception while invoking plugin service 1016: Another plugin has already registered a custom storage area
W0527 14:07:55.146007 main.cpp:1610] Using a custom database from plugins
W0527 14:07:55.146016 main.cpp:1621] Using a custom storage area from plugins
------------------

As I DICOM send object, it stores and displays without storing anything to my designated s3 bucket. The cloud object doc seems to suggest that as long as you add a AWS s3 plugin section, it will be picked up as dicom storage location. But the log above tells me otherwise, and I'm confused that that "another plugin" is. Is it postgres?

Here's my config and I've confirmed the value of environment variables are correct.

I've also tried to remove the Postgres reference from config file, and I got an error:
orthweb            | E0527 14:37:55.406836 PluginsManager.cpp:164] AWS S3 Storage: error while creating object f1ed636d-244d-4f22-8353-a05da6bdc1d2: error while writing file orth/f1ed636d-244d-4f22-8353-a05da6bdc1d2.dcm:  curlCode: 1, Unsupported protocol
orthweb            | E0527 14:37:55.407820 StoreScp.cpp:197] Exception while storing DICOM: Error in the plugin implementing a custom storage area













Sébastien Jodogne

unread,
May 28, 2021, 1:42:41 AM5/28/21
to Orthanc Users
You can certainly load the PostgreSQL index plugin (to store the database) together with the AWS S3 storage area plugin (to store the files).

In your case, you are visibly simultaneously enabling two plugins to store the files: the PostgreSQL storage area plugin together with the AWS S3 storage area plugin. Obviously, it only makes sense to have one single storage area, and Orthanc cannot start.

You should either not load the PostgreSQL storage area plugin in the "Plugins" configuration option of Orthanc, or set the "EnableStorage" configuration option of PostgreSQL to "false":

Regarding the "curlCode" error, this question was already asked before:

Sébastien-

Yi Lu

unread,
May 29, 2021, 12:10:44 AM5/29/21
to Orthanc Users
Thanks for the tips Sébastien. I put EnableStorage back to false and it now attempts to store to S3. 
As with the curlCode error, it may have to do with the STATIC_BUILD=ON switch:
With STATIC_BUILD=ON, I came across the error above when it tries to write to S3, even though I've installed related package in the target environment (libcurl4 libssl-dev libssl1.1 curl libcurl4-openssl-dev)
Without STATIC_BUILD=ON, a different error occurs when loading the library:
orthweb            | W0529 03:53:51.133116 main.cpp:864] Loading plugin(s) from: /usr/local/share/orthanc/plugins/libOrthancAwsS3Storage.so
orthweb            | W0529 03:53:51.306785 PluginsManager.cpp:269] Registering plugin 'AWS S3 Storage' (version mainline)
orthweb            | free(): invalid pointer

Forgive my lack of knowledge on cmake, is there anything i'm missing? This is where i'm running the build.

- Yi


Sébastien Jodogne

unread,
May 29, 2021, 5:44:48 AM5/29/21
to Orthanc Users
Hello,

From what I see in your GitHub repository, your Docker image seems to derive from the "jodogne/orthanc-plugins" image:

The "jodogne/orthanc-plugins" image uses the Linux Standard Base (LSB) binaries available at:

But, an executable compiled using the LSB SDK cannot load a plugin that is not fully statically linked:

The AWS S3 plugin is currently not designed to be entirely statically linked (it still dynamically links against libcrypto). This is why Osimis provides Docker images that don't use any LSB binaries, but are fully recompiled on a given GNU/Linux distribution. You should do the same, or simply get in touch with Osimis to request access to their Docker "pro" images (that already contains all the object storage plugins properly compiled):

Sébastien-
Reply all
Reply to author
Forward
0 new messages