lua-pb icon indicating copy to clipboard operation
lua-pb copied to clipboard

Strange behaviour with require loader

Open ronan-skyscanner opened this issue 9 years ago • 0 comments

I have encountered an issue in multiple occasions with the lua-pb plugin, and it seems with its package loader functionality in particular.

An example:

	no file '/opt/config.proto'
	no file '/usr/local/openresty/site/lualib/config.proto'
	no file '/usr/local/openresty/lualib/config.proto'
	no file './config.proto'
	no file '/usr/local/openresty/luajit/share/luajit-2.1.0-beta2/config.proto'
	no file '/usr/local/share/lua/5.1/config.proto'
	no file '/usr/local/openresty/luajit/share/lua/5.1/config.proto'
	no file '/usr/local/openresty/site/lualib/config.proto'
	no file '/usr/local/openresty/lualib/config.proto'
	no file './config.proto'
	no file '/usr/local/openresty/luajit/share/luajit-2.1.0-beta2/config.proto'
	no file '/usr/local/share/lua/5.1/config.proto'
	no file '/usr/local/openresty/luajit/share/lua/5.1/config.proto'
stack traceback:
coroutine 0:
	[C]: in function 'require'
	/opt/kong/plugins/request-multiplexer/handler.lua:18: in function 'access'
	/usr/local/share/lua/5.1/kong.lua:164: in function 'access'
	access_by_lua(nginx-kong.conf:59):2: in function <access_by_lua(nginx-kong.conf:59):1>, client: 127.0.0.1, server: kong, request: "GET /kongadmin/apis?apikey=***** HTTP/1.1", host: "localhost:8000"

It seems to me that the lua-pb loading logic is being called when it shouldn't be. That is while trying to import config.lua, the lua-pb kicks in and tries to import config.proto. Worth mentioning that this is hard to pinpoint, and was seen for various files.

Is there a way not to register the pb loader, and instead rely on filenames for it?

ronan-skyscanner avatar Nov 22 '16 15:11 ronan-skyscanner