Kong: 0.11.0rc2: failed to iterate over APIs plugins

Created on 2 Aug 2017  路  5Comments  路  Source: Kong/kong

Summary

When trying to iterate over APIs plugins it fails.
Error is

kong-01.dev      | 2017/08/01 15:44:02 [error] 318#0: *7356 lua entry thread aborted: runtime error: /usr/local/share/lua/5.1/kong/core/plugins_iterator.lua:74: attempt to index local 'schema' (a nil value)
kong-01.dev      | stack traceback:
kong-01.dev      | coroutine 0:
kong-01.dev      |      /usr/local/share/lua/5.1/kong/core/plugins_iterator.lua: in function '(for generator)'
kong-01.dev      |      /usr/local/share/lua/5.1/kong.lua:348: in function 'access'
kong-01.dev      |      access_by_lua(nginx-kong.conf:89):2: in function <access_by_lua(nginx-kong.conf:89):1>, client: 172.20.1.18, server: kong, request: "PUT /v1/session HTTP/1.1", host: "dev-api.localapp.ch"

After looking at the commit baf69f1f230c77300f3a94be7fc72643caef1e9d I supposed the code perf optimisation failed at some point.

Replacing the file with the previous version and reloading kong did the trick.

Steps To Reproduce

  1. Created an API (opened) without plugins configuration + an API (restricted) with a JWT plugin (+ a consumer of course)
  2. Did try to use the opened API worked well
  3. Did try to use the restricted API it failed with unexpected error
  4. Replacing kong/core/plugins_iterator.lua with the 0.11.0rc1 version solved the problem

Additional Details & Logs

  • Kong version 0.11.0rc2
  • Operating System => Docker kong:0.10.3 + removed kong 0.10.3 + installed 0.11.0rc2
tasbug

All 5 comments

Hi @thochra!

Thank you so much for the report! This was indeed an issue with rc2. I just pushed a fix for this at #2760. Thank you for giving 0.11.0rc2 a try and reporting your findings, much appreciated.

Thank you for the quick action !

Best, Thomas

Hi @thochra , we have merged the change in our next branch. Could you please check that it works correctly in your setup, so we can close this issue? Thanks!

Hi @kikito, over the tests I did everything behaved as expected.
Thank you guys !

Note: Here how I patched it in my Dockerfile

FROM kong:0.10.3

RUN yum remove -y kong-$KONG_VERSION
ENV KONG_VERSION 0.11.0rc2
RUN yum install -y wget https://github.com/Mashape/kong/releases/download/$KONG_VERSION/kong-$KONG_VERSION.el7.noarch.rpm && \
    yum clean all

# Fixing issue https://github.com/Mashape/kong/issues/2756
RUN curl 'https://raw.githubusercontent.com/Mashape/kong/810fad6f92d57e36a9f1a08ee21528548e6efa2c/kong/core/plugins_iterator.lua' \
    -o /usr/local/share/lua/5.1/kong/core/plugins_iterator.lua
RUN curl 'https://raw.githubusercontent.com/Mashape/kong/810fad6f92d57e36a9f1a08ee21528548e6efa2c/kong/kong.lua' \
    -o /usr/local/share/lua/5.1/kong/kong.lua

Great, considering this resolved then! Thank you again for the report, extremely helpful for us!

Was this page helpful?
0 / 5 - 0 ratings