Project

General

Profile

Bug #7280

v2 get() using a SID yields ServiceFailure

Added by Andrei Buium over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Metacat
Target version:
Start date:
2015-07-29
Due date:
% Done:

100%

Milestone:
None
Product Version:
*
Story Points:
Sprint:

Description

Problem:

Calling get() against the v2 endpoint on https://mn-demo-6.test.dataone.org/knb/d1/mn/v2/object/S1_201521010107836
yields a ServiceFailure (errorCode 500, detailCode 0000)

Scenario:

This was called through libclient from SidMNTestImplementations (SidCommonTestImplementations) . testGet()
with context.mn.baseurl = https://mn-demo-6.test.dataone.org/knb/d1/mn

Metacat logs contained:

metacat 20150729-17:12:20: [DEBUG]: objectId: S1_201521010107836 [edu.ucsb.nceas.metacat.restservice.D1ResourceHandler]
metacat 20150729-17:12:20: [DEBUG]: verb:1 [edu.ucsb.nceas.metacat.restservice.D1ResourceHandler]
...

metacat 20150729-17:12:20: [DEBUG]: P1_201521010107835 is a type 1 end for sid S1_201521010107836 [edu.ucsb.nceas.metacat.IdentifierManager]
metacat 20150729-17:12:20: [INFO]: It is an ideal for sid S1_201521010107836 [edu.ucsb.nceas.metacat.IdentifierManager]
...

metacat 20150729-17:12:20: [ERROR]: class java.lang.NullPointerException: null [edu.ucsb.nceas.metacat.restservice.D1ResourceHandler]
java.lang.NullPointerException
at edu.ucsb.nceas.metacat.restservice.v2.MNResourceHandler.getObject(MNResourceHandler.java:1189)
at edu.ucsb.nceas.metacat.restservice.v2.MNResourceHandler.handle(MNResourceHandler.java:281)
at edu.ucsb.nceas.metacat.restservice.D1RestServlet.doGet(D1RestServlet.java:75)
...

metacat 20150729-17:12:20: [ERROR]: D1ResourceHandler: Serializing exception with code 500: null [edu.ucsb.nceas.metacat.restservice.D1ResourceHandler]
org.dataone.service.exceptions.ServiceFailure
at edu.ucsb.nceas.metacat.restservice.v2.MNResourceHandler.handle(MNResourceHandler.java:514)
at edu.ucsb.nceas.metacat.restservice.D1RestServlet.doGet(D1RestServlet.java:75)

History

#1 Updated by Jing Tao over 9 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 30

Fixed the issue that we didn't check sm.getMediaType() is null or not. I tested this locally and it worked. I am waiting for Andrei to test it.

#2 Updated by Jing Tao over 9 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 30 to 100

Andrei verified that the bug was fixed.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 14.8 MB)