Hello all
I am getting an error response from DSpace when trying to deposit content via it's SWORDv2 API.
I am using the Python SWORD client library (https://github.com/swordapp/python-client-sword2).
What I find particularly confusing is the fact that when I try to deposit using curl, everything goes smoothly:
--
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To post to this group, send email to dspac...@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
--
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To post to this group, send email to dspac...@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.
Hello Tim
Thank you for taking the time to reply and for good suggestions.
The Edit-media error occurs before I hand over any data about whether or not I intend to deposit files (see attached simple-test.py). In this script I just hand over XML formatted metadata (entry variable) because this gives me the Edit-media IRI which is needed for me to deposit the files (in simple-test.py I am in fact reproducing the process on lines 252-268 on https://github.com/artefactual/archivematica-storage-service/blob/stable/0.11.x/storage_service/locations/models/dspace.py with a view to make line 297 work).
DSpace 6.2 log, at this point shows no error (see attached dspace.log)
Python SWORDv2 Client log for the same process doesn't show an error either (see attached sword-client.log)
So running the simple-test.py will result in an item being created in submissions DSpace with the declared metadata. It seems no error is logged.
If the generated Edit-media IRI is opened, the "No plugin can disseminate the requested formats" error is displayed (which does not show up in logs). If I attempt to deposit files using this Edit-media IRI
I get 403 errors which do show up in the SWORD client log as:
and in the DSpace log as:
2018-04-10 15:07:06,202 INFO org.dspace.sword2.MediaResourceManagerDSpace @ hrafn.m...@ed.ac.uk:session_id=0:replace_failed_authorisation:user=hrafn.m...@ed.ac.uk,on_behalf_of=none
Hello
I'm just following up by adding that I replicate can the error on http://demo.dspace.org.
Sending in a metadata only entry is mostly fine (see working.py). For the first few runs they went straight through but then an error was generated in the sword client but the deposited item materialised nonetheless (for instance: http://demo.dspace.org/xmlui/handle/10673/80)
Example of an Edit-IRI http://demo.dspace.org/swordv2/edit/334112ee-077b-4192-9ba3-8606e399aa4d
and the Edit-Media-IRI gives the same error:
http://demo.dspace.org/swordv2/edit-media/334112ee-077b-4192-9ba3-8606e399aa4d
To authenticate
user: dspacede...@gmail.com
pass: dspace
Any thoughts?
Hrafn
Hello Tim
Thanks again for taking the time to look at this.
Yes, you are correct of course that the attempting to GET the Edit-Media URI without a proper Accept header will throw this "No plugin can disseminate the requested formats" error. I should have realised beforehand that the Edit-Media URI isn't intended for human consumption, I am new to SWORDv2 and I was trying to trace the 403 error so it threw me off .
I've identified a more likely source of my troubles. I'm using the SWORDv2 Python Client library (https://github.com/swordapp/python-client-sword2) and my 31 line Python script (attached dspace-demo.py) that creates a metadata item in Dspace and then attempts to upload a single binary file gets the same 403 error (this is roughly following https://github.com/swordapp/python-client-sword2/wiki/BasicUsage).
In any case, I'm assuming the problem is with the Python Client library and I'm not too keen on trying to trace it further because my alternative solution is to just post the binary using the requests Python library and subsequently updating metadata/permissions using the DSpace REST API.
Best regards, Hrafn
It just occurred to me that between DSpace versions 5 and 6 the authentication method for the REST API changed.
Any possibility that the authentication for SWORDv2 changed as well?
Hrafn
Hi Tim
Yeah, I realise this seems to be a client library issue. I've more or less decided to got with the REST API instead of SWORDv2.
Hrafn