解决kong部署自定义插件报 helloworld plugin is enabled but not installed

背景

我使用的是docker环境部署,使用的是自定义挂载plugins路径

bash 复制代码
-e "KONG_LUA_PACKAGE_PATH=/plugins/?.lua" \
-v "/plugins:/plugins" \
-e "KONG_PLUGINS=bundled,helloworld" \

但是当我只需docker run的时候就报错

 [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/ 目录下

相关推荐
你的代码我的心6 天前
docker下部署kong+consul+konga 报错问题处理
docker·kong·consul
summer_west_fish15 天前
Kong故障转移参数配置
网络·kong
张声录115 天前
centos 7.x无法安装kong gateway 3.9X的解决方案
centos·gateway·kong
张声录11 个月前
【kong gateway】5分钟快速上手kong gateway
gateway·kong
张声录11 个月前
【Kong Gateway】全面解析Kong Gateway:服务、路由、upstream、插件的核心概念介绍
网络·gateway·kong
张声录11 个月前
kong 网关和spring cloud gateway网关性能测试对比
kong
等一场春雨2 个月前
window11 wsl mysql8 错误分析:1698 - Access denied for user ‘root‘@‘kong.mshome.net‘
android·kong
MavenTalk2 个月前
微服务网关SpringCloudGateway、Kong比较
spring boot·网关·spring cloud·微服务·架构·kong
Hello.Reader3 个月前
Kong API Gateway 深度解析与实战指南
gateway·kong
风霜不见闲沉月4 个月前
kong网关的使用
junit·kong