When using plugins that execute arbitrary Lua code, such as serverless plugins or the Exit Transformer plugin, you may encounter the following error in your Kong Gateway logs:
{"message":"An unexpected error occurred"}A review of the Kong error log shows something similar to the below output:
2023/02/10 12:49:34 [error] 2107#0: *2582 [kong] init.lua:317 [pre-function] /usr/local/share/lua/5.1/kong/tools/kong-lua-sandbox.lua:171: /usr/local/share/lua/5.1/kong/tools/sandbox.lua:88: require 'resty.http' not allowed within sandbox, client: 192.168.64.1, server: kong, request: "GET /echo HTTP/1.1", host: "localhost:8000"