Repository navigation
functions: deploy exits 0 with endpoints left un-updated after 429 quota errors, and prints no error summary #11040
Description
[REQUIRED] Environment info
firebase-tools: 15.22.2
Platform: Linux (ubuntu-latest GitHub Actions runner), Node 24.16.0
[REQUIRED] Test case
A 2nd-gen functions codebase with ~81 endpoints, all in one region (europe-west3), deployed with:
firebase deploy --only functions --project <project> --force
The codebase is a single bundle, so every endpoint's sourceHash changes on any source change and all ~81 are updated on every deploy. That exceeds cloudfunctions.googleapis.com/v2_write_requests_regional, which is 60 mutations/min/region and is documented as not increasable, so the deploy reliably takes HTTP 429s and leans on the executor's retries.
I have not reduced this to a minimal repro — it is a race that shows up under sustained 429 pressure. Roughly: deploy enough endpoints in one region that the mutation quota is exceeded for several minutes.
[REQUIRED] Steps to reproduce
- Deploy ~80+ 2nd-gen functions to a single region in one
firebase deploy --only functions. - Let the Cloud Functions API return
429 Quota exceeded for quota metric 'Per project mutation requests' and limit 'Per project mutation requests per minute per region'for some of them. - Observe the exit code and compare the deployed revisions against the source.
[REQUIRED] Expected behavior
Either every endpoint deploys, or the command fails. src/deploy/functions/release/index.ts looks like it intends the latter — after Fabricator::applyPlan it calls reporter.printErrors(summary) and then:
const allErrors = summary.results.filter((r) => r.error).map((r) => r.error) as Error[];
if (allErrors.length) {
...
throw new FirebaseError("There was an error deploying functions", { ...opts, exit: 2 });
}[REQUIRED] Actual behavior
The command exited 0 with two endpoints never updated, and printed no error summary.
From the run's log:
- 81 endpoints logged
functions: updating Node.js 24 (2nd Gen) function <name>(europe-west3)... - 79 logged
functions[<name>(europe-west3)] Successful update operation. - One logged the 429 and then
⚠ functions: failed to update function projects/<project>/locations/europe-west3/functions/<name>, and nothing further - One logged only
updating ...and then nothing at all — no success, no error
And critically, none of these appeared:
Functions deploy had errors with the following functions:(reporter.printErrors)Deploy complete!- any artifact-cleanup output —
setupArtifactCleanupPoliciesis the statement right afterprintTriggerUrls, so execution seems not to have reached it either
The last line of the step was the final endpoint's success message, ~30 ms before the CI step ended. Exit code 0.
Verified against the Cloud Functions v2 API afterwards: both endpoints were still on their previous revision, and stayed there for three days across two further "successful" deploys of the same shape (the same bundle hash means they were retried and dropped the same way each time). Every other endpoint showed an updateTime inside the deploy window.
So it looks like the process can leave applyPlan — or exit outright — without summary.results carrying the failed operations, so the allErrors check finds nothing to throw and the CLI reports success. I have not been able to pin down the mechanism from the outside; wrapOperation does record op.error for non-retryable codes, so my guess is something in the throttler's retry-exhaustion path, but that is speculation.
Impact
This is a silent partial deploy. CI reports green, and production keeps serving old code for the affected functions with nothing anywhere to indicate it. A non-zero exit — or even just the existing error summary — would have surfaced it immediately.
Happy to supply more of the raw log or test a patch.
Activity
IzaakGough commentedon Sep 7, 2026
Hi @gustavfrid, thanks for raising this. We will review as soon as possible.
fix(throttler): keep scheduling queued tasks after a task fails
IzaakGough commentedon Sep 11, 2026
Hi @gustavfrid, thanks for the detailed write-up, the log breakdown is really helpful.
Sustained 429s on a deploy this size are expected given the per-region mutation quota, but exiting 0 with endpoints left on their old revision and no error summary is not. That's the part we should fix: a deploy that doesn't fully apply needs to fail loudly. I'll dig into this further and post updates here.
fix(throttler): keep scheduling queued tasks after a task fails
fix(throttler): keep scheduling queued tasks after a task fails
IzaakGough commentedon Sep 25, 2026
Thanks for your patience on this.
It looks like part of what you hit is already fixed. In 15.22.2,
SourceTokenScraper.abort()leftfetchStateatFETCHING, so the next caller to retry after a 429 waited forever on a token nobody would resolve. One hung operation stalls thePromise.allinapplyUpserts, soapplyPlannever returns,printErrorsand theallErrorsthrow never run, and Node exits 0 once the event loop drains. That went out in #11044, first released in 15.30.0, so upgrading to 15.31.0 should give you the error summary and a non-zero exit instead of a silent pass.There is a separate bug with the same signature still open. When a task exhausts its retries, the throttler does not hand its concurrency slot on to the next queued task, so a deploy can stall silently in the same way. #11060 has a fix up for that.
fix(throttler): continue draining queued tasks after a task fails (#1…
IzaakGough commentedon Oct 16, 2026
Hi @gustavfrid, update on this one: The throttler issue I mentioned is now fixed in #11248. When a task runs out of retries, its slot now goes to the next queued task, so the deploy no longer stalls.
That fix first shipped in 15.34.0, which also includes the source token fix from #11044. Could you try your deploy on 15.34.0 or later? If any endpoints still fail to update, you should now see the error summary and a non-zero exit code.
Closing for now but please reopen if you still get a silent exit 0.