Incomplete response body being returned from Rails 3 app with RABL
Asked Answered
E

1

5

I've built a JSON API using Rails 3 and RABL

The API works well but on particular requests only part of the data is returned - the rest of the JSON is cut off. Since the JSON is therefore invalid, the mobile app which relies on the API is crashing.

Can anybody think of why the body is cut off at a certain size and point me in the right direction to resolve the issue? Thanks

Ephraim answered 31/7, 2012 at 11:18 Comment(1)
Is it always a 'max length' or is it cutting off based on the content contained in the response? If length, what length is it truncating after?Maciemaciel
E
8

So I was able to track this issue down to Passenger

Long story short I fixed it by setting passenger_buffer_response off; in my passenger configs.

Ephraim answered 2/8, 2012 at 9:44 Comment(3)
Do you have any idea how to deal with it on Unicorn + Nginx? I came to exactly same problem in Unicorn but just can't figure out how to properly config it. Thank you!Entomophagous
Add proxy_buffering off; to your location block unicorn.bogomips.org/examples/nginx.confEphraim
According to the comment by Hongli Lai (creator of passenger) this does not apply anymore as the bug got fixed. #29241553Straightway

© 2022 - 2024 — McMap. All rights reserved.