IHTSDO / snowstorm

Scalable SNOMED CT Terminology Server using Elasticsearch
Other
208 stars 83 forks source link

Snowstorm doesn't throw error on bulk POST #264

Open hurtigcodes opened 3 years ago

hurtigcodes commented 3 years ago

We have users that are asking us about adding postcoordinated expressions as precoordinationed concepts in Snowstorm. We have informed our users this is currently unsupported, that they may not point to a concept and add an attribute. Instead, they need to recreate the concept as a whole and add a new attribute. We would like confirmation if this assessment is correct, that Snowstorm requires an "IS-A" relationship as a minimum to convert axiom.

However, we have frontends using the /browser/{branch}/concepts/bulk endpoint and if the request body does not contain an "IS-A" relationship, then the following unexpected behavior occurs:

201 Created

(Despite the 201, none of the added components are found on branch afterwards)

And not the expected result:

{
  "error": "INTERNAL_SERVER_ERROR",
  "message": "Failed to convert Relationship(s) to Axiom(s)."
}

Lastly, the PUT /browser/{branch}/concepts/{conceptId} endpoint works as expected, throwing us the error above.

kaicode commented 3 years ago

Hi @hurtigcodes, The bulk concept create/update endpoint is asynchronous. So in this context 201 Created means the bulk job has been created. Use the Location header from the response to lookup the bulk job status. The bulk job status should contain details of any errors or the created/updated concepts, however it looks like there is indeed a bug where if an axiom conversion exception is thrown the bulk job remains in a RUNNING status and does not fail.. Thank you for letting us know. We will get this fixed when we can.

kaicode commented 3 years ago

Maintenance ticket created MAINT-1664 scheduled for July.