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

Proxy Buffering Settings Cause Issues #13211

Open
1 task done
Hicham-Chahboune opened this issue Jun 15, 2024 · 1 comment
Open
1 task done

Proxy Buffering Settings Cause Issues #13211

Hicham-Chahboune opened this issue Jun 15, 2024 · 1 comment
Labels
pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc...

Comments

@Hicham-Chahboune
Copy link

Hicham-Chahboune commented Jun 15, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Kong version ($ kong version)

3.7.0

Current Behavior

When sending a very large request, Nginx (of kong) buffers it in a file. However, in a plugin, if I attempt to read the body from the request, it doesn't retrieve the body from that file and returns an error. The solution I found is to increase the Nginx buffer size, which works, but this is not ideal, especially when receiving multiple large requests, as is my case.

Current Configuration:
proxy_buffering on;
proxy_buffer_size 32k;
proxy_buffers 64 16k;
proxy_busy_buffers_size 256k;
proxy_max_temp_file_size 200m;
proxy_temp_file_write_size 1024k;

ERROR MESSAGE:

a client request body is buffered to a temporary file /usr/local/kong/client_body_temp/0000000001
/usr/local/share/lua/5.1/MessagePack.lua:126: attempt to get length of local 'str' (a nil value)

Expected Behavior

Expected Behavior:

The body should be retrievable from the file without needing to increase the buffer size of nginx.

Steps To Reproduce

Steps to Reproduce:

  • Send a very large request to kong.
  • Attempt to read the body from the request within a plugin.
  • Observe that the body is not retrieved from the file and an error is returned.

Anything else?

a client request body is buffered to a temporary file /usr/local/kong/client_body_temp/0000000001,
/usr/local/share/lua/5.1/MessagePack.lua:126: attempt to get length of local 'str'

@Hicham-Chahboune Hicham-Chahboune changed the title Proxy Buffering Settings Cause Issues Despite Adequate Configuration Proxy Buffering Settings Cause Issues Jun 15, 2024
@StarlightIbuki
Copy link
Contributor

This is by design and not a bug for PDK.
It looks like you are using JS or Python PDK; currently, we do not support reading from cached files. We have a WIP PR to support it: a76d657 (#13158)

@chobits chobits added the pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... label Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc...
Projects
None yet
Development

No branches or pull requests

3 participants