Problem with Async jobs

I have just started using the “Asynchronous”: true flag when calling the tools/create-archive REST API call and have found what I believe to be a bug.

If I place a call, wait for the job to finish and then call jobs//archive I get the result of the job. I can then create another job, wait for it to finish and then download the output no problem. My issue comes if I create multiple jobs without first downloading the output from the previous job. In those circumstances, as soon a new job is created, the output from previous jobs is no longer accessible and I get the response:

{
“Details” : “Job has no such output: archive”,
“HttpError” : “Not Found”,
“HttpStatus” : 404,
“Message” : “Accessing an inexistent item”,
“Method” : “GET”,
“OrthancError” : “Accessing an inexistent item”,
“OrthancStatus” : 7,
“Uri” : “/jobs/8be34b7d-bd31-4abb-b59d-c59a6800c6e4/archive”
}

This happens every single time and the only output that can be accessed is the last job to have been created.

After getting the above 404 message, if I query the job again I get:

{
“CompletionTime”: “20220524T140355.723968”,
“Content”: {
“ArchiveSize”: “4884469”,
“ArchiveSizeMB”: 4,
“Description”: “REST API”,
“InstancesCount”: 3,
“UncompressedSize”: “5743022”,
“UncompressedSizeMB”: 5
},
“CreationTime”: “20220524T140355.265902”,
“EffectiveRuntime”: 0.45000000000000001,
“ErrorCode”: 0,
“ErrorDescription”: “Success”,
“ErrorDetails”: “”,
“ID”: “8be34b7d-bd31-4abb-b59d-c59a6800c6e4”,
“Priority”: 0,
“Progress”: 100,
“State”: “Success”,
“Timestamp”: “20220524T143738.530289”,
“Type”: “Archive”
}

This would indicate that the output should still be available but it is not.

Any help in resolving this would be appreciated.

Thanks
Steve

Hello,

You most probably have to adapt the value of the “MediaArchiveSize” configuration option:
https://book.orthanc-server.com/users/configuration.html

Excerpt:

// Maximum number of ZIP/media archives that are maintained by
// Orthanc, as a response to the asynchronous creation of archives.
// The least recently used archives get deleted as new archives are
// generated. This option was introduced in Orthanc 1.5.0, and has
// no effect on the synchronous generation of archives.
“MediaArchiveSize” : 1,

Regards,

Sébastien-

Can I suggest that this information is added to the “Advanced features of the REST API” page? It mentions the ConcurrentJobs, JobsHistorySize and SaveJobs option but not the MediaArchiveSize one.

Thanks
Steve

Doc updated in https://hg.orthanc-server.com/orthanc-book/rev/989f00cd4dfa.