Skip to content

[9.3] [Console] avoid HPE_HEADER_OVERFLOW in legacy templates Scout test (#268054)#268581

Merged
kapral18 merged 1 commit intoelastic:9.3from
kapral18:backport/9.3/pr-268054
May 11, 2026
Merged

[9.3] [Console] avoid HPE_HEADER_OVERFLOW in legacy templates Scout test (#268054)#268581
kapral18 merged 1 commit intoelastic:9.3from
kapral18:backport/9.3/pr-268054

Conversation

@kapral18
Copy link
Copy Markdown
Contributor

@kapral18 kapral18 commented May 9, 2026

Backport

This will backport the following commits from main to 9.3:

Questions ?

Please refer to the Backport tool documentation

…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)
@kapral18 kapral18 added the backport This PR is a backport of another PR label May 9, 2026
@kapral18 kapral18 requested a review from kibanamachine as a code owner May 9, 2026 21:25
@kapral18 kapral18 added the backport This PR is a backport of another PR label May 9, 2026
@kapral18 kapral18 enabled auto-merge (squash) May 9, 2026 21:25
@kapral18 kapral18 requested a review from Copilot May 9, 2026 21:29

This comment was marked as low quality.

@kibanamachine
Copy link
Copy Markdown
Contributor

kibanamachine commented May 9, 2026

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Scout Lane #6 - stateful-classic / default / local-stateful-classic - APM integration not installed but setup completed - Admin user
  • [job] [logs] Scout Lane #3 - stateful-classic / default / local-stateful-classic - Expandable flyout state sync - should test flyout url sync

Metrics [docs]

✅ unchanged

History

@kapral18 kapral18 merged commit e471b86 into elastic:9.3 May 11, 2026
41 of 48 checks passed
@kapral18 kapral18 deleted the backport/9.3/pr-268054 branch May 11, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants