Skip to content

[ResponseOps] Reports are timing out and failing with an invalid header error #225919

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

Merged
merged 5 commits into from
Jul 3, 2025

Conversation

doakalexi
Copy link
Contributor

@doakalexi doakalexi commented Jun 30, 2025

Resolves #225915 (comment)

Summary

Kibana is using HTTP/2 by default, and it's including pseudo-headers (headers prefixed by a colon :) in the reporting requests to ES. The psuedo-headers are causing reports to fail with this error, Failed to complete a request using headers: Protocol error (Fetch.continueRequest): Invalid header, when running Kibana locally with --ssl. This PR updates stripUnsafeHeaders() to remove psuedo-headers.

Checklist

To verify

  1. Run Kibana and ES with --ssl
  2. Generate a PDF report (with and without printing) and a PNG report and verify that the report is generated successfully.
  3. Repeat step 2 but run Kibana without --ssl

@doakalexi doakalexi changed the title Remove psuedo headers for reporting [ResponseOps] Reports are timing out and failing with an invalid header error Jun 30, 2025
@doakalexi doakalexi added release_note:fix Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v9.0.0 backport:version Backport to applied version labels v9.1.0 v9.2.0 labels Jun 30, 2025
@doakalexi doakalexi marked this pull request as ready for review July 1, 2025 00:00
@doakalexi doakalexi requested a review from a team as a code owner July 1, 2025 00:00
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@doakalexi doakalexi requested a review from pmuellr July 1, 2025 00:00
@pmuellr
Copy link
Member

pmuellr commented Jul 1, 2025

We will also need to backport to whatever open 8.x releases we have - I think doing 8.17 probably makes sense as well, unless it's a difficult merge conflict to fix (it may never ship another patch release, but ... I doubt it :-).

The ability to use http2 was added in 8.15.0, so it's possible for a customer using 8.x to run into this same problem, if they specifically set the config server.protocol: http2.

UNSAFE_HEADERS_PATTERNS.some((pattern) => pattern.test(header)))
UNSAFE_HEADERS_PATTERNS.some((pattern) => pattern.test(header)) ||
// remove psuedo-headers that are prefixed with a colon
header.startsWith(':'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can actually add /^:/ as an additional element of UNSAFE_HEADERS_PATTERNS and not make the changes here. At least for the new test case, it passes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in this commit, da037c3

@pmuellr
Copy link
Member

pmuellr commented Jul 2, 2025

This approach removes the pseudo-headers from the headers list, so that we don't violate the constraint that the pseudo-headers have to be IN the headers, and FIRST.

From the spec:

All pseudo-header fields MUST appear in a field block before all regular field lines. Any request or response that contains a pseudo-header field that appears in a field block after a regular field line MUST be treated as malformed (Section 8.1.1).

I'm a little worried that the pseudo-headers may end up being required, so an alternative approach would be to leave them, but make sure they're at the beginning of the list of headers. Build a sort function and use a .sort(sortFn) at end of the header array generation.

@JoshMock as our http expert, any thoughts?

@JoshMock
Copy link
Member

JoshMock commented Jul 2, 2025

What are the actual headers that this strips out? If they're needed headers, is there a way to transform them into HTTP/1.1 headers before sending them along?

@pmuellr
Copy link
Member

pmuellr commented Jul 2, 2025

The headers are actually "pseudo-headers". I'm very familiar with the HTTP 1.x specs, but had never heard of these "pseudo-headers" before. See in the HTTP/2 spec 8.3.1. Request Pseudo-Header Fields. When we debugged this, we saw all four listed there, :method, :scheme, :authority, :path.

My guess is that there are used for pipelining, so the data can be "all headers" and no "first line" like HTTP/1, or something.

We are intercepting these from the browser via puppeteer. We have puppeteer open the page that will be "printed", and it gives us a callback for each request sent to the server (main page, css, images, etc). The callback sent us those pseudo-headers, so presumably Chromium headless shell is adding them. This PR removes them in the callback, and things still work, so maybe that's ok? Maybe puppeteer is fixing these up again when we return from the callback? Not sure.

@JoshMock
Copy link
Member

JoshMock commented Jul 2, 2025

Yeah, :method would map to the HTTP method, :path to the HTTP path, etc. If these are passthrough requests that are intended to run as-is on Elasticsearch, you would transform this:

:method GET
:path /foo/bar
:scheme https
:authority my.es.io

to:

GET /foo/bar HTTP/1.1
Host: my.es.io
X-Forwarded-Proto: https

I was suggesting doing that translation rather than dropping the headers entirely, as they may be necessary to properly forward those requests to ES.

@pmuellr
Copy link
Member

pmuellr commented Jul 3, 2025

If these are passthrough requests that are intended to run as-is on Elasticsearch, you would transform this

This is a bit confusing, but my understanding of what's happening is that:

  • we make a puppeteer request to load a page
  • puppeteer has Chrome makes an http request for each resource
  • on those requests, we get some kind of callback that allows us to modify headers (not exactly sure what we are changing in the headers - we just picked up reporting as a new area this year :-) )
  • we return the headers we REALLY want Chrome to use when it actually makes the request

