背景
我使用的是docker环境部署,使用的是自定义挂载plugins路径
-e "KONG_LUA_PACKAGE_PATH=/plugins/?.lua" \
-v "/plugins:/plugins" \
-e "KONG_PLUGINS=bundled,helloworld" \
但是当我只需docker run的时候就报错文章来源:https://www.toymoban.com/news/detail-724686.html
[error] 1#0: init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:592: error loading plugin schemas: on plugin 'helloworld': helloworld plugin is enabled but not installed;
no plugin found
stack traceback:
[C]: in function 'assert'
/usr/local/share/lua/5.1/kong/init.lua:592: in function 'init'
init_by_lua:3: in main chunk
nginx: [error] init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:592: error loading plugin schemas: on plugin 'helloworld': helloworld plugin is enabled but not installed;
no plugin found
stack traceback:
[C]: in function 'assert'
/usr/local/share/lua/5.1/kong/init.lua:592: in function 'init'
init_by_lua:3: in main chunk
curl -i -X PATCH --url http://localhost:8001/plugins/demo --data "config.position=1"
如何解决
- 是因为挂的是到 plugins目录,我当时是直接报 handler.lua和schema.lua放在了 plugins目录下面了,不能这么放,应该建个目录
mkdir -p /plugins/kong/plugins/helloworld
然后把 lua文件放在 /plugins/kong/plugins/helloworld/ 目录下文章来源地址https://www.toymoban.com/news/detail-724686.html
到了这里,关于解决kong部署自定义插件报 helloworld plugin is enabled but not installed的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!