Skip to content

Problem: AIP moved to completed when S3 enabled. Breaks S3 upload #339

@camlyall

Description

@camlyall

S3 AIP storage methods expect the AIP location to be in currentlyProcessing/ingest/, so we get a "file not found" error when it's moved to completed. You can see the affected code in the verify_aip.py file, lines 229-232:

aip_path = Path(aip_path)
completed_dir = Path(mcpclient_settings.SHARED_DIRECTORY, "completed")
shutil.move(str(aip_path), str(completed_dir))
logger.info("AIP generated: %s", aip_path.name)

You can also check out the S3 storage methods in the a3m_store_aip.py file: https://github.com/artefactual-labs/a3m/blob/main/a3m/client/clientScripts/a3m_store_aip.py

To fix this issue, you can add a check for the S3 enabled setting before moving the AIP to the completed directory. You can find an example of this in my updated verify_aip.py file, lines 229-234:

# Don't move to completed if S3 enabled
if not mcpclient_settings.S3_ENABLED:
aip_path = Path(aip_path)
completed_dir = Path(mcpclient_settings.SHARED_DIRECTORY, "completed")
shutil.move(str(aip_path), str(completed_dir))
logger.info("AIP generated: %s", aip_path.name)

Here's an example of the arguments from the logs:
['a3m_store_aip', '5a68bbdb-f5a0-4eb3-bd58-4f9badefb12d', '/home/a3m/.local/share/a3m/share/currentlyProcessing/ingest/5a68bbdb-f5a0-4eb3-bd58-4e9badefb12d/transfer-5a68bbdb-f5a0-4eb3-bd58-4e9badefb12d.7z']

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions