这是indexloc提供的服务,不要输入任何密码
Skip to content

Strange behaviour with require loader #28

@ronan-skyscanner

Description

@ronan-skyscanner

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions