[9.3] [Console] avoid HPE_HEADER_OVERFLOW in legacy templates Scout test (#268054)#268581
Merged
kapral18 merged 1 commit intoelastic:9.3from May 11, 2026
Merged
[9.3] [Console] avoid HPE_HEADER_OVERFLOW in legacy templates Scout test (#268054)#268581kapral18 merged 1 commit intoelastic:9.3from
kapral18 merged 1 commit intoelastic:9.3from
Conversation
…lastic#268054) Closes elastic#268028 ## Summary The Scout API test [`autocomplete_entities_stateful.spec.ts`](https://github.com/elastic/kibana/blob/2c4863f3d050e2c530389da1692f0ac720994398/src/platform/plugins/shared/console/test/scout/api/tests/autocomplete_entities_stateful.spec.ts) is failing in `beforeAll` with `ConnectionError: Parse Error: Header overflow` (`HPE_HEADER_OVERFLOW`). The setup calls `PUT _template` with `index_patterns: ['*']`; on a populated cluster ES emits a single `Warning:` deprecation header listing every overlapping composable template ([`MetadataIndexTemplateService.java#L1341-L1352`](https://github.com/elastic/elasticsearch/blob/f4096de27a8ad47955c15230d18db123dae7d013/server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateService.java#L1341-L1352)), and that single header alone exceeds Node's default 16 KB `maxHeaderSize`. Test-only failure — the [`/api/console/autocomplete_entities`](https://github.com/elastic/kibana/blob/2c4863f3d050e2c530389da1692f0ac720994398/src/platform/plugins/shared/console/server/routes/api/console/autocomplete_entities/index.ts#L56-L63) production route only does `GET _template`. ## Fix In the spec only, build a private ES `Client` for the legacy-template setup using `UndiciConnection` with `agent: { maxHeaderSize: 64 * 1024 }`. `UndiciConnection` is the only `@elastic/transport` connection that surfaces `maxHeaderSize`. The route assertion still runs through the shared `apiClient` fixture. `tsconfig.json` adds `@kbn/test-es-server` as a `kbn_reference` for `createEsClientForTesting`. ## Test plan - [x] `node scripts/type_check --project src/platform/plugins/shared/console/tsconfig.json` - [x] `node scripts/eslint --fix` on the spec - [x] `node scripts/check_changes.ts` - [x] Local Scout on stateful classic (`node scripts/scout.js run-tests --arch stateful --domain classic --testFiles …/autocomplete_entities_stateful.spec.ts`) — `1 passed (5.6s)`; ES emitted the same multi-KB `legacy template […] matching patterns from existing composable templates […]` warning (~120 entries) that overflows in CI - [ ] CI on this PR Made with [Cursor](https://cursor.com) Co-authored-by: Cursor <cursoragent@cursor.com> (cherry picked from commit ce77dfc)
5 tasks
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
History |
SoniaSanzV
approved these changes
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto9.3:Questions ?
Please refer to the Backport tool documentation