Nil entity returned when using dao select statement on Kong 3.3 Postgres #12348
Labels
core/db
pending author feedback
Waiting for the issue author to get back to a maintainer with findings, more details, etc...
Is there an existing issue for this?
Kong version (
$ kong version
)Kong 3.3
Current Behavior
After upgrading plugins from Kong 2.2.1 to Kong 3.3, under the following conditions:
where the callback function to retrieve the entity to be loaded into the cache is a dao select function
More often than not, after the initial start up and during the plugin execution, kong will hit the following error
[error] 1261#0: *4864420 [kong] init.lua:359 [partner-custom-oauth2] /opt/kong/plugins/partner-custom-oauth2/access.lua:1071: attempt to index local 'client' (a nil value)
indicating that the value in the cache/entity returned from the select statement is nil, even though a manual db query indicates that the entity exists but ws_id is null.
After a few kong restarts, it is noticed that the error goes away and when checking the oauth2_credentials table the ws_id is populated.
When turning on OpenTelemetry logs, it is noted that the dao select statement queries ws_id as well, and having ws_id as null could then be an issue
Anyone has had a similar issue or know the cause? What causes the ws_id to be null in the first place
Expected Behavior
No response
Steps To Reproduce
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: