Go PDK different version issue

Hi,

I’ve also created an issue on the Go PDK GitHub repository.

I’m trying to write a simple ‘hello world’ style Kong plugin in Golang and I’m getting an error on startup.

kong             | 2020/02/06 15:10:12 failed to open plugin test-go: plugin.Open("/home/kong/plugins/test-go"): plugin was built with a different version of package github.com/Kong/go-pdk/bridge
kong             | 2020/02/06 15:10:12 [error] 1#0: init_by_lua error: /usr/local/share/lua/5.1/kong/db/dao/plugins/go.lua:455: bad argument #1 to 'ipairs' (table expected, got nil)
kong             | stack traceback:
kong             | 	[C]: in function 'ipairs'
kong             | 	/usr/local/share/lua/5.1/kong/db/dao/plugins/go.lua:455: in function 'get_plugin'
kong             | 	/usr/local/share/lua/5.1/kong/db/dao/plugins/go.lua:481: in function 'load_plugin'
kong             | 	/usr/local/share/lua/5.1/kong/db/dao/plugins.lua:151: in function 'load_plugin_handler'
kong             | 	/usr/local/share/lua/5.1/kong/db/dao/plugins.lua:227: in function 'load_plugin'
kong             | 	/usr/local/share/lua/5.1/kong/db/dao/plugins.lua:275: in function 'load_plugin_schemas'
kong             | 	/usr/local/share/lua/5.1/kong/init.lua:425: in function 'init'
kong             | 	init_by_lua:3: in main chunk
kong             | nginx: [error] init_by_lua error: /usr/local/share/lua/5.1/kong/db/dao/plugins/go.lua:455: bad argument #1 to 'ipairs' (table expected, got nil)
kong             | stack traceback:
kong             | 	[C]: in function 'ipairs'
kong             | 	/usr/local/share/lua/5.1/kong/db/dao/plugins/go.lua:455: in function 'get_plugin'
kong             | 	/usr/local/share/lua/5.1/kong/db/dao/plugins/go.lua:481: in function 'load_plugin'
kong             | 	/usr/local/share/lua/5.1/kong/db/dao/plugins.lua:151: in function 'load_plugin_handler'
kong             | 	/usr/local/share/lua/5.1/kong/db/dao/plugins.lua:227: in function 'load_plugin'
kong             | 	/usr/local/share/lua/5.1/kong/db/dao/plugins.lua:275: in function 'load_plugin_schemas'
kong             | 	/usr/local/share/lua/5.1/kong/init.lua:425: in function 'init'
kong             | 	init_by_lua:3: in main chunk

I’m running Kong in docker (2.0.1-alpine), I’m compiling using Go 1.13.4 and requiring v0.3.0 of the PDK in my go.mod file.

Does anyone have any idea why I’m getting this error?


© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