Task #2088
Story #2086: CN issues found when creating tests for Python D1 CNClient
CNCore.reserveIdentifier() returns 404
100%
Description
... 12/02/14 07:55:25 DEBUG operation: POST /cn/v1/reserve
NotFound: name: NotFound
errorCode: 404
detailCode: 404
description: Not Found: The server has not found anything matching the Request-URI.
PID: None
History
#1 Updated by Roger Dahl almost 13 years ago
ServiceFailure: name: ServiceFailure
errorCode: 500
detailCode: 0
description: Node responded with a valid status code but failed to include the expected Content-Type
Status code: 400
Content-Type: text/xml;charset=UTF-8
traceInformation: <?xml version="1.0" encoding="UTF-8"?>
PID causes: No unmarshaller for element "{http://ns.dataone.org/service/types/v1}Identifier" (line 1, col 89)
#2 Updated by Roger Dahl almost 13 years ago
- Subject changed from CNCore.reserveIdentifier() returns 500 to CNCore.reserveIdentifier() returns 404
- Milestone changed from CCI-0.6.4 to CCI-1.0.0
Changed from 500 to 404. 500 was due to a bug in my code.
#3 Updated by Matthew Jones almost 13 years ago
Are you sure the CN was up when you tested? Does the service work with curl for you? It used to work using curl for me a couple of weeks ago. Right now it is down for maintenance, but when the CN comes up again, try:
curl -X POST -s \
-H "Charset: utf-8" \
-H "Content-Type: multipart/form-data; boundary=----------6B3C985C-6290-11DF-A355-A6ECDED72085_$" \
-H "Accept: text/xml" \
-H "User-Agent: curl-tester" \
--cert /tmp/x509up_u501 \
-F pid=@/tmp/testid.xml \
"https://cn-dev.dataone.org/cn/v1/reserve"
where the /tmp/testid.xml file contains the XML for an identifier that you want to reserve. Worked for me.
#4 Updated by Roger Dahl almost 13 years ago
Matt, the CURL example you provided works, but it passes the PID as an XML type in a MMP file part, while it should be passed as UTF-8 in a field. When I do that, the server returns 500. Though it's just a small issue that the CN hasn't been updated to match the spec, more important is that the server crashed instead of returning the expected InvalidRequest with a description of what was found to be amiss.
Calling this method without SSL also causes a crash, regardless of how the PID is passed. I would have expected a NotAuthorized.
#5 Updated by Matthew Jones almost 13 years ago
Yeah, we clarified that it should be a param part this afternoon on IRC -- I think Ben may have already fixed that in the HEAD, but the fix is not deployed. The fact that it crashes without an SSL connection is a problem and needs to be fixed I think.
#6 Updated by Ben Leinfelder almost 13 years ago
- Assignee set to Ben Leinfelder
code should match the documentation at this point -- still looking into it.
#7 Updated by Roger Dahl almost 13 years ago
- Status changed from New to Closed
Caused by a bug in d1_common.mime_multipart.py (incorrect rendering of field sections).