shutil.copytree error

Skip to first unread message

Jan 11, 2022, 2:57:05 PMJan 11
to archivematica
Archivematica Storage Service 0.18.1
Archivematica 1.13.2

On CentOS 7.9 (same server for both services)

While ingesting a folder, my colleague reported seeing an error and after some digging, I've got it down to the shutil.copytree python3 module. It's during the "Prepare AIP" microservice where it fails. The logs weren't very helpful though they did point me to the file - just not why it's failing (Invalid argument):

I've checked to make sure those directories exist, and they do. I even pulled out just this portion of the script, creating a simple python script, and it fails with the same error.

Script (
import os
import shutil
from optparse import OptionParser
import traceback

src = '/var/archivematica/sharedDirectory/currentlyProcessing/01_Annual_Reports_JLM-aacadaa3-633d-4197-a926-4fc723af87af/logs/bulk-e99f8dc8-2af2-4934-bdfe-7ff6cca714f7/'

dst = '/var/archivematica/sharedDirectory/watchedDirectories/workFlowDecisions/metadataReminder/01_Annual_Reports_JLM-70adce2b-1b33-4678-b7d6-2f9f172ebeb0/logs/transfers/01_Annual_Reports_JLM-aacadaa3-633d-4197-a926-4fc723af87af/logs/bulk-e99f8dc8-2af2-4934-bdfe-7ff6cca714f7/'

shutil.copytree(src, dst)

-------- ERROR REPORT ----------

Traceback (most recent call last):
  File "", line 10, in <module>
    shutil.copytree(src, dst)
  File "/usr/lib64/python3.6/", line 365, in copytree
    raise Error(errors)
shutil.Error: [('/var/archivematica/sharedDirectory/currentlyProcessing/01_Annual_Reports_JLM-aacadaa3-633d-4197-a926-4fc723af87af/logs/bulk-e99f8dc8-2af2-4934-bdfe-7ff6cca714f7/telephone_histogram.txt', '/var/archivematica/sharedDirectory/watchedDirectories/workFlowDecisions/metadataReminder/01_Annual_Reports_JLM-70adce2b-1b33-4678-b7d6-2f9f172ebeb0/logs/transfers/01_Annual_Reports_JLM-aacadaa3-633d-4197-a926-4fc723af87af/logs/bulk-e99f8dc8-2af2-4934-bdfe-7ff6cca714f7/telephone_histogram.txt', "[Errno 22] Invalid argument: '/var/archivematica/sharedDirectory/currentlyProcessing/01_Annual_Reports_JLM-aacadaa3-633d-4197-a926-4fc723af87af/logs/bulk-e99f8dc8-2af2-4934-bdfe-7ff6cca714f7/telephone_histogram.txt'")

Feb 4, 2022, 1:20:31 PMFeb 4
to archivematica
This one is more important to resolve. Anyone have any ideas as to why this python script is failing?

Kieran O Leary

Feb 4, 2022, 3:40:47 PMFeb 4
Hi, until better help than me comes along:  most answers to this specific issue online relate to permissions. Do you have permission for the dst dir?
Have you tried in your test script to just send the src to a folder on your desktop, just to see if that works?


Kieran O’Leary
Digital Preservation Manager 
National Library of Ireland 

You received this message because you are subscribed to the Google Groups "archivematica" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Feb 9, 2022, 1:56:33 PMFeb 9
to archivematica
Unfortunately, no luck. I made sure permissions wasn't the issue nor file ownership. Dag nabbit. Seems like the problems are cascading now, too.
Reply all
Reply to author
0 new messages