apollo-tracing-ruby
apollo-tracing-ruby copied to clipboard
Proxy crashes after multiple errors
I setup this gem for our production GraphQL API today and within an hour our API stopped responding and I saw this error in the logs from the proxy:
time="2018-06-27T17:42:25Z"
level=warning
msg="Received unsupported Content-Type from origin GraphQL server. This often occurs when a GraphQL server throws an error and sends that error as `text/plain` instead of embedding it within a GraphQL error. Check to make sure any errors encountered during resolver execution and middleware processing are translated into the GraphQL errors field. This could also be caused by an inaccurate Content-Type header."
content-type=text/html
response-body="{\"message\": \"Something went wrong. We've already been notified of the problem and are working to fix it. We apologise for the inconvenience.\"}"
That error repeated 15 times before I see this in the log
Couldn't cleanly terminate the Apollo Engine Proxy in 3 seconds!
After that point, the proxy completely died and all API requests went ignored.
So from the error message I'm wondering if I need to change the format of the 500.html page to be JSON instead of a text/html format and if that would fix the issue? Also I'm wondering why the proxy doesn't try to restart itself after dying.
Thanks in advance for the help!
Cody
This happened to me as well and I decided to deploy the apollo engine proxy as a separate service in our kubernetes cluster. Here you have the instructions to deploy the proxy as a separate container.