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

go-pdk plugins break Kong 3.9.0 #14260

Open
1 task done
dpiddock opened this issue Feb 11, 2025 · 2 comments
Open
1 task done

go-pdk plugins break Kong 3.9.0 #14260

dpiddock opened this issue Feb 11, 2025 · 2 comments
Labels
area/ingress-controller Issues where Kong is running as a Kubernetes Ingress Controller area/kubernetes Issues where Kong is running on top of Kubernetes

Comments

@dpiddock
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Kong version ($ kong version)

3.9.0

Current Behavior

Kong 3.9.0 DBless returns errors on the root admin page when a go plugin is loaded, if there is no existing configuration. This is terminal to Kong on Kubernetes as it causes KIC to fail to configure Kong instances.

It does not happen every request with the MVP but it does in our larger live Kong plugin setup in Kubernetes.
Error in Kong output:

2025/02/11 16:25:51 [error] 1411#0: *1292 [lua] api_helpers.lua:558: handle_error(): /usr/local/share/lua/5.1/lapis/application.lua:440: /usr/local/share/lua/5.1/kong/api/api_helpers.lua:329: body encoding failed while flushing response: Cannot serialise cdata: type not supported
stack traceback:
	[C]: in function 'error'
	/usr/local/share/lua/5.1/kong/pdk/response.lua:732: in function 'fn'
	/usr/local/share/lua/5.1/kong/api/api_helpers.lua:329: in function </usr/local/share/lua/5.1/kong/api/api_helpers.lua:307>

stack traceback:
	[C]: in function 'error'
	/usr/local/share/lua/5.1/lapis/application.lua:440: in function 'handler'
	/usr/local/share/lua/5.1/lapis/application.lua:186: in function 'resolve'
	/usr/local/share/lua/5.1/lapis/application.lua:217: in function </usr/local/share/lua/5.1/lapis/application.lua:215>
	[C]: in function 'xpcall'
	/usr/local/share/lua/5.1/lapis/application.lua:215: in function 'dispatch'
	/usr/local/share/lua/5.1/lapis/nginx.lua:231: in function 'serve'
	/usr/local/share/lua/5.1/kong/init.lua:1878: in function 'admin_content'
	content_by_lua(nginx-kong.conf:355):2: in main chunk, client: 172.22.0.1, server: kong_admin, request: "GET / HTTP/1.1", host: "localhost:8001"
2025/02/11 16:25:51 [debug] 1411#0: *1292 [lua] init.lua:24: poll(): worker-events: emulate poll method
172.22.0.1 - - [11/Feb/2025:16:25:51 +0000] "GET / HTTP/1.1" 500 42 "-" "curl/8.12.0

Client receives a 500 and:

{"message":"An unexpected error occurred"}

KIC logs:

Error: unable to build kong api client(s): Kong Gateway version is not supported: getting Kong version: failed fetching Kong client root: HTTP status 500 (message: "An unexpected error occurred")

Expected Behavior

Kong returns valid json document when queried on admin interface /, as it does for version 3.8.0.

Steps To Reproduce

  1. Download MVP: https://gist.github.com/dpiddock/d2bfe437f48341bd33a5f616077cba8a
  2. docker compose up -d --build
  3. curl localhost:8001/ (may not error every time)

Anything else?

The exact same plugins and configuration work correctly with Kong 3.8.0.

@xianghai2 xianghai2 added area/kubernetes Issues where Kong is running on top of Kubernetes area/ingress-controller Issues where Kong is running as a Kubernetes Ingress Controller labels Feb 12, 2025
@jocadu
Copy link

jocadu commented Feb 27, 2025

Hi,
I am observing the same issue. The KIC logs show:

2025-02-27T20:30:12Z info Diagnostics server disabled {"v": 0}
2025-02-27T20:30:12Z info setup Starting controller manager {"v": 0, "release": "3.4.1", "repo": "https://github.com/Kong/kubernetes-ingress-controller.git", "commit": "9e84f95865ce430cae38f0524 ef0e4bfaf61c55e"}
2025-02-27T20:30:12Z info setup The ingress class name has been set {"v": 0, "value": "kong"}
2025-02-27T20:30:12Z info setup Getting enabled options and features {"v": 0}
2025-02-27T20:30:12Z info setup Getting the kubernetes client configuration {"v": 0}
W0227 20:30:12.265236 1 client_config.go:667] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.
2025-02-27T20:30:12Z info setup Starting standalone health check server {"v": 0}
2025-02-27T20:30:12Z info setup Getting the kong admin api client configuration {"v": 0}
W0227 20:30:12.265435 1 client_config.go:667] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.
Error: unable to build kong api client(s): Kong Gateway version is not supported: getting Kong version: failed fetching Kong client root: HTTP status 500 (message: "An unexpected error occurred")

The issue is NOT showing in another deployment of Kong 3.9.0 + KIC 3.4.1 where I do not have any Go plugins

@kbajy
Copy link

kbajy commented Feb 27, 2025

Hi,

I'm experiencing the same issue when upgrading from 3.8.0 to 3.9.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ingress-controller Issues where Kong is running as a Kubernetes Ingress Controller area/kubernetes Issues where Kong is running on top of Kubernetes
Projects
None yet
Development

No branches or pull requests

4 participants