Images (Generalization of System.Image) via GetObject are automatically deleted as they are marked as system$unreferencedfile

0
Hi Makers,   To download Images from a S3 bucket. They are created using a PDF to Image Lambda function to further use the images (one per page of the original PDF file) in a Textract call. For downloading the images, I'm using this: Page is the generalization of System.Image and associated with the PDF document, and I'm using the Get Object to populate it:   The images are visible in the application and in the database (so they are committed). The images are associated with the original PDF (File.Document)   After a while, I can use the images BECAUSE THEY ARE DELETED    Here the log from the  ALTER SEQUENCE PUBLIC."system$filedocument_fileid_mxseq" RESTART WITH 1033/*C17*/DELETE FROM "system$queuedtask" WHERE "id"=27866022696117231INSERT INTO "system$queuedtask" VALUES(27866022696117231,9394,'Running','59651013-f9bc-4fc1-b435-276439b07899','System.ScheduledEventsQueue','ScheduledEvent',NULL,NULL,'ClusterManagement-CleanupOrphanedFiles','[]','47899c62-8d25-4c4e-9ad3-2c76354239b0',101,'2024-11-05 09:16:07.289000','2024-11-05 09:21:07.221000','2024-11-05 09:21:07.640000',0,NULL,'ClusterManagement-CleanupOrphanedFiles',NULL)COMMITDELETE FROM "system$unreferencedfile" WHERE "id"=26740122787927635DELETE FROM "system$unreferencedfile" WHERE "id"=26740122787926296DELETE FROM "system$unreferencedfile" WHERE "id"=26740122787927149DELETE FROM "system$unreferencedfile" WHERE "id"=26740122787927907DELETE FROM "system$unreferencedfile" WHERE "id"=26740122787926046DELETE FROM "system$unreferencedfile" WHERE "id"=26740122787926894DELETE FROM "system$unreferencedfile" WHERE "id"=26740122787926763DELETE FROM "system$unreferencedfile" WHERE "id"=26740122787927220DELETE FROM "system$unreferencedfile" WHERE "id"=26740122787927398DELETE FROM "system$unreferencedfile" WHERE "id"=26740122787926651DELETE FROM "system$unreferencedfile" WHERE "id"=26740122787927709DELETE FROM "system$unreferencedfile" WHERE "id"=26740122787927946DELETE FROM "system$unreferencedfile" WHERE "id"=26740122787927494DELETE FROM "system$unreferencedfile" WHERE "id"=26740122787926519DELETE FROM "system$unreferencedfile" WHERE "id"=26740122787926233DELETE FROM "system$unreferencedfile" WHERE "id"=26740122787927035COMMIT   I see the solution here: https://community.mendix.com/link/space/deployment/questions/128661   Can you update the Put Object in order to prevent this from happening? Meanwhile I will try a work around by cloning the Images to new ones. Any addition from anyone?
asked
2 answers
2

Add an additional Change Action to the Image after the Get Object Action and set the DeleteAfterDownload to FALSE

 

image.png

answered
0

Hi Marco,

The image files are being deleted, possibly due to the following reason: they aren’t properly associated with another entity, so the system considers them unneeded.

To prevent this deletion, we need to ensure that each Page image (entity) is associated with the main PDF document entity. By doing this, Mendix will treat these images as referenced files and prevent them from being deleted.

 

Thanks,

Arun

answered