Files being stored on Database when Storage is disabled

Hi All ! I’m new to the group so apologies if I miss any instructions on how to post.

I’ve been working on setting up the Orthanc PostgreSQL index plugin to connect to my AWS Aurora Database. I’m hosting the Orthanc server in a EC2 instance with S3 being used for storage.

Docker Image I’m using: orthancteam/orthanc:24.9.0-full

I was able to get S3 and PostgreSQL Index to work. However, I noticed that even though I have “EnableStorage”: false, the full files are still being stored in the database under the table: attachedfiles. [Attached Screenshots].

Documentation reference: PostgreSQL plugins — Orthanc Book documentation

Here is my orthanc.json file:
{
“Name”: “Orthanc”,
“DicomAet”: “ORTHANC”,
“DicomPort”: 4242,
“HttpPort”: 8042,
“LogFile”: “/var/log/orthanc/orthanc.log”,
“LogLevel”: “TRACE”,
“HttpServer”: {
“AllowCors”: true,
“AccessLogEnabled”: true,
“AccessLogFile”: “/var/log/orthanc/access.log”
},

“RestApiWriteToFileSystemEnabled”: true,
“RemoteAccessAllowed”: true,
“DicomServerEnabled”: true,
“DicomAlwaysAllowStore”: true,
“DicomCheckCalledAet”: false,
“DicomModalitiesIn”: {
“AllowAll”: true
},

“Plugins”: [
“/usr/share/orthanc/plugins-available/libOrthancAwsS3Storage.so”,
“/usr/share/orthanc/plugins-available/libOrthancDicomWeb.so”,
“/usr/share/orthanc/plugins-available/libOrthancExplorer2.so”,
“/usr/share/orthanc/plugins-available/libStoneWebViewer.so”,
“/usr/share/orthanc/plugins-available/libOrthancOHIF.so”,
“/usr/share/orthanc/plugins-available/libOrthancPostgreSQLIndex.so”
],

“AwsS3Storage”: {
“Region”: “us-east-1”,
“BucketName”: “backup-dicom”,
“AccessKeyId”: “${AWS_ACCESS_KEY_ID}”,
“SecretAccessKey”: “${AWS_SECRET_ACCESS_KEY}”,
“StorageStructure”: “flat”,
“CacheSize”: 1000,
“Locking”: {
“Type”: “Local”,
“Directory”: “/var/lib/orthanc/locks”
}
},

“PostgreSQL”: {
“EnableIndex”: true,
“EnableStorage”: false,
“Host”: “${AWS_AURORA_ENDPOINT}”,
“Port”: 5432,
“Database”: “orthanc_db”,
“Username”: “postgres”,
“Password”: “${AWS_AURORA_SECRET_ACCESS_KEY}”,
“EnableSsl”: false,
“Lock” : false
},

“OrthancExplorer2”: {
“Enable”: true,
“IsDefaultOrthancUI”: true
},

“StoneWebViewer”: {
“Enabled”: true,
“ViewerPath”: “/stone-webviewer”,
“LogLevel”: “TRACE”
},

"OrthancOHIF": {
"Enabled": true,
"ViewerPath": "/ohif",
"LogLevel": "TRACE"

},

“AuthenticationEnabled”: true,
“RegisteredUsers”: {
“admin”: “adminpassword”,
“viewer”: “viewerpassword”
},

“UserRights”: {
“admin”: [ “Read”, “Write”, “Delete”, “Modify” ],
“viewer”: [ “Read” ]
},

“RestApiDeleteEnabled”: false
}


Please let me know of any suggestions. I really appreciate any insight into why this is happening.

Best,
Raymond

Hi Raymond,

As a first advice, I would review your configuration file and compare it to the documentation… There are a bunch of options that do probably exist only in ChatGPT model but not in real life :wink:

When you set PostgreSQL -> StorageEnable: false. You actually tell PG not to store the files content in the DB but, Orthanc will still use the AttachedFiles table to store a pointer between the resources and the attachments (aka the files) that are stored on the disk.

HTH,

Alain.

1 Like

Yeah haha, I started with a basic ChatGPT script and just been lazy to remove some of the irrelevant stuff like the “UserRights”.

I have minimal experience with Databases. I’m using this project to learn

Basically (in simple terms) the PostgreSQL database acts as “bookkeeper” and so Orthanc knows where the files are placed am I interpreting correctly?

Thanks you for you input and suggestion!

yes, that’s correct

1 Like