Getting a 400 error when attempting to access ArchivesSpace

110 views
Skip to first unread message

Patrick Burden

unread,
Jun 9, 2025, 8:42:45 AM6/9/25
to archivematica
Hi all.  I have been trying to figure out what is going on with the integration between ArchivesSpace v3.5.2 and Archivematica v1.17.0.  I have the two platforms connected and checked way too many times to make sure that the credentials that I am using are correct.  When I go to the appraisal tab and search for a collection via the ArchivesSpace sub-menu I am getting the following error in the dashboard.log

INFO      2025-06-06 15:34:33  elasticsearch:base:log_request_success:193:  GET http://localhost:9200/transferfiles/_search?size=10000 [status:200 request:0.008s]
INFO      2025-06-06 15:34:35  elasticsearch:base:log_request_success:193:  GET http://localhost:9200/transferfiles/_search?size=10000 [status:200 request:0.005s]
ERROR     2025-06-06 15:34:43  agentarchives.archivesspace.client:client:_request:169:  Response code: 404
ERROR     2025-06-06 15:34:43  agentarchives.archivesspace.client:client:_request:170:  Response body: {"error":"GET /repositories/2/resources/7082/tree"}

ERROR     2025-06-06 15:34:43  django.request:log:log_response:241:  Internal Server Error: /access/archivesspace/
Traceback (most recent call last):
  File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.9/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.9/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/share/archivematica/dashboard/components/access/views.py", line 50, in wrapper
    return func(client, *args, **kwargs)
  File "/usr/share/archivematica/dashboard/components/access/views.py", line 115, in all_records
    records = client.find_collections(
  File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.9/site-packages/agentarchives/archivesspace/client.py", line 753, in find_collections
    return [format_record(json.loads(r["json"])) for r in hits["results"]]
  File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.9/site-packages/agentarchives/archivesspace/client.py", line 753, in <listcomp>
    return [format_record(json.loads(r["json"])) for r in hits["results"]]
  File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.9/site-packages/agentarchives/archivesspace/client.py", line 717, in format_record
    self._get(record["uri"] + "/tree", params={"page": 1}).json()[
  File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.9/site-packages/agentarchives/archivesspace/client.py", line 190, in _get
    return self._request(
  File "/usr/share/archivematica/virtualenvs/archivematica/lib/python3.9/site-packages/agentarchives/archivesspace/client.py", line 171, in _request
    raise CommunicationError(response.status_code, response)
agentarchives.archivesspace.client.CommunicationError: ArchivesSpace server responded 404

For those that have this integration working, is there anything that I am missing to get this connection to work?  From reading what I could it appears it is assembling the request to get the tree view of the collection and it is unable to get the result.  Looking for any help on this.  Thank you in advance.

Sarah Mason

unread,
Jun 10, 2025, 6:45:54 AM6/10/25
to archivematica
Hi Patrick,

I believe you're not alone in this issue with trying to make the Archivematica and ArchivesSpace integration to work. There's a thread here that goes into that detail a bit more. You'll notice in the thread that a community member also logged this issue in GitHub about it.

We test with our own internal instance of ArchivesSpace, which is set to version 2.5. The issue highlights that some later changes to the API endpoints might be the culprit, but further investigation is needed.

We welcome anyone with a later version of ArchivesSpace to do some testing and code review to update the GitHub issue to help with investigations or fixes, especially considering the major changes between versions. Anything you can find out that will be useful for making a fix, please put a comment on the GitHub issue. We welcome contributions of all kinds.

Best wishes,
Sarah 


--------
Sarah Mason
Contributor Success Specialist
Artefactual Systems Inc.
she/her

Patrick Burden

unread,
Jun 12, 2025, 10:02:33 AM6/12/25
to archivematica
Thank you for sharing those links.  This would have been a lifesaver earlier, but as they say you need to know what the problem is before you fix it.  I guess the follow up question would be if we know where the code lives?  As in where I can inspect the current integration with ASpace to see the APIs and try to manually change it to adhere to the modern code base.  If anyone has any information be happy to plug away and see what I can do.

Sarah Mason

unread,
Jun 17, 2025, 1:36:45 PM6/17/25
to archivematica
I can ask one of our devs to provide some information. The code lives in a number of places, so if you let me know how technical you want us to get, we can provide some pointers. I don't want to assume knowledge and overwhelm you or provide less than useful information.  Thank you!

Patrick Burden

unread,
Jun 17, 2025, 4:40:42 PM6/17/25
to archiv...@googlegroups.com
I do not mind the entire answer if you have that to provide it.  The more information the better I can plan out on my side.

--
You received this message because you are subscribed to a topic in the Google Groups "archivematica" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/archivematica/wLzPLT4eTE4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to archivematic...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/archivematica/93abbadb-90a0-4b69-9f87-42b2b536764en%40googlegroups.com.

Ellen LeClere

unread,
Jun 18, 2025, 9:35:17 AM6/18/25
to archivematica

Just chiming in to say that I would be interested in seeing the code as well. Thank you! 

Douglas Cerna

unread,
Jun 18, 2025, 5:17:31 PM6/18/25
to archiv...@googlegroups.com
Hello,

I've created this gist with some pointers about this problem.

I used Patrick's traceback from the Appraisal tab as an example, but updating the integration to work with recent versions of ArchivesSpace will require reviewing other Dashboard views as well as a few MCPClient scripts.

Hope this helps.

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 visit https://groups.google.com/d/msgid/archivematica/23bdf180-a51e-431a-95c7-4d1f2f2461fan%40googlegroups.com.


--
Douglas Cerna (he/him),
Software Developer, Artefactual Systems Inc.
http://www.artefactual.com

Patrick Burden

unread,
Jun 19, 2025, 9:51:18 AM6/19/25
to archivematica
Thank you for the information.  I will take a look and see how much of a lift this is going to take.  Quick question on your side.  If hypothetically we were to attempt to tackle this would anything code wise in Amatica needs to change?  As an example do we need to worry about Amatica's database has changed or how the data is being treated since this was originally developed five years ago.  Or are there any "gotachas" that need to be considered in this lift.

Douglas Cerna

unread,
Jun 19, 2025, 10:27:50 AM6/19/25
to archiv...@googlegroups.com
I think it should be possible to update the ArchivesSpace API endpoints logic in the agentarchives library without requiring any modifications to the Archivematica code base.

A quick grep on the v1.17.0 code returns these three Python modules:

$ git grep -l 'ArchivesSpaceClient(' -- src/**/*.py
src/MCPClient/lib/clientScripts/dip_generation_helper.py
src/MCPClient/lib/clientScripts/upload_archivesspace.py
src/dashboard/src/components/ingest/views_as.py

That's where the client (ArchivesSpaceClient class) is instantiated.

Let's take for example the first module in this list.


        resource = client.find_by_id("archival_objects", "ref_id", ref_id)




Suppose that API endpoint has changed in recent versions of ArchivesSpace and now it requires two or three different API endpoints calls to gather the information necessary to build the same output record (https://github.com/artefactual-labs/agentarchives/blob/907c5996d5ee0f8b91215428693524e36fc76ff0/agentarchives/archivesspace/client.py#L780-L787). That's fine. If you update that method in the library to do so the Archivematica side shoudn't require any modifications.

Hope this makes sense.


Reply all
Reply to author
Forward
0 new messages