-
Notifications
You must be signed in to change notification settings - Fork 50
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
Impossible to access kong.Router.GetService() from Log phase. #118
Comments
I'm facing the exactly same problem when trying to access lots of methods from |
Passing by to comment that it is still the case. For instance it fails for
For some reason I tried to port a lua version to a Go version and everything that worked on the log phase about the request failed. The Response access seems to work as expected though. Quick investigations about this error message lead me here : https://github.com/Kong/kong/blob/master/build/openresty/patches/ngx_lua-0.10.26_01-dyn_upstream_keepalive.patch#L1031-L1034 so I guess it's because the lua context is not matching the Go context (or something like this) ? |
This is a known limitation; Kong communicates with the plugin server through a Unix domain socket. The socket API we use for that is not available in the context where we run the Go plugin log handler (it is actually in the context of a timer). I will tag this one as an enhancement request for now. Thank you for the discussion over here! |
@gszr it would be great to add a disclaimer in the docs for this to let people know of this limitation. Specially because it's not only the |
@edjanmichiles-toast Good call - we will work on that. |
Hey, I'm facing the same issue here using the latest go-pdk version (0.11.0). Is there any news on this topic? Also, no document update was made as far as I can tell, right? |
kong 2.8.0
go-pdk v0.7.1
For the moment only it is possible to get
kong.Router.GetService()
information from Access phase and not from the Log phase.Is a possible bug of kong, because the documentation explains that is possible to get this information from the Log phase:
https://docs.konghq.com/gateway/latest/pdk/kong.router/#kongrouterget_service
Any idea if this is a bug?
The text was updated successfully, but these errors were encountered: