shutil.copytree error

33 views
Skip to first unread message

jamen.mc...@vanderbilt.edu

unread,
Jan 11, 2022, 2:57:05 PMJan 11
to archivematica
Using:
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 (test.py):
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 "test.py", line 10, in <module>
    shutil.copytree(src, dst)
  File "/usr/lib64/python3.6/shutil.py", 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'")

jmcgr...@gmail.com

unread,
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?
--Jamen

Kieran O Leary

unread,
Feb 4, 2022, 3:40:47 PMFeb 4
to archiv...@googlegroups.com
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?

Best,

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 archivematic...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/archivematica/49cc90e8-ce60-4801-b0b8-4e3ff121fac8n%40googlegroups.com.

jmcgr...@gmail.com

unread,
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
Forward
0 new messages