2
votes

I am testing a grpc endpoint using Postman. I set in the header Content-Type: application/json, then in the body, I chose raw, JSON.

However, I keep getting the 500 Internal Server Error, and the details is:

[grpc-default-executor-1] ERROR me.dinowernli.grpc.polyglot.io.LoggingStatsWriter - Aborted rpc due to error io.grpc.StatusRuntimeException: UNAVAILABLE: HTTP status code 502 invalid content-type: text/plain.

And what's more weird is that when I check the Headers in response, it shows Content-Type as text/plain; charset=utf-8, so that means the Content-Type: application/json that I set was not applied.

enter image description here

Any ideas?

1
The content type of the response is exactly that: The type of the response you got back, which is indeed plain txt (the error message), and not JSON. - Christian Baumann
Thank, Christian! Any idea how should I solve this error? @ChristianBaumann - daertutu

1 Answers

0
votes

Turns out this is not the root cause, the error message does not show the actual error.

In my case, it was due to multiple services running locally, and the yml does not config properly. But I believe that does not apply for all, lots of other cases might also show the same error message.