We are trying to use the hello-world plugin described in this page - https://streamdata.io/blog/developing-an-helloworld-kong-plugin/
We are facing this error in logs:
2017/09/19 09:47:15 [error] 1#0: init_by_lua error: /usr/local/share/lua/5.1/kong.lua:154: hello-world plugin is in use but not enabled
stack traceback:
/usr/local/share/lua/5.1/kong.lua:154: in function 'init'
init_by_lua:3: in main chunk
The Kong version we are using is 0.11.0.
Can someone suggest what could we be missing?
1.vim /usr/local/share/lua/5.1/kong/templates/kong_defaults.lua +8
2.custom_plugins = hello-world
3.kong restart
that message means the plugin "hello-world" is in use (eg. there is a reference in the database to it), but it is not enabled (eg. you did not define the custom_plugins configuration property).
do KONG_CUSTOM_PLUGINS=hello-world kong start
I fixed this issue by adding things in custom_plugins and lua_package_path .
Here are the steps to enable and use custom plugin in kong Env.
1 - Add custom plugin name in --- custom_plugins = hello-world
2 - Install hello-world plugin by using following steps ---
If you have source code of your plugin then move into it and execute the command --- "luarocks make"
it will install your plugin.
now you have to execute a command "make install-dev" make sure your plugin have makefile like as --
Once you execute this command "make install-dev". it will create lua file at a location something like that -
/your-plugin-path/lua_modules/share/lua/5.1/kong/plugins/your-plugin-name/?.lua
just copy this path and add it into the kong configuration file in lua_package_path
Something like that --
lua_package_path=/your-plugin-path/lua_modules/share/lua/5.1/kong/plugins/your-plugin-name/?.lua
Now you done your job.
Just start kong -- kong start --vv
You will see that the plugin loaded into kong plugin env.
@Enjoy
Most helpful comment