Skip to content

Webframeworks project deployment fails on v14 #8378

Closed
SharezoneApp/sharezone-app
#1851

Description

@nvzoll

[REQUIRED] Environment info

firebase-tools: v14.0.0

Platform: ubuntu (github action)

[REQUIRED] Test case

npx firebase-tools@latest hosting:channel:deploy <channel> --only production --expires 7d --project <my-gcloud-project> --json
or
npx firebase-tools@latest deploy --only hosting:production --project <my-gcloud-project> --json

[REQUIRED] Steps to reproduce

  1. Next.js 15 project, pages router, use the command above

[REQUIRED] Expected behavior

Project deploys (still happens with v13.35.1)

[REQUIRED] Actual behavior

Initial run:

functions: No cleanup policy detected for repositories in us-central1. This may result in a small monthly bill as container images accumulate over time. 
  
  Error: Functions successfully deployed but could not set up cleanup policy in location us-central1. Pass the --force option to automatically set up a cleanup policy or run 'firebase functions:artifacts:setpolicy' to manually set up a cleanup policy.

After adjusting the settings:

[2025-03-27T20:18:38.469Z] Functions deploy failed.
  [2025-03-27T20:18:38.470Z] ***
  [2025-03-27T20:18:38.470Z] TypeError: Cannot read properties of null (reading 'length')
      at Object.formatServiceAccount (/home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/firebase-tools/lib/gcp/proto.js:95:24)
      at /home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/firebase-tools/lib/gcp/cloudfunctionsv2.js:196:122
      at Object.convertIfPresent (/home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/firebase-tools/lib/gcp/proto.js:45:25)
      at Object.functionFromEndpoint (/home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/firebase-tools/lib/gcp/cloudfunctionsv2.js:196:11)
      at Fabricator.updateV2Function (/home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:384:35)
      at Fabricator.updateEndpoint (/home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:155:24)
      at /home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:110:71
      at handle (/home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:89:23)
      at Fabricator.applyChangeset (/home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:110:26)
      at /home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:69:40
  
  Error: There was an error deploying functions
  
  The process '/usr/local/bin/npx' failed with exit code 2

