-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
plugin is in use but not enabled #1887
Comments
FYI - My temp workaround is hardcoding conf_loader.lua load path to use /etc/kong/kong.conf: local function load(path, custom_conf)
------------------------
-- Default configuration
------------------------
path = '/etc/kong/kong.conf' |
Hi, Please provide us with the Kong version you are using, as asked in the "Additional Details & Logs" section of the issue template. A question for you: do you have a configuration file at one of the default paths (such as |
|
|
I believe this is related to #1817, its the same behavior. What I mean is that I can "add" my plugin using the api... then I would get an error when I restart. To confirm, I checked out the 0.9.5 tag and no longer had the issue - instead I got some errors from differences in cache.get_or_set between 0.9.5 and 0.9.6. This is good to know at least. |
It seems to be an issue related to rewriting the kong.conf file, when preparing the prefix folder. When the config is loaded, the custom_plugins value is converted to a map and merged with the constants.PLUGINS_AVAILABLE map, then added to the config as 'conf.plugins'. This value is then written out using table.concat - but the plugin names are the keys, not the values, in this table. See lines 270-275 in cmd/utils/prefix_handler.lua One solution would be to not remove the original value from the config on line 338 of conf_loader.lua. |
@thibaultcha can you check the above? |
There was a fix written for this in #1910. The PR wasn't properly merged though so I don't think it is included in the recent 0.10rc1. I'll make sure to include it in a future release. Mind trying out the patch in the meanwhile? |
@thibaultcha I noticed that 0.9.8 had the change from #1910. I can confirm that it fixed the issue for my use case. I am good with this being close since it has been addressed. |
Good to know, thanks. |
Summary
I am developing a third party plugin, the problem is that when I start kong (using kong-vagrant) I get the message "plugin is in use but not enabled". If I hardcode the plugin in to custom_plugins in conf_loader.conf, it works no problem. If I set the value in a new config file called /etc/kong/kong.conf debugging shows that kong (kong start -c /etc/kong/kong.conf) essentially runs twice ( strange ) - once with a generated /usr/local/kong/kong.conf config file, and the other time with the my config file.
To be clear, if I add the plugin to the list of plugins in the constants file, it works. If I hardcode my plugin in to the custom_plugins list it works as well: https://github.com/Mashape/kong/blob/next/kong/conf_loader.lua#L369
Perhaps I should not be developing a plugin against the next branch? Or perhaps I am doing something wrong.
Steps To Reproduce
custom_plugins = <plugins-name>
Additional Details & Logs
$ kong version
)$ kong start --vv
)<KONG_PREFIX>/logs/error.log
)The text was updated successfully, but these errors were encountered: