Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugins/request-transformer: missing migrations #1064

Closed
deltheil opened this issue Mar 10, 2016 · 2 comments
Closed

plugins/request-transformer: missing migrations #1064

deltheil opened this issue Mar 10, 2016 · 2 comments
Assignees
Labels

Comments

@deltheil
Copy link

As of #824 schema.lua has been modified. Still there is no schema/migrations.lua file for this plugin.

This breaks at runtime, e.g. from an instance of Kong migrated from 0.5.4 to 0.7.0, for a call over an API that uses the request-transformer with config.add.headers only (i.e. no config.remove.headers, etc):

[error] 476#0: *110 lua entry thread aborted: runtime error: ...hare/lua/5.1/kong/plugins/request-transformer/access.lua:86: attempt to index field 'remove' (a nil value)
stack traceback:
coroutine 0:
        ...hare/lua/5.1/kong/plugins/request-transformer/access.lua: in function 'transform_headers'
        ...hare/lua/5.1/kong/plugins/request-transformer/access.lua:309: in function 'execute'
        ...are/lua/5.1/kong/plugins/request-transformer/handler.lua:12: in function 'access'
        /usr/local/share/lua/5.1/kong.lua:173: in function 'access'

See this line.

As a workaround I removed and re-added the plugin.

@thibaultcha
Copy link
Member

Dang. @shashiranjan84 Could you add the appropriate migrations for this?

@thibaultcha
Copy link
Member

Another option could be to handle this in the plugin's logic. Doing so would probably be safer, plus the performance overhead might not be significant since all schemas after #824 do have the remove (and others) fields, so branch prediction should step in here. A migration would still be useful for users though.

Thanks @deltheil for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants