Question about 500 statuscode from RestLiServiceException for a client-side error
See original GitHub issueIf I send a MetadataChangeProposal (MCP) to datahub gms, with the correct properties for the class, but I use a value that is not correct, I see a 500 error returned.
I can get some indication from the Java error stack as to what caused the issue, 500
. An example response from a contrived request is shown below:
Error emitting data failed: ('Unable to emit metadata to DataHub GMS', {'exceptionClass':
'com.linkedin.restli.server.RestLiServiceException', 'stackTrace': 'com.linkedin.restli.server.RestLiServiceException
[HTTP Status:500]: java.lang.RuntimeException: Unknown aspect corpGroup for entity domain\n...
...
com.linkedin.metadata.restli.RestliUtil.toTask(RestliUtil.java:30)...',
'message': 'java.lang.RuntimeException: Unknown aspect corpGroup for entity domain', 'status': 500})
and this is certainly all OK by me, I just have a minor question about the status code itself.
I would have thought that this sort of error would be some form of 4xx? e.g., maybe a 422?
I understand that in the example above the syntax of the MCP might be correct, so not a 400, but the above seems like a client error, not a problem with the server.
Maybe I’ve misunderstood the use of 5xx codes, but a 500
to me seems to indicate there’s nothing I’ve done wrong with the request, but there is a problem on the server. What is the reason this is sent back as a server error? Is it because it’s too difficult to tell whether something has failed server-side or whether it is a client issue? As it seems to me from the error message, in the above example, that the server has processed the request well and does understand the client issue quite clearly.
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top GitHub Comments
@mattmm1 Your understanding of HTTP codes is correct. Our handling of the requests on the server is not perfect. This is a bug in the system. In an ideal scenario we should be sending the correct codes back.
If you would like to contribute back you can head to https://app.slack.com/client/TUMKD5EGJ/C017W0NTZHR and discuss the changes. Thanks for the report. This will be prioritised based on community requirements.
This issue was closed because it has been inactive for 30 days since being marked as stale.