-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempt to index local 'form' (a nil value) #26
Comments
@zayednetad The local form, err = upload:new(chunk_size)
if not form then
ngx.log(ngx.ERR, "failed to new upload: ", err)
ngx.exit(500)
end |
Now it says below: 2016/07/01 00:14:36 [error] 19582#0: *3 [lua] uploadtest.lua:7: failed to new upload: request body already exists, client: 127.0.0.1, server: localhost, request: "POST /uploadtest HTTP/1.1", host: "127.0.0.1:8089" |
The error message clearly indicates that the request body has already been read by something else. Ensue you do not turn on the lua_need_request_body directive in your nginx.conf and do not call ngx.req.read_body() nor ngx.req.discard_body(), for example. All these would consume the request body before this library can get its hands on it. |
With the same issues , but i got nothing like ngx.req.read_body() nor ngx.req.discard_body() in nginx.conf ;what's the next step should i take to resolve it ? Here 's the code
this line "ngx.log(ngx.ERR,filename) " logs a nil ; |
Hi,
I am following below code on fedora Linux with nginx:
When I run this as
curl -F "[email protected]" http://127.0.0.1:8089/uploadtest
It gives me below errors:
$ tail -f /usr/local/openresty/nginx/logs/error.log 2016/06/29 15:26:23 [error] 31449#0: *12 lua entry thread aborted: runtime error: /usr/local/openresty/nginx/uploadtest.lua:13: attempt to index local 'form' (a nil value) stack traceback: coroutine 0: /usr/local/openresty/nginx/uploadtest.lua: in function </usr/local/openresty/nginx/uploadtest.lua:1>, client: 127.0.0.1, server: localhost, request: "POST /uploadtest HTTP/1.1", host: "127.0.0.1:8089"
Can you please help me what is wrong here?
The text was updated successfully, but these errors were encountered: