Closed JonathanLorimer closed 4 years ago
As another note, when I go into the docker image via docker exec
and change etc/kong/kong.conf
manually, then run kong start -c /etc/kong/kong.conf --vv
the output only shows plugins = {"bundled"}
. However, when i run kong reload -c /etc/kong/kong.conf --vv
I see plugins = {"bundled","permission-middleware"}
, but obviously the kong instance doesn't start because one is already running (I get this error Error: /usr/local/share/lua/5.1/kong/cmd/start.lua:24: Kong is already running in /usr/local/kong
)
Okay, I seem to have resolved the issue where my custom plugin wasn't being loaded on kong reload
. However, now when I do a kong reload with the verbose flag it DOES show that my custom plugin is loaded, but when I query the admin endpoint it only shows the bundled
plugin. Additionally, if I try to run my config, which I am using the terraform provider for, I get an error message like this
Error: Error applying plan:
1 error occurred:
* kong_plugin.permission-middleware: 1 error occurred:
* kong_plugin.permission-middleware: failed to create kong plugin: &{permission-middleware <nil> <nil> <nil> map[second:5 hour:1000] 0xc000497468} error: could not create plugin, err: {"message":"schema violation (name: plugin 'permission-middleware' not enabled; add it to the 'plugins' configuration property)","name":"schema violation","fields":{"name":"plugin 'permission-middleware' not enabled; add it to the 'plugins' configuration property"},"code":2}
What is the difference between the plugins property that is output from kong reload -c etc/kong/kong.conf --vv
and the plugins property that is output from querying the admin endpoint?
Turns out it was an error with the Lua script in my plugin. It might be a good idea to log an error when the docker image doesn't build correctly? Or to note that one should run docker logs <container-id>
if the docker image doesn't build correctly.
I am using this script to startup kong from a docker container. Whenever the environment variable
KONG_PLUGINS
is set the image doesn't load properly; if I rundocker ps
I can't see it. However, the postgres image is fine. Additionally, when I do not have theKONG_PLUGINS
env var set, the docker image starts up just fine, but then I am obviously not able to configure my custom plugin.If anyone has any idea why this might be happening, their help would be greatly appreciated.