You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading from [email protected] to [email protected], deploying multiple codebases in a single firebase deploy command causes functions to receive the wrong container image. Functions from one codebase end up with code from another codebase.
Steps to reproduce
Configure firebase.json with multiple codebases, each with a separate source directory:
Function 'acknowledgeSubscription' is not defined in the provided module.
Did you specify the correct target function to execute?
Container called exit(1).
The function acknowledgeSubscription exists in the mobile-billing codebase but the deployed container has code from a different codebase.
Expected behavior
Each codebase should get its own container image built from its respective source directory.
Actual behavior
Container images are shared/mixed between codebases. Functions fail healthcheck because the deployed code doesn't contain the expected function exports.
Workaround
Pin [email protected] — parallel multi-codebase deploy works correctly on that version.
Alternatively, deploy each codebase sequentially in separate firebase deploy calls (but this is ~6.5x slower — 26 min vs 4 min for 11 codebases).
Reacted by Matthieu Rudelle, Nikita Lvov, christopheramason and Otto Bretz
Hey folks, apologies for the issue and thanks for reporting this to us. I'm currently trying to reproduce this, but so far I haven't encountered the same error.
Does it fail on a different function on every deployment, of is it occurring on the same function every time? If it is the same function every time, could you let us know what type of function it is? Is it a firestore trigger, pub sub trigger, etc - could you also share a sample code snippet for it? By any chance, can anyone share a minimal reproducible example, this will help us accurately replicate the issue.
Also, could you share the output of running firebase experiments:list?
3 codebases (2× TypeScript Node 22, 1× Python 3.12), 3 trivial onRequest functions each. A single firebase deploy --only functions --force reliably triggers the bug on 15.15.0; switching the pin to 15.14.0 deploys cleanly with no other changes.
Answers:
Same function every time? — In the repro it's deterministic: the first codebase processed deploys correctly, and all subsequent codebases inherit its source_token / image. With more than one codebases, first wins and the others break.
Function type? — Plain HTTPS in the repro; in our production codebase the failures hit HTTPS, callables, Firestore and Pub/Sub triggers, so trigger type doesn't matter.
Smoking gun — when one codebase is Python and the next is Node, the GCF API rejects with:
HTTP Error: 400, Invalid Request. Violations: must use the same runtime as the source_token.
That points directly at a source_token being reused across codebases. When the runtimes match, the API accepts it and you instead get the Cloud Run health-check failure from the original report (container has wrong code, doesn't export the requested entrypoint).
firebase experiments:list (enabled): functionsv2deployoptimizations, webframeworks, pintags, apphosting, genkit, mcp, fdcift, fdcwebhooks, fdcrealtime. Worth flagging functionsv2deployoptimizations as a likely suspect given the v2-only nature of the regression.
Both deploy logs (15.15.0 failing, 15.14.0 clean) are under logs/ in the repro repo.
Thanks for the detailed MCVE @mrudelle! Looking through it, it seems like the issue you're encountering is more similar to #10428. I'm not completely sure if this report and #10428 are the same issue, but I think they are somewhat related.
$ firebase deploy --project PROJECT_ID
=== Deploying to 'PROJECT_ID'...
i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run build
> [email protected] build
> tsc
✔ functions: Finished running predeploy script.
Running command: npm --prefix "$RESOURCE_DIR" run build
> [email protected] build
> tsc
✔ functions: Finished running predeploy script.
i functions: preparing codebase alpha for deployment
i functions: preparing codebase beta for deployment
i functions: preparing codebase gamma for deployment
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i functions: ensuring required API cloudbuild.googleapis.com is enabled...
i artifactregistry: ensuring required API artifactregistry.googleapis.com is enabled...
i functions: Loading and analyzing source code for codebase alpha to determine what to deploy
Serving at port 8503
i functions: Loading and analyzing source code for codebase beta to determine what to deploy
Serving at port 8224
i functions: Loading and analyzing source code for codebase gamma to determine what to deploy
* Serving Flask app 'serving'
* Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on http://127.0.0.1:8081
Press CTRL+C to quit
127.0.0.1 - - [30/Apr/2026 19:19:47] "GET /__/functions.yaml HTTP/1.1" 200 -
127.0.0.1 - - [30/Apr/2026 19:19:47] "GET /__/quitquitquit HTTP/1.1" 200 -
/bin/sh: line 1: 71722 Terminated: 15 python3.12 "/Users/PATH/firebase-tools-issue-10402-repro/functions-gamma/venv/lib/python3.12/site-packages/firebase_functions/private/serving.py"
i extensions: ensuring required API firebaseextensions.googleapis.com is enabled...
i functions: preparing functions-alpha directory for uploading...
i functions: packaged /Users/PATH/firebase-tools-issue-10402-repro/functions-alpha (33.22 KB) for uploading
i functions: preparing functions-beta directory for uploading...
i functions: packaged /Users/PATH/firebase-tools-issue-10402-repro/functions-beta (34.19 KB) for uploading
i functions: preparing functions-gamma directory for uploading...
i functions: packaged /Users/PATH/firebase-tools-issue-10402-repro/functions-gamma (1.34 KB) for uploading
i functions: ensuring required API run.googleapis.com is enabled...
i functions: ensuring required API eventarc.googleapis.com is enabled...
i functions: ensuring required API pubsub.googleapis.com is enabled...
i functions: ensuring required API storage.googleapis.com is enabled...
i functions: generating the service identity for pubsub.googleapis.com...
i functions: generating the service identity for eventarc.googleapis.com...
✔ functions: functions-gamma source uploaded successfully
✔ functions: functions-alpha source uploaded successfully
✔ functions: functions-beta source uploaded successfully
i functions: creating Node.js 22 (2nd Gen) function alpha:functionA(us-central1)...
i functions: creating Node.js 22 (2nd Gen) function alpha:functionB(us-central1)...
i functions: creating Node.js 22 (2nd Gen) function alpha:functionC(us-central1)...
i functions: creating Node.js 22 (2nd Gen) function beta:functionD(us-central1)...
i functions: creating Node.js 22 (2nd Gen) function beta:functionE(us-central1)...
i functions: creating Node.js 22 (2nd Gen) function beta:functionF(us-central1)...
i functions: creating Python 3.12 (2nd Gen) function gamma:function_g(us-central1)...
i functions: creating Python 3.12 (2nd Gen) function gamma:function_h(us-central1)...
i functions: creating Python 3.12 (2nd Gen) function gamma:function_i(us-central1)...
✔ functions[beta:functionE(us-central1)] Successful create operation.
✔ functions[beta:functionD(us-central1)] Successful create operation.
✔ functions[beta:functionF(us-central1)] Successful create operation.
✔ functions[gamma:function_g(us-central1)] Successful create operation.
✔ functions[gamma:function_h(us-central1)] Successful create operation.
✔ functions[gamma:function_i(us-central1)] Successful create operation.
✔ functions[alpha:functionA(us-central1)] Successful create operation.
✔ functions[alpha:functionB(us-central1)] Successful create operation.
✔ functions[alpha:functionC(us-central1)] Successful create operation.
Function URL (alpha:functionA(us-central1)): https://us-central1-PROJECT_ID.cloudfunctions.net/functionA
Function URL (alpha:functionB(us-central1)): https://us-central1-PROJECT_ID.cloudfunctions.net/functionB
Function URL (alpha:functionC(us-central1)): https://us-central1-PROJECT_ID.cloudfunctions.net/functionC
Function URL (beta:functionD(us-central1)): https://us-central1-PROJECT_ID.cloudfunctions.net/functionD
Function URL (beta:functionE(us-central1)): https://us-central1-PROJECT_ID.cloudfunctions.net/functionE
Function URL (beta:functionF(us-central1)): https://us-central1-PROJECT_ID.cloudfunctions.net/functionF
Function URL (gamma:function_g(us-central1)): https://us-central1-PROJECT_ID.cloudfunctions.net/function_g
Function URL (gamma:function_h(us-central1)): https://us-central1-PROJECT_ID.cloudfunctions.net/function_h
Function URL (gamma:function_i(us-central1)): https://us-central1-PROJECT_ID.cloudfunctions.net/function_i
✔ Deploy complete!
Project Console: https://console.firebase.google.com/project/PROJECT_ID/overview
$ firebase --version
15.16.0
Hey @skopanev. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Activity
mrudelle commentedon Apr 22, 2026
We're running into the same issue, pinning to
[email protected]solves the issue.aalej commentedon Apr 22, 2026
Hey folks, apologies for the issue and thanks for reporting this to us. I'm currently trying to reproduce this, but so far I haven't encountered the same error.
Does it fail on a different function on every deployment, of is it occurring on the same function every time? If it is the same function every time, could you let us know what type of function it is? Is it a firestore trigger, pub sub trigger, etc - could you also share a sample code snippet for it? By any chance, can anyone share a minimal reproducible example, this will help us accurately replicate the issue.
Also, could you share the output of running
firebase experiments:list?ottob commentedon Apr 27, 2026
Same issue here:
mrudelle commentedon Apr 30, 2026
Hi @aalej, minimal repro: https://github.com/mrudelle/firebase-tools-issue-10402-repro
3 codebases (2× TypeScript Node 22, 1× Python 3.12), 3 trivial
onRequestfunctions each. A singlefirebase deploy --only functions --forcereliably triggers the bug on15.15.0; switching the pin to15.14.0deploys cleanly with no other changes.Answers:
Same function every time? — In the repro it's deterministic: the first codebase processed deploys correctly, and all subsequent codebases inherit its
source_token/ image. With more than one codebases, first wins and the others break.Function type? — Plain HTTPS in the repro; in our production codebase the failures hit HTTPS, callables, Firestore and Pub/Sub triggers, so trigger type doesn't matter.
Smoking gun — when one codebase is Python and the next is Node, the GCF API rejects with:
That points directly at a
source_tokenbeing reused across codebases. When the runtimes match, the API accepts it and you instead get the Cloud Run health-check failure from the original report (container has wrong code, doesn't export the requested entrypoint).firebase experiments:list(enabled):functionsv2deployoptimizations,webframeworks,pintags,apphosting,genkit,mcp,fdcift,fdcwebhooks,fdcrealtime. Worth flaggingfunctionsv2deployoptimizationsas a likely suspect given the v2-only nature of the regression.Both deploy logs (15.15.0 failing, 15.14.0 clean) are under
logs/in the repro repo.aalej commentedon Apr 30, 2026
Thanks for the detailed MCVE @mrudelle! Looking through it, it seems like the issue you're encountering is more similar to #10428. I'm not completely sure if this report and #10428 are the same issue, but I think they are somewhat related.
Could you try updating to the current latest version of firebase-tools(15.16.0) to see if the issue would get resolved? I think this PR #10432 should fix this. I've tried deploying multi-codebase functions a couple of times on the latest version, and no errors are being raised. Also tried with the mcve - https://github.com/mrudelle/firebase-tools-issue-10402-repro.
Here are the logs from deploying on 15.16.0
logs
google-oss-bot commentedon May 11, 2026
Hey @skopanev. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
google-oss-bot commentedon May 14, 2026
Since there haven't been any recent updates here, I am going to close this issue.
@skopanev if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.