firebase-action icon indicating copy to clipboard operation
firebase-action copied to clipboard

functions: got "Quota Exceeded" error while trying to update Waiting to retry

Open ortegoncarlos opened this issue 3 years ago • 2 comments

Hello, thanks for this awsome project.

Im getting this "Quota Exceed Error" after we passed the 50 functions, it seems is the write requests per minute quota and it cannot be inncresed

Captura de Pantalla 2022-02-03 a la(s) 10 59 46 a m Captura de Pantalla 2022-02-03 a la(s) 11 13 37 a m

Cloud Functions API | Write requests per minute |   | 50 | 21.6 % | 55 % |   Firebase Management API | Firebase Apps per project |   | 30 | 3.33 % | 3.33 % |  

ortegoncarlos avatar Feb 03 '22 15:02 ortegoncarlos

As a workaround I have two methods, the first one is to put every group in separate steps and the second method is to split it in separate jobs using matrix

separate steps

cons:very slow


       - name: run deploy functions bgchecker
        uses: w9jds/firebase-action@master
        with:
            args: deploy --only functions:bgchecker --project=staging --force
        env:
            FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN_PROD }}

      - name: run deploy functions mailer
        uses: w9jds/firebase-action@master
        with:
            args: deploy --only functions:mailer --project=staging --force
        env:
            FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN_PROD }}
      - name: run deploy functions:sync
        uses: w9jds/firebase-action@master
        with:
            args: deploy --only functions:sync --project=staging --force
        env:
            FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN_PROD }}

separate Jobs

cons: some unestable and some functions throw this error "code":9,"message":"Invalid source token" pro: Much DRY and cool

 build_and_deploy:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        group: [
          bgchecker,
          mailer,
          sync,
          timestamper,
          fileReader,
          slack,
          alegra,]
    steps:
      - uses: actions/checkout@v2
      - name: Install Node
        uses: actions/setup-node@v1
        with:
          node-version: 12.8

      - name: npm dependencies
        run: |
          cd functions
          npm install

      - name: run deploy functions
        uses: w9jds/firebase-action@master
        with:
            args: deploy --only functions:${{matrix.group}} --project=staging --force
        env:
            FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN_PROD }}

ortegoncarlos avatar Feb 03 '22 17:02 ortegoncarlos

This worked well, a couple of tweaks that helped for me:

  • adding fail-fast: false means the whole run won't be for nothing if one of the groups fail to finish and you can just run that one again from the console
  • You can tweak the cluster if you have a lot of groups by adding a max-parallel param
 build_and_deploy:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      max-parallel: 5
      matrix:
        group: [
          bgchecker,
          mailer,
          sync,
          timestamper,
          fileReader,
          slack,
          alegra,]

jeffjenk avatar Feb 24 '24 17:02 jeffjenk