Rt attachment type other than image/* are stored in disk

Hello. We have configured external storage to disk in RT_Siteconfig.pm like this

Set(%ExternalStorage,
Type => ‘Disk’,
Path => ‘/opt/rt5/var/attachments’,
)

From my understanding,

  • rt will store attachments in db
  • when rt-externalize-attachments script is run, it will move attachments which exceeds configured size limit will be move to external storage .

but I didn’t run rt-externalize-attachments once. So the part I don’t understand is how these attachments are stored in local disk /opt/rt5/var/attachments.
Is my understanding wrong. Is rt will automatically attachments in disk even without running rt-externalize-attachments.
I created a new ticket and uploaded a pdf file. But it’s stored in DB.
My rt version is 5.0.0
I’m not rt developer but junior sysadmin. I must admit I don’t have detail knowledge of RT’s internal architecture. Any reference is highly appreciated also.

So you haven’t run rt-externalize-attachments yet, and the newly uploaded PDF is in the database? That sounds right to me. You should run rt-externalize-attachments periodically (via cron) to move newly arrived attachments from the database to your external storage.

One thing to note (that is mentioned in the docs) is that if you use the shredder, the attachments in the external storage aren’t shredded with the rest of the ticket data.

No. I didn’t run rt-externalize-attachments yet. But some old uploaded pdf are now in disk. I’m not sure how does that happened. As I said, the newly uploaded pdf are now in database.
I’m wondering whether RT automatically moves these pdf file which are stored in DB to disk at some point with some conditions.

To clarify some things, here’s our set-up.
nginx-lb in front of 3 apache2 web servers which are connected to galera cluster. The web server and database are one to one mapped. All databases are masters. Someone complaint that they can’t open the pdf and other files they uploaded. We found out that these pdf files are stored in only one apache2 webserver in /opt/rt5/var/attachments. So we make all webservers have the same attachments in /opt/rt5/var/attachments. That solves the pdf files can’t open problem. But I’m not sure what causes them to store in disks rather than database.

Plus All image files are stored in database. It’s only file types other than image

Ok My bad. It’s solved now. A former employee [Senior] set up cron to run rt-externalize-attachments. That’s the reason these are stored in disks. Thanks for reply.

1 Like