How to troubleshoot "API disabled in the context of (unknown)" while reading request body in Lua

661 views
Skip to first unread message

rvsw

unread,
Apr 6, 2015, 12:52:44 PM4/6/15
to openre...@googlegroups.com
Hello
On a POST request, ngx.req.read_body() is getting executed and resulting in  API disabled in the context of (unknown) error. As far as I can see, this is a 'conventional' POST request sent in one chunk (POST a small form). I change configuration and lua code to skip that POST and things work ok. I found same problem accidentally while loading accounts.google.com frontended by my toy nginx config in reverse proxy. Googling does not bring up answers in request but has some pointers for response (which is not the case here). Can you please advise on how to troubleshoot this.

Lord Nynex

unread,
Apr 6, 2015, 2:29:10 PM4/6/15
to openre...@googlegroups.com
Hello,

In the future, please paste the exact error message and configuration. The question by itself does not help anyone help you.  What follows is a guess due to lack of information.

It seems you're performing a function (perhaps ngx.location.capture) in a context that can not run it. There is no troubleshooting it. It is an operation that is unsupported.

An example might be, ngx.location.capture inside of an init_by_lua block. The reason is ngx.location capture requires an internal request object to function. A request object like this is unavailable at the init phase. 

On Mon, Apr 6, 2015 at 9:52 AM, rvsw <rv...@hotmail.com> wrote:
Hello
On a POST request, ngx.req.read_body() is getting executed and resulting in  API disabled in the context of (unknown) error. As far as I can see, this is a 'conventional' POST request sent in one chunk (POST a small form). I change configuration and lua code to skip that POST and things work ok. I found same problem accidentally while loading accounts.google.com frontended by my toy nginx config in reverse proxy. Googling does not bring up answers in request but has some pointers for response (which is not the case here). Can you please advise on how to troubleshoot this.

--
You received this message because you are subscribed to the Google Groups "openresty-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openresty-en...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages