question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question about 500 statuscode from RestLiServiceException for a client-side error

See original GitHub issue

If 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:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
anshbansalcommented, Jul 25, 2022

@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.

0reactions
github-actions[bot]commented, Nov 16, 2022

This issue was closed because it has been inactive for 30 days since being marked as stale.

Read more comments on GitHub >

github_iconTop Results From Across the Web

500 Internal Server Error - HTTP - MDN Web Docs - Mozilla
This error response is a generic "catch-all" response. Usually, this indicates the server cannot find a better 5xx error code to response.
Read more >
What Is a "500 Internal Server Error" and How Do I Fix It?
This error means there is a problem on the server side. A server error can be caused by any number of things from...
Read more >
HTTP Error 500 – Internal Server Error Explained in Plain ...
According to RFC 7231: The 500 (Internal Server Error) status code indicates that the server encountered an unexpected condition that prevented ...
Read more >
HTTP 500 Internal Server Error: What It Means & How to Fix It
An HTTP 500 internal server error is a general error message. It covers unexpected issues that don't fit into existing error codes. HTTP...
Read more >
HTTP Status Code 500: What Is the 500 "Internal Server Error"?
The 500 status code "internal server error" is just that - it's an error on the server-side. This means that the server encountered...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found