Skip to content

Renaming of tmp folder to data fails due to antivirus scans on Windows #191

@kieranjol

Description

@kieranjol

We have been bagging on network shares lately using bagit-python as opposed to working on local forensic workstations. As a result, some new issues have arisen, largely with bagit failing due to not having permission to rename the tmp folder to 'data'. We believe that this is due to antivirus scans (Windows Defender) on the network placing a lock on the rename process for a few seconds.
PermissionError: [WinError 5] Access is denied: 'X:\\storage\\workingFiles\\bag_tests\\pythonforktest\\000929796\\tmpe1ehkzxc' -> 'data'
Looking at old issues, I can see that this error has popped up here before: #134 so it might be a bit more widespread than I would have initially thought.

I have added some try/except code to a local fork of bagit-python and it has been handling these issues really well. Anecdotally, the issue arises for us about 20% of the time in a test of about 400 bags totalling 100gigs, and usually a retry after 10 seconds fixes the issue, with a rare few instances needed two retries. In the issue linked to above, this 'retry' solution appears to have worked as well as they were able to run bagit successfully again after the initial fail.

I will follow up with the pull request.

Best,

Kieran O'Leary
Digital Repository Services Manager
National Library of Ireland

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