Database errors when querying a tenant

We have a Orthanc server configured as multi-tenant:

“DicomAet” : “RF-TEST”,

“DicomPort” : 4242,

“MultitenantDicom” : {
  “Servers” : [
    {
      “AET” : “RF-LIMIT”,
      “Port” : 4343,
      “Labels” : [ “limit” ],
      “LabelsConstraint” : “All”,
      “LabelsStoreLevels” : [ “Patient”, “Study”, “Series”, “Instance” ]
    }
  ]
},

We’re using a Postgres database. The multi-tenant configuration was added after the server had been running for a while, so almost all the DICOM resources are unlabeled.

Using a DICOM client (OsiriX) we can store a Study in the tenant AET (RF-LIMIT). However, when the client searches for studies, it gets no results and I see these database errors in the Orthanc log:
Jun 29 15:53:24 RFPACS orthanc[1005187]: W0629 15:53:24.858495 DICOM-3 ResourceFinder.cpp:950] W001: Accessing DICOM tags from storage when accessing study a8b16f0d-777debbe-6f693138-c0c4de57-97740e74: 0008,1050;0032,4000;4008,0212
Jun 29 15:54:04 RFPACS orthanc[1005187]: W0629 15:54:04.846996 DICOM-0 ResourceFinder.cpp:697] Executing a database lookup at level Study on main DICOM tag 0008,0005 from an inferior level (Instance), this will return no result
Jun 29 15:54:04 RFPACS orthanc[1005187]: E0629 15:54:04.848947 DICOM-0 postgresql-index:/PostgreSQLStatement.cpp:194] PostgreSQL error: ERROR: missing FROM-clause entry for table “t0”
Jun 29 15:54:04 RFPACS orthanc[1005187]: LINE 1: …ent = 32 WHERE studies.resourceType = 1 AND lower(t0.value) …
Jun 29 15:54:04 RFPACS orthanc[1005187]: ^
Jun 29 15:54:04 RFPACS orthanc[1005187]: E0629 15:54:04.849401 DICOM-0 postgresql-index:/DatabaseBackendAdapterV4.cpp:1522] Exception in database back-end: Error with the database engine
Jun 29 15:54:04 RFPACS orthanc[1005187]: E0629 15:54:04.849537 DICOM-0 postgresql-index:/DatabaseBackendAdapterV4.cpp:1522] Exception in database back-end: Bad sequence of calls
Jun 29 15:54:04 RFPACS orthanc[1005187]: E0629 15:54:04.849716 DICOM-0 PluginsManager.cpp:202] Exception while invoking plugin service 3002: Error with the database engine
Jun 29 15:54:19 RFPACS orthanc[1005187]: E0629 15:54:19.874993 DICOM-0 multitenant-dicom:/OrthancFrameworkDependencies.cpp:92] Native exception while handling some runnable object

Is this a situation where the tenant needs to have been defined before the database was initialized?

Thanks,
John

Hi,

This should not be an issue.

There must be something specific with the C-Find from Osirix but I’m unable to reproduce it.
Note that I have just made a small change wrt this tag so you can give it a try with the mainline binaries

BTW, you did not specify the version and DB engine you are using ?

Alain

 

 


Free software isn’t free to make — it takes time, effort, and resources. If you appreciate the project, consider donating to help sustain its development!

Alain,

We’re running Postgres 17.6 installed with RPMs from Postrgres RHEL/Rocky repository. Postgres Index plugin version 10.0. Orthanc binary and MultiTenant plugin were built from source downloaded around May 4th.

I’ll try the new mainline binary with your patch. Or should I redownload source and rebuild, since the MultiTenant plugin is only available as source?

John

Both Orthanc and the multitenant plugin mainline are available here: Orthanc downloads