NO_ERROR communication protocol_error ai_generated partial

HTTP/2 GOAWAY frame received: last stream ID 0, error code NO_ERROR

ID: communication/http2-goaway-frame-received

Also available as: JSON · Markdown · 中文
78%Fix Rate
84%Confidence
1Evidence
2024-05-12First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
nginx 1.25.0 active
Node.js 20.11.0 active
Envoy 1.28.0 active

Root Cause

The HTTP/2 server sent a GOAWAY frame to gracefully shut down the connection, often due to server maintenance, load balancing, or reaching max concurrent streams.

generic

中文

HTTP/2 服务器发送 GOAWAY 帧以优雅关闭连接,通常由于服务器维护、负载均衡或达到最大并发流限制。

Official Documentation

https://httpwg.org/specs/rfc7540.html#GOAWAY

Workarounds

  1. 85% success Implement client-side reconnection logic that opens a new HTTP/2 connection upon receiving GOAWAY: In Node.js with http2 module, listen for 'goaway' event and create a new session: `session.on('goaway', () => { session.close(); createNewSession(); })`.
    Implement client-side reconnection logic that opens a new HTTP/2 connection upon receiving GOAWAY: In Node.js with http2 module, listen for 'goaway' event and create a new session: `session.on('goaway', () => { session.close(); createNewSession(); })`.
  2. 80% success Set a grace period in the server's GOAWAY handling to allow in-flight requests to complete: In nginx, configure `http2_max_concurrent_streams 256;` and `keepalive_timeout 60s;` to reduce GOAWAY frequency.
    Set a grace period in the server's GOAWAY handling to allow in-flight requests to complete: In nginx, configure `http2_max_concurrent_streams 256;` and `keepalive_timeout 60s;` to reduce GOAWAY frequency.
  3. 75% success Use connection pooling with multiple HTTP/2 sessions to distribute load: In gRPC, configure `grpc.lb_policy_name` as 'round_robin' with multiple subchannels.
    Use connection pooling with multiple HTTP/2 sessions to distribute load: In gRPC, configure `grpc.lb_policy_name` as 'round_robin' with multiple subchannels.

中文步骤

  1. Implement client-side reconnection logic that opens a new HTTP/2 connection upon receiving GOAWAY: In Node.js with http2 module, listen for 'goaway' event and create a new session: `session.on('goaway', () => { session.close(); createNewSession(); })`.
  2. Set a grace period in the server's GOAWAY handling to allow in-flight requests to complete: In nginx, configure `http2_max_concurrent_streams 256;` and `keepalive_timeout 60s;` to reduce GOAWAY frequency.
  3. Use connection pooling with multiple HTTP/2 sessions to distribute load: In gRPC, configure `grpc.lb_policy_name` as 'round_robin' with multiple subchannels.

Dead Ends

Common approaches that don't work:

  1. Disable HTTP/2 entirely and fall back to HTTP/1.1 60% fail

    Disabling HTTP/2 loses performance benefits and doesn't fix the server-side issue; GOAWAY may still occur with HTTP/1.1 connection resets.

  2. Increase the client's max concurrent streams limit 85% fail

    The GOAWAY is server-initiated; client-side stream limits don't prevent the server from sending it.

  3. Ignore GOAWAY and continue sending requests on the same connection 90% fail

    GOAWAY signals imminent connection closure; continuing to send will result in stream errors or data loss.