Hi all,
I’m seeing an inconsistent behaviour in Archivematica 1.19 regarding the relation between AIPs and DIPs when the DIP is created via partial reingest (normalize for access). When the DIP is created during the original ingest (normalize for: preservation and access), the related_packages field on the AIP record is correctly populated with the DIP identifier. However, when the DIP is created later via partial reingest, this relation is not created, and it seems to be lost in both directions (AIP → DIP and DIP → AIP).
Expected behaviour (works on ingest)If I run an ingest with “Normalize for: preservation and access”, the API behaves as expected. An AIP is generated, a DIP is created during ingest, and when I query:
the response includes the DIP inside related_packages. Example (real output, trimmed):
This is the expected and desired behaviour, because it allows discovering the DIP UUID from the AIP and downloading it via the API.
Problematic behaviour (partial reingest)The issue happens when following the recommended workflow of normalizing only for preservation during ingest, and later generating a DIP via partial reingest using normalize for access. In my workflow:
I start the reingest with
POST /api/v2/file/<aip-uuid>/reingest/
I provide a processing config that normalizes for access.
I approve the reingest with
POST /api/ingest/reingest/approve
The reingest completes successfully and the DIP is indeed created. However, when I query the same AIP afterwards:
the field related_packages comes back empty. Example:
In this situation, the AIP does not list the DIP in related_packages, the DIP does not list the AIP either, and the package-listing endpoints do not expose any way to discover which DIP belongs to that AIP. So there is no method to programmatically retrieve or download the DIP generated via partial reingest.
Additional observation (existing relation is lost on reingest)There is another issue: if the AIP originally had a DIP created during ingest (so the relation existed), performing a partial reingest to generate a new DIP removes the old relation, but also does not create a new relation for the newly generated DIP. The result is:
even though a new DIP was created successfully. Since related_packages is an array, I would expect Archivematica to either store both DIP IDs or replace the old one with the new. Instead, the field is cleared and not repopulated.
ImpactThis prevents automated workflows from tracking or downloading DIPs created via partial reingest. It also contradicts the recommendation in the documentation to normalize for preservation during ingest and generate access copies later via partial reingest.
QuestionsIs this a known issue/bug or limitation in Archivematica 1.19?
Is there any other endpoint or recommended method to obtain the DIP UUID from an AIP when the DIP is created via partial reingest? Listing all DIPs with api/v2/file/?package_type=DIP is not viable, since the AIP–DIP relation does not exist in this scenario. Even though the AIP UUID appears at the end of the DIP’s current_full_path, parsing thousands of records to extract that value is not scalable. Ideally, it should be possible to retrieve the DIP UUID directly from the AIP in a clear 1:1 relation.
I can provide more logs, full JSON responses, or run additional tests if needed.
Thank you for the follow-up. I appreciate the clarification, and yes — I will go ahead and open a new issue on GitHub with all the details.
To confirm, I’m running my tests on version 1.19.0.
Thanks again!