Upstream sent too big header while reading response header from upstream—despite not setting any additional HTTP response headers

I’ve deployed a PHP 8.1 application into Cloud Run functions (both 1st gen and 2nd gen) and recently I started receiving the following error message (it results in an unhandled/broken HTTP response)

2026/03/21 07:37:42 [error] 22#22: *101 upstream sent too big header while reading response header from upstream, client: 169.254.1.1, server: , request: "GET /awesome HTTP/1.1", upstream: "fastcgi://unix:/tmp/google-config/app.sock:", host: "asia-southeast1-project.cloudfunctions.net", referrer: "https://domain.tld/"

Here are a few facts:

  1. The error is a recent occurrence (the application has been running perfectly for around 2 years now and no code changes recently)
  2. I don’t set any oversized HTTP response headers in my application (output from headers_list() below)
  3. Usually what resolves it is just re-deploying the application multiple times

Output from headers_list()

Array
(
)

I know that the Google infrastructure that routes the HTTP requests into my application will set it’s own response headers, but it seems that I don’t have control over that process

How do I go about solving this or should I move one layer down the processing abstraction model and containerise the application and deploy into Cloud Run instead?

1 Like