Unexpected Error on Google Cloud Build Deploy to Firebase Hosting

Davtho1983

I have previously managed to deploy small projects to firebase hosting with google cloud build. My current project includes functions, but my deploy script is --only:hosting

I understand this is similar to these posts: stackoeverflow1 stackoverflow2 and stackoverflow3 - but I am using functions and kms not secrets, and I have logged in to firebase ci to get my token. Nothing I've seen points the way clearly enough so far!

I am using google kms cryptography and all my permissions are set up correctly. Correct accounts have firebase admin permissions. Trigger variables are defined correctly.

My .env file contains a parameter FIREBASE_TOKEN that I got by doing firebase login:ci

Here is my cloudbuild.yaml

steps:
    # Install
    - name: 'gcr.io/cloud-builders/npm'
      args: ['install']
    # Build
    - name: 'gcr.io/cloud-builders/npm'
      args: ['run', 'build']
    #Decrypt
    - name: 'gcr.io/cloud-builders/gcloud'
      args: ['kms', 'decrypt', '--ciphertext-file=.env.enc', '--plaintext-file=.env', '--location=global', '--keyring=$_KEY_RING', '--key=$_KEY']
    # Deploy
    - name: 'gcr.io/$_PROJECT_ENV/firebase'
      args: ['deploy', '--debug', '--token=$FIREBASE_TOKEN', '--only=hosting:$_DEPLOY_TO', '--project', '$_PROJECT_ENV']

This runs fine until right at the end, when it gives these messages:

Step #3: === Deploying to 'dev-xxxxx'...
Step #3: 
Step #3: i  deploying hosting 
Step #3: 
Step #3: ✔  Deploy complete! 
Step #3: 
Step #3: Project Console: https://console.firebase.google.com/project/dev-xxxxx/overview
Step #3: [2020-09-27T15:51:57.341Z] TypeError: Cannot read property 'deploys' of undefined
Step #3:     at /usr/local/lib/node_modules/firebase-tools/lib/deploy/index.js:85:36
Step #3:     at processTicksAndRejections (internal/process/task_queues.js:93:5)
Step #3: 
Step #3: Error: An unexpected error has occurred.

Tearing my hair out trying to find what could possibly be wrong? Not getting any permissions errors and firebase image is the latest and builds fine? Any suggestions?

llompalles

This error message might be produced for deployments that don't have the target key and value defined in the firebase.json file, and for deployments that have incorrect target values.

According to the Firebase documentation:

In your firebase.json file, reference the associated target name when you're configuring the settings for each resource or group of resources.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Invalidate Firebase cache for Google Cloud Function on deploy

firebase deploy --only hosting gives Error: HTTP Error: 410, Unknown Error

Firebase cloud function deploy error

Trigger a Cloud Run Build/Deploy with a remote Trigger/Webhookin Google Cloud

using "firebase deploy" to deploy to hosting - how does firebase know if it is deploying to hosting and not cloud functions?

Firebase Cloud Function deploy tslint error

Google Cloud Build deploy to GKE Private Cluster

Firebase Hosting deploy gives HTTP Error 401

Cannot deploy google cloud functions (error: ELIFECYCLE)

Firebase Hosting rewrite doesn't redirect to Google Cloud Run

Firebase deploy functions with Sharp library fails in Google Cloud Build

Use Python Google Cloud Function in Firebase Hosting

Firebase hosting caches Google Cloud Run requests

Firebase CLI error in Google Cloud Build step

firebase deploy hosting from remote (google storage)

Error in p-limit lib when importing @google-cloud/storage to deploy firebase function

Proper permission for Cloud Build to deploy to Firebase?

Error: hosting:channel:deploy is not a Firebase command

Google cloud spatie/image deploy error, build do not complete

How to correctly deploy changes after pairing Google Cloud Run with Firebase Hosting

Parsing error: Unexpected token => when trying to deploy firebase cloud function. I couldn't find any answers on here

google cloud hosting for database

firebase cloud function deploy glob error

Firebase hosting deploy error "HTTP Error: 404, Not Found"

Deploy Vue Build On Google Cloud Platform

Unexpected error while deploying firebase cloud functions

Google cloud App engine Spring deploy error

firebase cloud functions command error `firebase deploy --only functions`

Disable Firebase hosting github deploy