Skip to content

hosting:channel:deploy fails with 403 on serviceusage.services.get since v15.34.1 #11335

Closed

Description

@anfernandezz

[REQUIRED] Environment info

firebase-tools: 15.34.1 (works on 15.34.0)
Platform: ubuntu-latest (GitHub Actions), via FirebaseExtended/action-hosting-deploy@v0 (npx firebase-tools@latest)

[REQUIRED] Test case

A service account that can deploy to Hosting (the one set up by firebase init hosting:github) but has no Service Usage role.

[REQUIRED] Steps to reproduce

npx [email protected] hosting:channel:deploy <channel> --only <target> --expires 7d --project <project> --json

[REQUIRED] Expected behavior

The preview channel deploys, like it does on 15.34.0 with the same service account.

[REQUIRED] Actual behavior

Request to https://serviceusage.googleapis.com/v1/projects/<project>/services/firebasehosting.googleapis.com had HTTP Error: 403, Permission denied to get service [firebasehosting.googleapis.com]
reason: AUTH_PERMISSION_DENIED, permission: serviceusage.services.get

It might be related to the 15.34.1 change "Ensured the Firebase Hosting API is enabled before deploying and running other Hosting commands", since our service account doesn't have serviceusage.services.get and the same setup works on 15.34.0.

In case it helps others: pinning to 15.34.0 or granting roles/serviceusage.serviceUsageConsumer to the service account gets deploys working again.

Activity

  1. aalej commented on Oct 23, 2026

    @aalej
    Contributor

    Thanks for reporting this @anfernandezz and for sharing how you worked around the issue. I'm trying to reproduce this, however I haven't been able to replicate the error. After generating a service account via firebase init hosting:github and removing the Service Usage role from it, deployments to Hosting using that service account still go through and don't throw any permission errors.

    I'm not sure what I'm missing here, but here's currently the permissions I have for my service account, please let me know in case this matches the permissions your service account has:

    API Keys Viewer
    Cloud Functions Developer
    Cloud Run Viewer
    Firebase Hosting Admin
    

    I'll also ask someone from our engineering team to take a look as they may have an idea if #11296 is related.

  2. tannerlyons commented on Oct 24, 2026

    @tannerlyons

    We ran into the same issue, same repro!

  3. calebd-anderson commented on Oct 25, 2026

    @calebd-anderson

    I ran into this, with my project, IAM already had Service Usage Consumer role and it was still failing. Pinning to version 15.34.0 with this guide got a deployment to succeed though.

  4. JaffaKetchup commented on Oct 31, 2026

    @JaffaKetchup

    Our library stopped working due to this, the workaround of adding the Service Usage Consumer role worked for us.

    Here's the log of the failed action if it's of use: https://github.com/fleaflet/flutter_map/actions/runs/41240920316/job/124654739435#step:7:163

  5. aalej commented on Nov 2, 2026

    @aalej
    Contributor

    Apologies for the issue here folks, I’ll check this again with our engineering team. While we are investigating, please add the Service Usage Consumer(roles/serviceusage.serviceUsageConsumer) role to your service account, or downgrade to firebase-tools 15.34.0

    # This file was auto-generated by the Firebase CLI
    # https://github.com/firebase/firebase-tools
    
    name: Deploy to Firebase Hosting on merge
    on:
      push:
        branches:
          - main
    jobs:
      build_and_deploy:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
          - uses: FirebaseExtended/action-hosting-deploy@v0
            with:
              firebaseToolsVersion: v15.34.0 # <- this part
              repoToken: ${{ secrets.GITHUB_TOKEN }}
              firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_<PROJECT_ID> }}
              channelId: live
              projectId: <PROJECT_ID>
  6. remarkablemark commented on Nov 3, 2026

    @remarkablemark
  7. guinetn commented on Nov 10, 2026

    @guinetn

    The 403 is a Firebase issue:
    The deploy service account is missing the required Service Usage permission because Firebase CLI v15.34.1 started calling serviceusage.services.get and that call returned 403, which caused the deploy to fail.

    The fix is to add the Service Usage Consumer (roles/serviceusage.serviceUsageConsumer) to the service:

    gcloud projects add-iam-policy-binding YOUR-PROJECT-NAME --member="serviceAccount:xxxxYOUR-SERVICExxxx.iam.gserviceaccount.com" --role="roles/serviceusage.serviceUsageConsumer"

    So, no need to add "firebaseToolsVersion: v15.34.0"

  8. added a commit that references this issue on Nov 10, 2026
    87c3636
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