Skip to content

v15.15.0 regression: parallel multi-codebase deploy assigns wrong container image to functions #10402

Closed

Description

@skopanev

Environment

  • firebase-tools version: v15.15.0 (works correctly on v15.14.0)
  • Platform: Linux (Docker, node:22-bookworm)
  • Function runtime: Node.js 22
  • Functions type: Cloud Functions v2 (Cloud Run-backed)
  • Number of codebases: 11

Description

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

  1. Configure firebase.json with multiple codebases, each with a separate source directory:
{
  "functions": [
    { "source": "dist/web", "codebase": "web" },
    { "source": "dist/mobile/billing", "codebase": "mobile-billing" },
    { "source": "dist/analytics", "codebase": "analytics" }
  ]
}
  1. Deploy all codebases in a single command:
ONLY=$(node -e "console.log(codebases.map(x=>'functions:'+x).join(','))")
firebase deploy --force --only "$ONLY,firestore,hosting,storage,remoteconfig"
  1. Functions fail at startup with:
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).

Activity

  1. mrudelle commented on Apr 22, 2026

    @mrudelle

    We're running into the same issue, pinning to [email protected] solves the issue.

  2. aalej commented on Apr 22, 2026

    @aalej
    Contributor

    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. ottob commented on Apr 27, 2026

    @ottob

    Same issue here:

    ┌─────────┬────────────────────────────────┬─────────────────────────────────────────────────────────────────────────────┐
    │ Enabled │ Name                           │ Description                                                                 │
    ├─────────┼────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┤
    │ y       │ functionsv2deployoptimizations │ Optimize deployments of v2 firebase functions                               │
    ├─────────┼────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┤
    │ y       │ pintags                        │ Adds the pinTag option to Run and Functions rewrites                        │
    ├─────────┼────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┤
    │ y       │ apphosting                     │ Allow CLI option for Frameworks                                             │
    ├─────────┼────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┤
    │ y       │ genkit                         │ Enable Genkit related features.                                             │
    ├─────────┼────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┤
    │ y       │ mcp                            │ Adds experimental `firebase mcp` command for running a Firebase MCP server. │
    ├─────────┼────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┤
    │ n       │ deletegcfartifacts             │ Add the functions:deletegcfartifacts command to purge docker build images   │
    ├─────────┼────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┤
    │ n       │ legacyRuntimeConfigCommands    │ Expose legacy functions.config() CLI commands                               │
    ├─────────┼────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┤
    │ n       │ webframeworks                  │ Native support for popular web frameworks                                   │
    ├─────────┼────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┤
    │ n       │ appsinit                       │ Adds experimental `apps:init` command.                                      │
    ├─────────┼────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┤
    │ n       │ mcpalpha                       │ Opt-in to early MCP features before they're widely released.                │
    ├─────────┼────────────────────────────────┼─────────────────────────────────────────────────────────────────────────────┤
    │ n       │ apptesting                     │ Adds experimental App Testing feature                                       │
    └─────────┴────────────────────────────────┴─────────────────────────────────────────────────────────────────────────────┘
    
  4. mrudelle commented on Apr 30, 2026

    @mrudelle

    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 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.

  5. aalej commented on Apr 30, 2026

    @aalej
    Contributor

    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
    $ 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
    
  6. added
    Needs: Author Feedback
    on Apr 30, 2026
  7. google-oss-bot commented on May 11, 2026

    @google-oss-bot
    Collaborator

    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!

  8. google-oss-bot commented on May 14, 2026

    @google-oss-bot
    Collaborator

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions