ERR_HTTP2_MAX_PENDING_SETTINGS_ACK
Node.jsERRORNotableHTTP/2

Too many unacknowledged HTTP/2 SETTINGS frames

Quick Answer

Do not send SETTINGS frames faster than the remote peer can acknowledge them; avoid sending SETTINGS in a tight loop.

Production Risk

Low in typical usage; appears in custom HTTP/2 client code that mismanages session configuration.

What this means

Thrown when the local HTTP/2 endpoint has sent more than the allowed maximum of unacknowledged SETTINGS frames (default 10). The remote peer must acknowledge each SETTINGS frame before another can be sent.

Why it happens
  1. 1Sending SETTINGS frames in a loop without waiting for the SETTINGS_ACK from the peer
  2. 2Remote peer is very slow to process SETTINGS frames (overloaded server)
  3. 3Bug in HTTP/2 session management code that re-sends SETTINGS unnecessarily

Fix

Wait for settings to be applied before sending more

WHEN When programmatically changing HTTP/2 session settings

Wait for settings to be applied before sending more
const http2 = require('http2');
const client = http2.connect('https://example.com');

// Listen for settings acknowledgement before sending more
client.on('localSettings', (settings) => {
  console.log('Settings acknowledged:', settings);
});

// Send settings only once, not in a loop
client.settings({ headerTableSize: 4096 });

Why this works

The 'localSettings' event fires after the remote peer sends SETTINGS_ACK, confirming the settings were received. Only send new SETTINGS after this event.

What not to do

Call client.settings() in a loop or on every request

SETTINGS frames must be acknowledged before new ones can be sent; rapid re-sending exhausts the pending-ACK budget and throws this error.

Sources
Official documentation ↗

Node.js Error Codes Documentation

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All Node.js errors