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

GET consumer by custom_id fails #4402

Closed
joarSv opened this issue Mar 18, 2019 · 1 comment · Fixed by #4435
Closed

GET consumer by custom_id fails #4402

joarSv opened this issue Mar 18, 2019 · 1 comment · Fixed by #4435
Labels

Comments

@joarSv
Copy link

joarSv commented Mar 18, 2019

Summary

Kong fails when making a GET request to the admin endpoint "consumers" with a filter on a custom ID like below. The input validation of args.custom_id doesn't seem to handle guids anymore?

GET /consumers?custom_id=01179005-748f-42b0-b11d-627df05e1570

This issue was introduced to us after upgrading from Kong 0.14 to 1.0.3.

[error] 36#0: *572512 lua coroutine: runtime error: /usr/local/share/lua/5.1/kong/api/routes/consumers.lua:18: custom_id must be a string
stack traceback:
coroutine 0:
	[C]: in function 'error'
	/usr/local/share/lua/5.1/kong/db/dao/init.lua:103: in function 'validate_unique_type'
	/usr/local/share/lua/5.1/kong/db/dao/init.lua:357: in function 'select_entity'
	/usr/local/share/lua/5.1/kong/api/routes/consumers.lua:18: in function 'fn'
	/usr/local/share/lua/5.1/kong/api/init.lua:45: in function </usr/local/share/lua/5.1/kong/api/init.lua:28>
coroutine 1:
	[C]: in function 'resume'
	/usr/local/share/lua/5.1/lapis/application.lua:393: in function 'handler'
	/usr/local/share/lua/5.1/lapis/application.lua:130: in function 'resolve'
	/usr/local/share/lua/5.1/lapis/application.lua:161: in function </usr/local/share/lua/5.1/lapis/application.lua:159>
	[C]: in function 'xpcall'
	/usr/local/share/lua/5.1/lapis/application.lua:159: in function 'dispatch'
	/usr/local/share/lua/5.1/lapis/nginx.lua:215: in function 'serve_admin_api'

Steps To Reproduce

  1. Create a consumer with a guid string as custom_id (e.g 01179005-748f-42b0-b11d-627df05e1570)
  2. Request /consumers?custom_id=01179005-748f-42b0-b11d-627df05e1570

Additional Details & Logs

  • Kong version: 1.0.3
  • Operating system: Official docker image (kong:1.0.3-alpine)
bungle added a commit that referenced this issue Mar 26, 2019
This issue was reported by @JoarSvensson on issue #4402.
@bungle
Copy link
Member

bungle commented Mar 26, 2019

Thank you @JoarSvensson! This should be fixed with soon to be out 1.1 and perhaps if we release 1.0.4 at some point (not sure about it).

bungle added a commit that referenced this issue Mar 26, 2019
This issue was reported by @JoarSvensson on issue #4402.
hishamhm pushed a commit that referenced this issue Mar 26, 2019
This issue was reported by @JoarSvensson on issue #4402.

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

Successfully merging a pull request may close this issue.

2 participants