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

bug: error in gPRC protocol as reverse proxy #10838

Open
Rustixir opened this issue Jan 17, 2024 · 4 comments
Open

bug: error in gPRC protocol as reverse proxy #10838

Rustixir opened this issue Jan 17, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Rustixir
Copy link

Rustixir commented Jan 17, 2024

Current Behavior

hi, I wanted use apisix, but after I created route and set gPRC protocol for communicate with upstream,
I test that route with postman, apisix raise error:

2024/01/17 12:30:03 [error] 50#50: *158580 upstream sent too large http2 frame: 4740180 while reading response header from upstream, client: 172.10.0.1, server: _, request: "POST /ping HTTP/1.0", upstream: "grpc://172.10.0.3:9081", host: "aaa.com"

after I searched about that , I found some article about is nginx problem and with increasing ( proxy_buffer_size ) be fix, but this solution isn't work for me.

in one article said about increase buffer size,
I add this into config file and mount to " /usr/local/apisix/conf/config.yaml "

my config was :

nginx_config:
  http_configuration_snippet: |
    proxy_buffer_size          512k;
    proxy_buffers              4 256k;
    proxy_busy_buffers_size    512k;
    http2_max_field_size       16k;
    http2_max_header_size      32k;

Steps to Reproduce

apisix docker image ~> apache/apisix:3.7.0-debian

this is my route config ( apisix-dashboard format ) :

{
  "uri": "/ping",
  "name": "/vouchers/otp",
  "methods": [
    "POST"
  ],
  "plugins": {
    "grpc-transcode": {
      "_meta": {
        "disable": true
      },
      "method": "/scms_api.VoucherService/Otp",
      "proto_id": "voucher",
      "service": "scms"
    }
  },
  "upstream": {
    "nodes": [
      {
        "host": "scms",
        "port": 9081,
        "weight": 1
      }
    ],
    "timeout": {
      "connect": 6,
      "send": 6,
      "read": 6
    },
    "type": "roundrobin",
    "scheme": "grpc",
    "pass_host": "pass",
    "keepalive_pool": {
      "idle_timeout": 60,
      "requests": 1000,
      "size": 320
    }
  },
  "status": 1
}
@Rustixir Rustixir changed the title bug: gPRC protocol error bug: error in gPRC protocol as reverse proxy Jan 17, 2024
@sheharyaar
Copy link
Contributor

@Rustixir , can you share the response or request that triggered this error.

@shreemaan-abhishek
Copy link
Contributor

what was the size of your response?

@shreemaan-abhishek shreemaan-abhishek added the bug Something isn't working label Jan 18, 2024
@Rustixir
Copy link
Author

Rustixir commented Jan 19, 2024

after done configuration, I implemented route and just wanted test my first endpoint
but this error is occured for all gPRC request .

the client request for "/ping" path with POST method
and body is { "mobile": "" }

And below is our proto model


service VoucherService {
      rpc Otp (VoucherOtpReq) returns (VoucherOtpRes);
}

message VoucherOtpReq{
  // @inject_tag: json:"mobile"
  string Mobile = 1;
}

message VoucherOtpRes{
  // @inject_tag: json:"life_time"
  int64 LifeTime = 1;
  // @inject_tag: json:"length"
  int32 Length = 2;
}

everything to be seems normal

@hanqingwu
Copy link
Contributor

hanqingwu commented Feb 1, 2024

@Rustixir
maybe this can help you ?

4740180 is ascii-encoded HTT so it appears it's getting stumbled on HTTP/1 reply when reading from upstream connection socket.

kubernetes/ingress-nginx#4095

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 📋 Backlog
Development

No branches or pull requests

4 participants