Docker generated config file: wrong PostgreSQL key name

Hi,

When using Orthanc with Docker and trying to customize theses settings:

  • MaximumConnectionRetries

  • IndexConnectionsCount

Like this in my envars:

ORTHANC__POSTGRESQL__MAXIMUM_CONNECTION_RETRIES=11
ORTHANC__POSTGRESQL__INDEX_CONNECTIONS_COUNT=5

In the startup logs (so it’s not working):
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

I think the issue comes from the generated config file and the PostgreSQL json key:

cat /tmp/orthanc.json

PostgreSQL”: {
“Database”: “orthanc”,
“Username”: “orthanc”,
“EnableStorage”: false,
“Host”: “orthanc_db”,
“Port”: 5432,
“EnableIndex”: true,
“Lock”: false,
“Password”: “osimis”,
“EnableSsl”: false
},
Postgresql”: {

“IndexConnectionsCount”: 5,
“MaximumConnectionRetries”: 11
},

Hello,

The following call seems to work:

$ docker run --rm -t -i -e POSTGRESQL_PLUGIN_ENABLED=true -e ORTHANC__POSTGRE_S_Q_L__MAXIMUM_CONNECTION_RETRIES=42 -e ORTHANC__POSTGRE_S_Q_L__INDEX_CONNECTIONS_COUNT=7 osimis/orthanc:21.5.2
[…]
W0611 13:46:17.603838 PluginsManager.cpp:269] Registering plugin ‘postgresql-index’ (version 4.0)
W0611 13:46:17.603965 PluginsManager.cpp:168] The index plugin will use 7 connection(s) to the database, and will retry up to 42 time(s) in the case of a collision
[…]

Sébastien-

Yes, just tried and it works, thx.

So, for you it’s not a bug? Other Postgres envars are like: ORTHANC__POSTGRESQL__XXX

This is a temporary workaround until a new version of the “osimis/orthanc” image is released.

The convenience exceptions mentioned in the Orthanc Book (stored inside “env-var-non-standards.json”) have just been updated with the missing options:

https://book.orthanc-server.com/users/docker-osimis.html#environment-variables

https://bitbucket.org/osimis/orthanc-builder/commits/9741147754363430272afa6ce93ed232dc737fbd

Amazing! Thx for your hard work Sébastien :slight_smile:

FYI, the just-published image “osimis/orthanc:21.6.0” contains the aforementioned fix:

$ docker run --rm -t -i -e POSTGRESQL_PLUGIN_ENABLED=true -e ORTHANC__POSTGRESQL__MAXIMUM_CONNECTION_RETRIES=42 -e ORTHANC__POSTGRESQL__INDEX_CONNECTIONS_COUNT=7 osimis/orthanc:21.6.0
[…]

W0611 16:21:41.300897 PluginsManager.cpp:269] Registering plugin ‘postgresql-index’ (version 4.0)
W0611 16:21:41.300987 PluginsManager.cpp:168] The index plugin will use 7 connection(s) to the database, and will retry up to 42 time(s) in the case of a collision

[…]