Closed hutchic closed 3 days ago
For kong master, I could still reproduce it:
xc ~ $ curl -X GET 'http://localhost:8001/ca_certificates?tags=1'
{"next":null,"data":[]}
xc ~ $ curl -X GET 'http://localhost:8001/ca_certificates?tags='
{"message":"An unexpected error occurred"}
xc ~ $ curl -X GET 'http://localhost:8001/ca_certificates'
{"next":null,"data":[]}xc ~ $
and it reported the runtime error in admin error log file:
2024/09/02 10:30:14 [error] 96780#0: *647 [lua] api_helpers.lua:541: handle_error(): ...l-bin/build/kong-dev/share/lua/5.1/lapis/application.lua:440:
...ng/bazel-bin/build/kong-dev/share/lua/5.1/pl/stringx.lua:32:
argument 1 expected a 'string', got a 'userdata'
stack traceback:
[C]: in function 'error'
...kong/bazel-bin/build/kong-dev/share/lua/5.1/pl/utils.lua:291: in function 'assert_arg'
...ng/bazel-bin/build/kong-dev/share/lua/5.1/pl/stringx.lua:32: in function 'assert_string'
...ng/bazel-bin/build/kong-dev/share/lua/5.1/pl/stringx.lua:194: in function 'split'
./kong/api/endpoints.lua:167: in function 'extract_options'
./kong/api/endpoints.lua:210: in function 'page_collection'
./kong/api/endpoints.lua:320: in function 'fn'
./kong/api/api_helpers.lua:312: in function <./kong/api/api_helpers.lua:290>
Internal ticket tracking code: KAG-5496
Is there an existing issue for this?
Kong version (
$ kong version
)Kong 2.7.1
Current Behavior
Requests with
?tags=
to the admin api results in a 500 errorKong logs
stringx.lua:32: argument 1 expected a 'string', got a 'userdata'
Expected Behavior
The API should return a valid response, such as an empty list of CA certificates or a relevant error message indicating that the tags parameter is required, if applicable. The system should handle empty tags gracefully without causing an internal server error.
Steps To Reproduce
run kong run the curl
curl -X GET 'http://localhost:8001/ca_certificates?tags='
Anything else?
No response