Internal Server Error 500 with larger JSON request payloads

819 views
Skip to first unread message

Daniel Bär

unread,
Jun 14, 2016, 5:24:37 AM6/14/16
to Kong
Hey there,

we've just run into an unexpected behavior with Kong (latest version 0.8.3): When posting a rather short request JSON object to the proxied API like the following, everything works as expected and we get a 200 OK status and the expected JSON response.

The request object that works fine is this one:

{
    "docId": "the-who-live-in-concert",
    "text": "When Who played Tommy in Columbus, Pete was at his best."
}

However, when we increase the length of the "text" parameter to be around 20k, we get an Internal Server Error 500. Content-Type is set to application/json, method is POST. We pass the access_token as query parameter like this: https://api.ambiverse.com/entitylinking/v1beta1/analyze?access_token=ACCESS_TOKEN

The error.log shows the following entry:

*121 lua entry thread aborted: runtime error: /usr/local/share/lua/5.1/kong/tools/utils.lua:172: bad argument #1 to 'pairs' (table expected, got nil)
stack traceback:
coroutine 0:
[C]: in function 'pairs'
/usr/local/share/lua/5.1/kong/tools/utils.lua:172: in function 'retrieve_parameters'
/usr/local/share/lua/5.1/kong/plugins/oauth2/access.lua:359: in function 'parse_access_token'
/usr/local/share/lua/5.1/kong/plugins/oauth2/access.lua:412: in function 'execute'
/usr/local/share/lua/5.1/kong/plugins/oauth2/handler.lua:12: in function 'access'
/usr/local/share/lua/5.1/kong.lua:188: in function 'access'
access_by_lua(nginx.conf:98):2: in function <access_by_lua(nginx.conf:98):1>, client: 139.19.106.189, server: _, request: "POST /entitylinking/v1beta1/analyze?access_token=ACCESS_TOKEN HTTP/1.1", host: "api.ambiverse.com"

Initially, we suspected that the request-size-limiting plugin is misconfigured, but this seems not to be the case. Even when disabling it, the issue persists.

Please advise.

Best regards,
Daniel

Marco

unread,
Jul 22, 2016, 9:05:19 PM7/22/16
to Daniel Bär, Kong
I have just pushed a commit (https://github.com/Mashape/kong/commit/0c8a87254b4bdd5a275a5a0ccdb801a080f14ad3) that could fix this problem in the next version (0.9).


 Marco Palladino | CTO @ Mashape | mashape.com+1 (415) 361-3858

--
You received this message because you are subscribed to the Google Groups "Kong" group.
To unsubscribe from this group and stop receiving emails from it, send an email to konglayer+...@googlegroups.com.
To post to this group, send email to kong...@googlegroups.com.
Visit this group at https://groups.google.com/group/konglayer.
To view this discussion on the web visit https://groups.google.com/d/msgid/konglayer/202aa73c-283e-4aab-a9ca-2c6f2bdd752d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages