Skip to content

App Hosting: firebase deploy --only apphosting:<backendId> exits successfully without deploying when no matching backendId exists in firebase.json #10161

@otTATto

Description

@otTATto

[REQUIRED] Environment info

firebase-tools: 15.11.0

Platform: Linux (GitHub Actions ubuntu-latest)

Authentication:

  • Running in GitHub Actions
  • Authenticated via Google Cloud service account (project-A)

[REQUIRED] Test case

I am deploying from GitHub Actions using a service account that belongs to project-A.

  • project-A contains backend-A
  • firebase.json is misconfigured with backendId: backend-B (which belongs to a different project)

Deploy command:

firebase deploy --only apphosting:backend-A --project project-A

[REQUIRED] Steps to reproduce

  1. Configure firebase.json with:
    {
      "apphosting": [
        {
          "backendId": "backend-B",
          "rootDir": "/"
        }
      ]
    }
  2. Run in GitHub Actions (ubuntu-latest) with a service account for project-A:
    firebase deploy --only apphosting:backend-A --project project-A
  3. Observe CLI output:
    === Deploying to 'project-A'...
    
    i  deploying apphosting
    
    ✔  Deploy complete!
    
    Project Console: https://console.firebase.google.com/project/project-A/overview
    
  4. Check Firebase Console of project-A:
    • No rollout is created
    • No deployment occurs

[REQUIRED] Expected behavior

The CLI should either:

  • fail with an error because no apphosting entry in firebase.json matches backend-A, or
  • show a clear warning that no App Hosting deployment was performed

It should not report Deploy complete! when no deployment is actually performed.

[REQUIRED] Actual behavior

The command exits successfully with Deploy complete!, but no rollout is created and no deployment occurs.

Additional notes

From additional testing, the behavior appears to depend on whether the backendId specified via --only matches any entry in firebase.json.

If no matching apphosting.backendId exists in firebase.json, the CLI performs a no-op and exits successfully without deploying anything.

Only when both of the following are true:

  • the backendId specified via --only
  • and the backendId in firebase.json

match each other, the CLI proceeds with actual deployment or backend existence validation.

This leads to inconsistent behavior:

  • In some cases, invalid backend IDs are correctly detected (when they match firebase.json)
  • In other cases, the same invalid backend IDs are silently ignored (when they do not match firebase.json)

This makes it difficult to detect configuration errors, especially in CI/CD environments, because the command appears successful while no deployment is performed.

firebase deploy —only apphosting: apphosting.backendId in firebase.json CLI outputs rollout created?
backend-A backend-A i deploying apphosting
i apphosting: Found backend(s) backend-A

✔ apphosting: Rollout for backend backend-A complete!
✔ apphosting: Your backend is now deployed at: https://****
✔ Deploy complete!
yes
backend-A backend-B i deploying apphosting
✔ Deploy complete!
no
backend-B backend-A i deploying apphosting
✔ Deploy complete!
no
backend-B backend-B i deploying apphosting
? Did not find backend(s) ds-connect. Do you want to create them (you'll have
the option to select which to create in the next step)? (Y/n)
25h
Error: An unexpected error has occurred.
Error: Process completed with exit code 2.
no

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