Activity

  1. nvzoll commented on Mar 27, 2025

    @nvzoll
    Author

    Github action: FirebaseExtended/action-hosting-deploy@v0

  2. LucianoGanga commented on Mar 27, 2025

    @LucianoGanga

    Hello! I'm having the exact same issue. And I imagine a lot more people will have it soon. By default my deploy script installs the latest firebase-tool package. I was fighting for the last 2 and a half hours with our code until I saw that the version 14 of this package was published ~3h ago.

    The only breaking change I see in the release notes, related to cloud functions is this:

    BREAKING(cloud functions)! Removed the experimental:functions:shell command. Use functions:shell instead.
    so I don't understand what happened, because we're not using that command.

    Anyhow, the fix that worked for us:

    npm install -g firebase-tools@13 
    

    Thanks!

  3. OutdatedGuy commented on Mar 27, 2025

    @OutdatedGuy
    Contributor
    Image

    I think the issue is related to the above warning we used to get in firebase-tools@13. For more informations.

  4. nvzoll commented on Mar 27, 2025

    @nvzoll
    Author

    @OutdatedGuy actually, FirebaseExtended/action-hosting-deploy@v0 I referred above does use GOOGLE_APPLICATION_CREDENTIALS
    https://github.com/FirebaseExtended/action-hosting-deploy/blob/main/src/deploy.ts#L102

  5. OutdatedGuy commented on Mar 27, 2025

    @OutdatedGuy
    Contributor

    Can you give details about how your FirebaseExtended/action-hosting-deploy@v0 step is configured for actions?

  6. nvzoll commented on Mar 27, 2025

    @nvzoll
    Author

    Sure

    - run: |
                      export NODE_OPTIONS=--max_old_space_size=4096
                      npm ci && npm run build
                - uses: FirebaseExtended/action-hosting-deploy@v0
                  with:
                      repoToken: '${{ secrets.GITHUB_TOKEN }}'
                      firebaseServiceAccount: '${{ secrets.<service account json content>}}'
                      channelId: live
                      projectId: <my-project>
                      target: production
                  env:
                      FIREBASE_CLI_EXPERIMENTS: webframeworks
    
  7. haggbart commented on Mar 27, 2025

    @haggbart

    I'm experiencing the exact same issue with Firebase CLI v14.0.0. The error occurs even on a fresh project.

    Fix #8378 (comment) works

  8. sufyankhatri commented on Mar 27, 2025

    @sufyankhatri

    I'm experiencing the exact same issue with Firebase CLI v14.0.0. The error occurs even on a fresh project

  9. service-paradis commented on Mar 28, 2025

    @service-paradis

    I though I was crazy! Similar problems here with FirebaseExtended/[email protected] which installed [email protected]

  10. ph360 commented on Mar 28, 2025

    @ph360

    Image

    When I deploy my functions since github show me the same error.

  11. redian commented on Mar 28, 2025

    @redian

    If you are using FirebaseExtended/action-hosting-deploy@v0 action and facing this issue, you can force firebase-tools version using the firebaseToolsVersion config on the GA job.

    Something like this would work:

          - name: Deploy to Firebase
            uses: FirebaseExtended/action-hosting-deploy@v0
            env:
              FIREBASE_CLI_EXPERIMENTS: webframeworks
            with:
              firebaseToolsVersion: 13.35.1
              ...
    
  12. nvzoll commented on Mar 28, 2025

    @nvzoll
    Author

    @redian that's exactly what we did, thanks

  13. taeold commented on Mar 28, 2025

    @taeold
    Contributor

    We've released a new version with a fix (14.0.1). Sorry for the confusion everyone.

  14. nvzoll commented on Mar 28, 2025

    @nvzoll
    Author

    Thank you! I guess we'll stick to v13 for a week just in case...

  15. ph360 commented on Mar 29, 2025

    @ph360

    Already is ready this version npm install -g [email protected]

  16. fivecar commented on Mar 29, 2025

    @fivecar
    Contributor

    @taeold : I still get this on 14.0.1, as recent as an hour ago running npx firebase-tools deploy --token "$FIREBASE_TOKEN" --project MY-PROJ --only functions in a GitHub action on the server. Are there potentially still cases where 14.0.1 still fails in this way?

  17. ph360 commented on Mar 29, 2025

    @ph360

    @taeold : I still get this on 14.0.1, as recent as an hour ago running npx firebase-tools deploy --token "$FIREBASE_TOKEN" --project MY-PROJ --only functions in a GitHub action on the server. Are there potentially still cases where 14.0.1 still fails in this way?

    Image

    in github all ok with version 14.0.1

  18. fivecar commented on Mar 29, 2025

    @fivecar
    Contributor

    FWIW, 14.0.1 still not ok in my case.
    Image

    Image
  19. ph360 commented on Mar 29, 2025

    @ph360

    FWIW, 14.0.1 still not ok in my case. Image

    Image

    Image

  20. ph360 commented on Mar 29, 2025

    @ph360

    FWIW, 14.0.1 still not ok in my case. Image
    Image

    Image

    I believe that message is for other reason. I see that see the policy

  21. vamshiOmniWorks commented on Mar 29, 2025

    @vamshiOmniWorks

    This worked for me

    • uses: FirebaseExtended/action-hosting-deploy@v0
      with:
      repoToken: "${{ secrets.GITHUB_TOKEN }}"
      firebaseServiceAccount: "${{ secrets.xxx }}"
      channelId: live
      projectId: xxx
      expires: 30d
      firebaseToolsVersion: 13.35.1
  22. nilsreichardt commented on Apr 16, 2025

    @nilsreichardt
    Contributor

    I am using Firebase CLI v14.1.0 and still get the error.

    Here you see that I'm using v14.1.0

    Image

    Error:

    Image

    Logs: https://github.com/SharezoneApp/sharezone-app/actions/runs/14430710787/job/40465822063?pr=1849

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