So, we're not actually invoking an http client, just intercepting a live request. This happens for all sub-requests as well (images, etc).

I'm not sure we can even do these kind of transforms (of the URL itself, for instance). But I don't think we'd want to.

The question was more of - is it super-important to be sending these to the server anyway? Not sending them, as this PR does, allows reporting to work over http2, which it won't WITHOUT this PR. But I'm thinking long-term we probably DO want to send them. We tried following the rules, putting those "headers" first, and that didn't seem to work. So maybe there's something different we need to do with puppeteer or something.

Current plan is to strip them (merge this PR), since this seems to work for the cases we've tried, for 8.19 and 9.1 (still a few build candidates left before those releases at the end of this month). Better to have something work in at least some cases than fail 100% of the time (for on-prem).

We'll open a separate issue to investigate more to see if we need to do something else for future releases.

Copy link
Member

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #87 / ObservabilityApp Observability alerts > Alerts table Filtering Autocompletion works

Metrics [docs]

✅ unchanged

History

Copy link
Member

@tsullivan tsullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, code review only

@doakalexi doakalexi merged commit 3dec3e2 into elastic:main Jul 3, 2025
10 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.17, 8.18, 8.19, 9.0, 9.1

https://github.com/elastic/kibana/actions/runs/16060406484

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 3, 2025
…er error (elastic#225919)

Resolves
elastic#225915 (comment)

## Summary

Kibana is using HTTP/2 by default, and it's including pseudo-headers
(headers prefixed by a colon :) in the reporting requests to ES. The
psuedo-headers are causing reports to fail with this error, `Failed to
complete a request using headers: Protocol error
(Fetch.continueRequest): Invalid header`, when running Kibana locally
with --ssl. This PR updates `stripUnsafeHeaders()` to remove
psuedo-headers.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### To verify
1. Run Kibana and ES with `--ssl`
2. Generate a PDF report (with and without printing) and a PNG report
and verify that the report is generated successfully.
3. Repeat step 2 but run Kibana without `--ssl`

(cherry picked from commit 3dec3e2)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 3, 2025
…er error (elastic#225919)

Resolves
elastic#225915 (comment)

## Summary

Kibana is using HTTP/2 by default, and it's including pseudo-headers
(headers prefixed by a colon :) in the reporting requests to ES. The
psuedo-headers are causing reports to fail with this error, `Failed to
complete a request using headers: Protocol error
(Fetch.continueRequest): Invalid header`, when running Kibana locally
with --ssl. This PR updates `stripUnsafeHeaders()` to remove
psuedo-headers.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### To verify
1. Run Kibana and ES with `--ssl`
2. Generate a PDF report (with and without printing) and a PNG report
and verify that the report is generated successfully.
3. Repeat step 2 but run Kibana without `--ssl`

(cherry picked from commit 3dec3e2)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 3, 2025
…er error (elastic#225919)

Resolves
elastic#225915 (comment)

## Summary

Kibana is using HTTP/2 by default, and it's including pseudo-headers
(headers prefixed by a colon :) in the reporting requests to ES. The
psuedo-headers are causing reports to fail with this error, `Failed to
complete a request using headers: Protocol error
(Fetch.continueRequest): Invalid header`, when running Kibana locally
with --ssl. This PR updates `stripUnsafeHeaders()` to remove
psuedo-headers.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### To verify
1. Run Kibana and ES with `--ssl`
2. Generate a PDF report (with and without printing) and a PNG report
and verify that the report is generated successfully.
3. Repeat step 2 but run Kibana without `--ssl`

(cherry picked from commit 3dec3e2)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 3, 2025
…er error (elastic#225919)

Resolves
elastic#225915 (comment)

## Summary

Kibana is using HTTP/2 by default, and it's including pseudo-headers
(headers prefixed by a colon :) in the reporting requests to ES. The
psuedo-headers are causing reports to fail with this error, `Failed to
complete a request using headers: Protocol error
(Fetch.continueRequest): Invalid header`, when running Kibana locally
with --ssl. This PR updates `stripUnsafeHeaders()` to remove
psuedo-headers.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### To verify
1. Run Kibana and ES with `--ssl`
2. Generate a PDF report (with and without printing) and a PNG report
and verify that the report is generated successfully.
3. Repeat step 2 but run Kibana without `--ssl`

(cherry picked from commit 3dec3e2)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 3, 2025
…er error (elastic#225919)

Resolves
elastic#225915 (comment)

## Summary

Kibana is using HTTP/2 by default, and it's including pseudo-headers
(headers prefixed by a colon :) in the reporting requests to ES. The
psuedo-headers are causing reports to fail with this error, `Failed to
complete a request using headers: Protocol error
(Fetch.continueRequest): Invalid header`, when running Kibana locally
with --ssl. This PR updates `stripUnsafeHeaders()` to remove
psuedo-headers.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### To verify
1. Run Kibana and ES with `--ssl`
2. Generate a PDF report (with and without printing) and a PNG report
and verify that the report is generated successfully.
3. Repeat step 2 but run Kibana without `--ssl`

(cherry picked from commit 3dec3e2)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.17
8.18
8.19
9.0
9.1

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jul 3, 2025
…d header error (#225919) (#226499)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[ResponseOps] Reports are timing out and failing with an invalid
header error (#225919)](#225919)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Alexi
Doak","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-07-03T20:57:32Z","message":"[ResponseOps]
Reports are timing out and failing with an invalid header error
(#225919)\n\nResolves\nhttps://github.com//issues/225915#issuecomment-3020436237\n\n##
Summary\n\nKibana is using HTTP/2 by default, and it's including
pseudo-headers\n(headers prefixed by a colon :) in the reporting
requests to ES. The\npsuedo-headers are causing reports to fail with
this error, `Failed to\ncomplete a request using headers: Protocol
error\n(Fetch.continueRequest): Invalid header`, when running Kibana
locally\nwith --ssl. This PR updates `stripUnsafeHeaders()` to
remove\npsuedo-headers.\n\n\n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n### To verify\n1.
Run Kibana and ES with `--ssl`\n2. Generate a PDF report (with and
without printing) and a PNG report\nand verify that the report is
generated successfully.\n3. Repeat step 2 but run Kibana without
`--ssl`","sha":"3dec3e2f5fbacac0a3e5a4edbe16721f2572b5cd","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:ResponseOps","v9.0.0","backport:version","v9.1.0","v8.19.0","v9.2.0","v8.18.4","v8.17.9"],"title":"[ResponseOps]
Reports are timing out and failing with an invalid header
error","number":225919,"url":"https://github.com/elastic/kibana/pull/225919","mergeCommit":{"message":"[ResponseOps]
Reports are timing out and failing with an invalid header error
(#225919)\n\nResolves\nhttps://github.com//issues/225915#issuecomment-3020436237\n\n##
Summary\n\nKibana is using HTTP/2 by default, and it's including
pseudo-headers\n(headers prefixed by a colon :) in the reporting
requests to ES. The\npsuedo-headers are causing reports to fail with
this error, `Failed to\ncomplete a request using headers: Protocol
error\n(Fetch.continueRequest): Invalid header`, when running Kibana
locally\nwith --ssl. This PR updates `stripUnsafeHeaders()` to
remove\npsuedo-headers.\n\n\n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n### To verify\n1.
Run Kibana and ES with `--ssl`\n2. Generate a PDF report (with and
without printing) and a PNG report\nand verify that the report is
generated successfully.\n3. Repeat step 2 but run Kibana without
`--ssl`","sha":"3dec3e2f5fbacac0a3e5a4edbe16721f2572b5cd"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","9.1","8.19","8.18","8.17"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/225919","number":225919,"mergeCommit":{"message":"[ResponseOps]
Reports are timing out and failing with an invalid header error
(#225919)\n\nResolves\nhttps://github.com//issues/225915#issuecomment-3020436237\n\n##
Summary\n\nKibana is using HTTP/2 by default, and it's including
pseudo-headers\n(headers prefixed by a colon :) in the reporting
requests to ES. The\npsuedo-headers are causing reports to fail with
this error, `Failed to\ncomplete a request using headers: Protocol
error\n(Fetch.continueRequest): Invalid header`, when running Kibana
locally\nwith --ssl. This PR updates `stripUnsafeHeaders()` to
remove\npsuedo-headers.\n\n\n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n### To verify\n1.
Run Kibana and ES with `--ssl`\n2. Generate a PDF report (with and
without printing) and a PNG report\nand verify that the report is
generated successfully.\n3. Repeat step 2 but run Kibana without
`--ssl`","sha":"3dec3e2f5fbacac0a3e5a4edbe16721f2572b5cd"}},{"branch":"8.18","label":"v8.18.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.9","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Alexi Doak <[email protected]>
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.17, 8.18, 8.19, 9.0, 9.1

https://github.com/elastic/kibana/actions/runs/16061880159

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 3, 2025
…er error (elastic#225919)

Resolves
elastic#225915 (comment)

## Summary

Kibana is using HTTP/2 by default, and it's including pseudo-headers
(headers prefixed by a colon :) in the reporting requests to ES. The
psuedo-headers are causing reports to fail with this error, `Failed to
complete a request using headers: Protocol error
(Fetch.continueRequest): Invalid header`, when running Kibana locally
with --ssl. This PR updates `stripUnsafeHeaders()` to remove
psuedo-headers.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### To verify
1. Run Kibana and ES with `--ssl`
2. Generate a PDF report (with and without printing) and a PNG report
and verify that the report is generated successfully.
3. Repeat step 2 but run Kibana without `--ssl`

(cherry picked from commit 3dec3e2)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 3, 2025
…er error (elastic#225919)

Resolves
elastic#225915 (comment)

## Summary

Kibana is using HTTP/2 by default, and it's including pseudo-headers
(headers prefixed by a colon :) in the reporting requests to ES. The
psuedo-headers are causing reports to fail with this error, `Failed to
complete a request using headers: Protocol error
(Fetch.continueRequest): Invalid header`, when running Kibana locally
with --ssl. This PR updates `stripUnsafeHeaders()` to remove
psuedo-headers.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### To verify
1. Run Kibana and ES with `--ssl`
2. Generate a PDF report (with and without printing) and a PNG report
and verify that the report is generated successfully.
3. Repeat step 2 but run Kibana without `--ssl`

(cherry picked from commit 3dec3e2)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 3, 2025
…er error (elastic#225919)

Resolves
elastic#225915 (comment)

## Summary

Kibana is using HTTP/2 by default, and it's including pseudo-headers
(headers prefixed by a colon :) in the reporting requests to ES. The
psuedo-headers are causing reports to fail with this error, `Failed to
complete a request using headers: Protocol error
(Fetch.continueRequest): Invalid header`, when running Kibana locally
with --ssl. This PR updates `stripUnsafeHeaders()` to remove
psuedo-headers.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### To verify
1. Run Kibana and ES with `--ssl`
2. Generate a PDF report (with and without printing) and a PNG report
and verify that the report is generated successfully.
3. Repeat step 2 but run Kibana without `--ssl`

(cherry picked from commit 3dec3e2)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 3, 2025
…er error (elastic#225919)

Resolves
elastic#225915 (comment)

## Summary

Kibana is using HTTP/2 by default, and it's including pseudo-headers
(headers prefixed by a colon :) in the reporting requests to ES. The
psuedo-headers are causing reports to fail with this error, `Failed to
complete a request using headers: Protocol error
(Fetch.continueRequest): Invalid header`, when running Kibana locally
with --ssl. This PR updates `stripUnsafeHeaders()` to remove
psuedo-headers.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### To verify
1. Run Kibana and ES with `--ssl`
2. Generate a PDF report (with and without printing) and a PNG report
and verify that the report is generated successfully.
3. Repeat step 2 but run Kibana without `--ssl`

(cherry picked from commit 3dec3e2)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.17
8.18
8.19
9.0 Cherrypick failed because the selected commit (3dec3e2) is empty. It looks like the commit was already backported in #226499
9.1

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 225919

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jul 4, 2025
…d header error (#225919) (#226500)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[ResponseOps] Reports are timing out and failing with an invalid
header error (#225919)](#225919)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Alexi
Doak","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-07-03T20:57:32Z","message":"[ResponseOps]
Reports are timing out and failing with an invalid header error
(#225919)\n\nResolves\nhttps://github.com//issues/225915#issuecomment-3020436237\n\n##
Summary\n\nKibana is using HTTP/2 by default, and it's including
pseudo-headers\n(headers prefixed by a colon :) in the reporting
requests to ES. The\npsuedo-headers are causing reports to fail with
this error, `Failed to\ncomplete a request using headers: Protocol
error\n(Fetch.continueRequest): Invalid header`, when running Kibana
locally\nwith --ssl. This PR updates `stripUnsafeHeaders()` to
remove\npsuedo-headers.\n\n\n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n### To verify\n1.
Run Kibana and ES with `--ssl`\n2. Generate a PDF report (with and
without printing) and a PNG report\nand verify that the report is
generated successfully.\n3. Repeat step 2 but run Kibana without
`--ssl`","sha":"3dec3e2f5fbacac0a3e5a4edbe16721f2572b5cd","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:ResponseOps","v9.0.0","backport:version","v9.1.0","v8.19.0","v9.2.0","v8.18.4","v8.17.9"],"title":"[ResponseOps]
Reports are timing out and failing with an invalid header
error","number":225919,"url":"https://github.com/elastic/kibana/pull/225919","mergeCommit":{"message":"[ResponseOps]
Reports are timing out and failing with an invalid header error
(#225919)\n\nResolves\nhttps://github.com//issues/225915#issuecomment-3020436237\n\n##
Summary\n\nKibana is using HTTP/2 by default, and it's including
pseudo-headers\n(headers prefixed by a colon :) in the reporting
requests to ES. The\npsuedo-headers are causing reports to fail with
this error, `Failed to\ncomplete a request using headers: Protocol
error\n(Fetch.continueRequest): Invalid header`, when running Kibana
locally\nwith --ssl. This PR updates `stripUnsafeHeaders()` to
remove\npsuedo-headers.\n\n\n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n### To verify\n1.
Run Kibana and ES with `--ssl`\n2. Generate a PDF report (with and
without printing) and a PNG report\nand verify that the report is
generated successfully.\n3. Repeat step 2 but run Kibana without
`--ssl`","sha":"3dec3e2f5fbacac0a3e5a4edbe16721f2572b5cd"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","9.1","8.19","8.18","8.17"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/225919","number":225919,"mergeCommit":{"message":"[ResponseOps]
Reports are timing out and failing with an invalid header error
(#225919)\n\nResolves\nhttps://github.com//issues/225915#issuecomment-3020436237\n\n##
Summary\n\nKibana is using HTTP/2 by default, and it's including
pseudo-headers\n(headers prefixed by a colon :) in the reporting
requests to ES. The\npsuedo-headers are causing reports to fail with
this error, `Failed to\ncomplete a request using headers: Protocol
error\n(Fetch.continueRequest): Invalid header`, when running Kibana
locally\nwith --ssl. This PR updates `stripUnsafeHeaders()` to
remove\npsuedo-headers.\n\n\n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n### To verify\n1.
Run Kibana and ES with `--ssl`\n2. Generate a PDF report (with and
without printing) and a PNG report\nand verify that the report is
generated successfully.\n3. Repeat step 2 but run Kibana without
`--ssl`","sha":"3dec3e2f5fbacac0a3e5a4edbe16721f2572b5cd"}},{"branch":"8.18","label":"v8.18.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.9","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Alexi Doak <[email protected]>
kibanamachine added a commit that referenced this pull request Jul 4, 2025
…id header error (#225919) (#226498)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[ResponseOps] Reports are timing out and failing with an invalid
header error (#225919)](#225919)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Alexi
Doak","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-07-03T20:57:32Z","message":"[ResponseOps]
Reports are timing out and failing with an invalid header error
(#225919)\n\nResolves\nhttps://github.com//issues/225915#issuecomment-3020436237\n\n##
Summary\n\nKibana is using HTTP/2 by default, and it's including
pseudo-headers\n(headers prefixed by a colon :) in the reporting
requests to ES. The\npsuedo-headers are causing reports to fail with
this error, `Failed to\ncomplete a request using headers: Protocol
error\n(Fetch.continueRequest): Invalid header`, when running Kibana
locally\nwith --ssl. This PR updates `stripUnsafeHeaders()` to
remove\npsuedo-headers.\n\n\n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n### To verify\n1.
Run Kibana and ES with `--ssl`\n2. Generate a PDF report (with and
without printing) and a PNG report\nand verify that the report is
generated successfully.\n3. Repeat step 2 but run Kibana without
`--ssl`","sha":"3dec3e2f5fbacac0a3e5a4edbe16721f2572b5cd","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:ResponseOps","v9.0.0","backport:version","v9.1.0","v8.19.0","v9.2.0","v8.18.4","v8.17.9"],"title":"[ResponseOps]
Reports are timing out and failing with an invalid header
error","number":225919,"url":"https://github.com/elastic/kibana/pull/225919","mergeCommit":{"message":"[ResponseOps]
Reports are timing out and failing with an invalid header error
(#225919)\n\nResolves\nhttps://github.com//issues/225915#issuecomment-3020436237\n\n##
Summary\n\nKibana is using HTTP/2 by default, and it's including
pseudo-headers\n(headers prefixed by a colon :) in the reporting
requests to ES. The\npsuedo-headers are causing reports to fail with
this error, `Failed to\ncomplete a request using headers: Protocol
error\n(Fetch.continueRequest): Invalid header`, when running Kibana
locally\nwith --ssl. This PR updates `stripUnsafeHeaders()` to
remove\npsuedo-headers.\n\n\n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n### To verify\n1.
Run Kibana and ES with `--ssl`\n2. Generate a PDF report (with and
without printing) and a PNG report\nand verify that the report is
generated successfully.\n3. Repeat step 2 but run Kibana without
`--ssl`","sha":"3dec3e2f5fbacac0a3e5a4edbe16721f2572b5cd"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","9.1","8.19","8.18","8.17"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/225919","number":225919,"mergeCommit":{"message":"[ResponseOps]
Reports are timing out and failing with an invalid header error
(#225919)\n\nResolves\nhttps://github.com//issues/225915#issuecomment-3020436237\n\n##
Summary\n\nKibana is using HTTP/2 by default, and it's including
pseudo-headers\n(headers prefixed by a colon :) in the reporting
requests to ES. The\npsuedo-headers are causing reports to fail with
this error, `Failed to\ncomplete a request using headers: Protocol
error\n(Fetch.continueRequest): Invalid header`, when running Kibana
locally\nwith --ssl. This PR updates `stripUnsafeHeaders()` to
remove\npsuedo-headers.\n\n\n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n### To verify\n1.
Run Kibana and ES with `--ssl`\n2. Generate a PDF report (with and
without printing) and a PNG report\nand verify that the report is
generated successfully.\n3. Repeat step 2 but run Kibana without
`--ssl`","sha":"3dec3e2f5fbacac0a3e5a4edbe16721f2572b5cd"}},{"branch":"8.18","label":"v8.18.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.9","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Alexi Doak <[email protected]>
kibanamachine added a commit that referenced this pull request Jul 4, 2025
…id header error (#225919) (#226496)

# Backport

This will backport the following commits from `main` to `8.17`:
- [[ResponseOps] Reports are timing out and failing with an invalid
header error (#225919)](#225919)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Alexi
Doak","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-07-03T20:57:32Z","message":"[ResponseOps]
Reports are timing out and failing with an invalid header error
(#225919)\n\nResolves\nhttps://github.com//issues/225915#issuecomment-3020436237\n\n##
Summary\n\nKibana is using HTTP/2 by default, and it's including
pseudo-headers\n(headers prefixed by a colon :) in the reporting
requests to ES. The\npsuedo-headers are causing reports to fail with
this error, `Failed to\ncomplete a request using headers: Protocol
error\n(Fetch.continueRequest): Invalid header`, when running Kibana
locally\nwith --ssl. This PR updates `stripUnsafeHeaders()` to
remove\npsuedo-headers.\n\n\n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n### To verify\n1.
Run Kibana and ES with `--ssl`\n2. Generate a PDF report (with and
without printing) and a PNG report\nand verify that the report is
generated successfully.\n3. Repeat step 2 but run Kibana without
`--ssl`","sha":"3dec3e2f5fbacac0a3e5a4edbe16721f2572b5cd","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:ResponseOps","v9.0.0","backport:version","v9.1.0","v8.19.0","v9.2.0","v8.18.4","v8.17.9"],"title":"[ResponseOps]
Reports are timing out and failing with an invalid header
error","number":225919,"url":"https://github.com/elastic/kibana/pull/225919","mergeCommit":{"message":"[ResponseOps]
Reports are timing out and failing with an invalid header error
(#225919)\n\nResolves\nhttps://github.com//issues/225915#issuecomment-3020436237\n\n##
Summary\n\nKibana is using HTTP/2 by default, and it's including
pseudo-headers\n(headers prefixed by a colon :) in the reporting
requests to ES. The\npsuedo-headers are causing reports to fail with
this error, `Failed to\ncomplete a request using headers: Protocol
error\n(Fetch.continueRequest): Invalid header`, when running Kibana
locally\nwith --ssl. This PR updates `stripUnsafeHeaders()` to
remove\npsuedo-headers.\n\n\n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n### To verify\n1.
Run Kibana and ES with `--ssl`\n2. Generate a PDF report (with and
without printing) and a PNG report\nand verify that the report is
generated successfully.\n3. Repeat step 2 but run Kibana without
`--ssl`","sha":"3dec3e2f5fbacac0a3e5a4edbe16721f2572b5cd"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","9.1","8.19","8.18","8.17"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/225919","number":225919,"mergeCommit":{"message":"[ResponseOps]
Reports are timing out and failing with an invalid header error
(#225919)\n\nResolves\nhttps://github.com//issues/225915#issuecomment-3020436237\n\n##
Summary\n\nKibana is using HTTP/2 by default, and it's including
pseudo-headers\n(headers prefixed by a colon :) in the reporting
requests to ES. The\npsuedo-headers are causing reports to fail with
this error, `Failed to\ncomplete a request using headers: Protocol
error\n(Fetch.continueRequest): Invalid header`, when running Kibana
locally\nwith --ssl. This PR updates `stripUnsafeHeaders()` to
remove\npsuedo-headers.\n\n\n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n### To verify\n1.
Run Kibana and ES with `--ssl`\n2. Generate a PDF report (with and
without printing) and a PNG report\nand verify that the report is
generated successfully.\n3. Repeat step 2 but run Kibana without
`--ssl`","sha":"3dec3e2f5fbacac0a3e5a4edbe16721f2572b5cd"}},{"branch":"8.18","label":"v8.18.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.9","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Alexi Doak <[email protected]>
kibanamachine added a commit that referenced this pull request Jul 4, 2025
…id header error (#225919) (#226497)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[ResponseOps] Reports are timing out and failing with an invalid
header error (#225919)](#225919)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Alexi
Doak","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-07-03T20:57:32Z","message":"[ResponseOps]
Reports are timing out and failing with an invalid header error
(#225919)\n\nResolves\nhttps://github.com//issues/225915#issuecomment-3020436237\n\n##
Summary\n\nKibana is using HTTP/2 by default, and it's including
pseudo-headers\n(headers prefixed by a colon :) in the reporting
requests to ES. The\npsuedo-headers are causing reports to fail with
this error, `Failed to\ncomplete a request using headers: Protocol
error\n(Fetch.continueRequest): Invalid header`, when running Kibana
locally\nwith --ssl. This PR updates `stripUnsafeHeaders()` to
remove\npsuedo-headers.\n\n\n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n### To verify\n1.
Run Kibana and ES with `--ssl`\n2. Generate a PDF report (with and
without printing) and a PNG report\nand verify that the report is
generated successfully.\n3. Repeat step 2 but run Kibana without
`--ssl`","sha":"3dec3e2f5fbacac0a3e5a4edbe16721f2572b5cd","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:ResponseOps","v9.0.0","backport:version","v9.1.0","v8.19.0","v9.2.0","v8.18.4","v8.17.9"],"title":"[ResponseOps]
Reports are timing out and failing with an invalid header
error","number":225919,"url":"https://github.com/elastic/kibana/pull/225919","mergeCommit":{"message":"[ResponseOps]
Reports are timing out and failing with an invalid header error
(#225919)\n\nResolves\nhttps://github.com//issues/225915#issuecomment-3020436237\n\n##
Summary\n\nKibana is using HTTP/2 by default, and it's including
pseudo-headers\n(headers prefixed by a colon :) in the reporting
requests to ES. The\npsuedo-headers are causing reports to fail with
this error, `Failed to\ncomplete a request using headers: Protocol
error\n(Fetch.continueRequest): Invalid header`, when running Kibana
locally\nwith --ssl. This PR updates `stripUnsafeHeaders()` to
remove\npsuedo-headers.\n\n\n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n### To verify\n1.
Run Kibana and ES with `--ssl`\n2. Generate a PDF report (with and
without printing) and a PNG report\nand verify that the report is
generated successfully.\n3. Repeat step 2 but run Kibana without
`--ssl`","sha":"3dec3e2f5fbacac0a3e5a4edbe16721f2572b5cd"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","9.1","8.19","8.18","8.17"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/225919","number":225919,"mergeCommit":{"message":"[ResponseOps]
Reports are timing out and failing with an invalid header error
(#225919)\n\nResolves\nhttps://github.com//issues/225915#issuecomment-3020436237\n\n##
Summary\n\nKibana is using HTTP/2 by default, and it's including
pseudo-headers\n(headers prefixed by a colon :) in the reporting
requests to ES. The\npsuedo-headers are causing reports to fail with
this error, `Failed to\ncomplete a request using headers: Protocol
error\n(Fetch.continueRequest): Invalid header`, when running Kibana
locally\nwith --ssl. This PR updates `stripUnsafeHeaders()` to
remove\npsuedo-headers.\n\n\n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n### To verify\n1.
Run Kibana and ES with `--ssl`\n2. Generate a PDF report (with and
without printing) and a PNG report\nand verify that the report is
generated successfully.\n3. Repeat step 2 but run Kibana without
`--ssl`","sha":"3dec3e2f5fbacac0a3e5a4edbe16721f2572b5cd"}},{"branch":"8.18","label":"v8.18.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.9","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Alexi Doak <[email protected]>
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
…er error (elastic#225919)

Resolves
elastic#225915 (comment)

## Summary

Kibana is using HTTP/2 by default, and it's including pseudo-headers
(headers prefixed by a colon :) in the reporting requests to ES. The
psuedo-headers are causing reports to fail with this error, `Failed to
complete a request using headers: Protocol error
(Fetch.continueRequest): Invalid header`, when running Kibana locally
with --ssl. This PR updates `stripUnsafeHeaders()` to remove
psuedo-headers.



### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### To verify
1. Run Kibana and ES with `--ssl`
2. Generate a PDF report (with and without printing) and a PNG report
and verify that the report is generated successfully.
3. Repeat step 2 but run Kibana without `--ssl`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels release_note:fix Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.17.9 v8.18.4 v8.19.0 v9.0.0 v9.0.4 v9.1.0 v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ResponseOps] Reports are timing out and failing with an invalid header error
6 participants