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

Missing plugin socket #308

Closed
esatterwhite opened this issue May 18, 2023 · 2 comments · Fixed by Kong/kong#11372
Closed

Missing plugin socket #308

esatterwhite opened this issue May 18, 2023 · 2 comments · Fixed by Kong/kong#11372

Comments

@esatterwhite
Copy link
Contributor

I'm not sure if this is the right place, But recently after updating to kong 3.2.2, I started seeing ciritical errors at start up

2023/05/18 15:33:19 [notice] 1206#0: *148 [kong] process.lua:252 Starting js, context: ngx.timer
2023/05/18 15:33:19 [crit] 1206#0: *149 connect() to unix:/usr/local/kong/js_pluginserver.sock failed (2: No such file or directory), context: ngx.timer
2023/05/18 15:33:19 [crit] 1206#0: *149 connect() to unix:/usr/local/kong/js_pluginserver.sock failed (2: No such file or directory), context: ngx.timer
2023/05/18 15:33:19 [crit] 1206#0: *149 connect() to unix:/usr/local/kong/js_pluginserver.sock failed (2: No such file or directory), context: ngx.timer
2023/05/18 15:33:19 [crit] 1206#0: *149 connect() to unix:/usr/local/kong/js_pluginserver.sock failed (2: No such file or directory), context: ngx.timer
2023/05/18 15:33:19 [crit] 1206#0: *149 connect() to unix:/usr/local/kong/js_pluginserver.sock failed (2: No such file or directory), context: ngx.timer
2023/05/18 15:33:19 [crit] 1206#0: *149 connect() to unix:/usr/local/kong/js_pluginserver.sock failed (2: No such file or directory), context: ngx.timer
2023/05/18 15:33:19 [crit] 1206#0: *149 connect() to unix:/usr/local/kong/js_pluginserver.sock failed (2: No such file or directory), context: ngx.timer

2023/05/18 15:33:28 [warn] 1206#0: *160 [kong] plugins.lua:125 /plugins/schema/:name endpoint is deprecated, please use /schemas/plugins/:name instead (deprecated after 1.2.0, scheduled for removal in 3.0.0), client: 127.0.0.1, server: kong_admin, request: "GET /plugins/schema/prometheus HTTP/1.1", host: "127.0.0.1:8444"

Things seem to have a real hard time connecting to kong when this happens.

Here are the env vars used to set this up

KONG_PLUGINSERVER_JS_QUERY_CMD=node /usr/local/bin/kong-js-pluginserver --plugins-directory /opt/plugins/js --dump-all-plugins
KONG_PLUGINSERVER_JS_SOCKET=/usr/local/kong/js_pluginserver.sock
KONG_PLUGINSERVER_JS_START_CMD=node /usr/local/bin/kong-js-pluginserver --plugins-directory /opt/plugins/js
KONG_PLUGINSERVER_NAMES=js
@esatterwhite
Copy link
Contributor Author

I in fact had to patch the deployment in production to disable this plugin server because it looked like we were loosing connections

image

After I patched it and the error stop things normalized

@StarlightIbuki
Copy link
Contributor

Hi. Have you checked if the plugin functions normally? I believe this is an expected behavior.

We introduced a check to prevent requests before the plugin server is ready. Due to the implementation limit, we have to check by trying to connect to the socket, which generates error messages and we cannot mute it.

We're considering removing this check logic as it does not really help when a plugin server is slow.

Reference:
Kong/kong#9507
openresty/lua-nginx-module#2138

StarlightIbuki added a commit to Kong/kong that referenced this issue Aug 10, 2023
We used to check if the plugin server socket is ready by trying to connect, which will generate a lot of critical messages which cannot be suppressed due to OpenResty's limitation. As the logic is not really helpful, we decided to revert it.

Revert "fix(pluginserver): error if req come before ready (#9507)"

This reverts commit e7b6963.

Fix KAG-2136
Fix #11084
Fix Kong/kong-js-pdk#308
fffonion pushed a commit to Kong/kong that referenced this issue Aug 10, 2023
…1372

We used to check if the plugin server socket is ready by trying to connect, which will generate a lot of critical messages which cannot be suppressed due to OpenResty's limitation. As the logic is not really helpful, we decided to revert it.

Revert "fix(pluginserver): error if req come before ready (#9507)"

This reverts commit e7b6963.

Fix KAG-2136
Fix #11084
Fix Kong/kong-js-pdk#308
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants