vaibhavsw commented on issue #7907:
URL: https://github.com/apache/apisix/issues/7907#issuecomment-1246172738

   I tried implementing
   
   ```JSON
   "serverless-pre-function": {
         "disable": false,
         "functions": [
           "return function(conf, ctx) 
httpc:request_uri(\"http://host.docker.internal:9191/health\";); end"
         ],
         "phase": "before_proxy"
       }
   ```
   
   and I got the below error in the error console:
   
   ```bash
   2022/09/14 02:52:47 [error] 45#45: *275474 lua entry thread aborted: runtime 
error: [string "return function(conf, ctx) httpc:request_uri(..."]:1: attempt 
to index global 'httpc' (a nil value)
   stack traceback:
   coroutine 0:
        [string "return function(conf, ctx) httpc:request_uri(..."]: in 
function 'func'
        /usr/local/apisix/apisix/plugins/serverless/init.lua:84: in function 
'phase_func'
        /usr/local/apisix/apisix/plugin.lua:897: in function 'common_phase'
        /usr/local/apisix/apisix/init.lua:555: in function 'http_access_phase'
        access_by_lua(nginx.conf:284):2: in main chunk, client: 172.18.0.1, 
server: _, request: "GET /dbt/actuator/health HTTP/1.1", host: "127.0.0.1:9080"
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to