Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Firebase deploy functions fails

Javier Martín October 20, 2022

After updating firebase-functions to 4.0.0 or 4.0.1, trying to deploy my functions with the firebase CLI is success.

But with de pipeline, firebase-deploy version 2.0.0 it seems is not detecting my functions folder and return me an error saying me that non-interactive is not able to delete my functions (and a list of all my functions).

 

Reverting the update from firebase-functions 4.0.1 to the last 3.x version, is it working again without any issues.

2 answers

1 accepted

1 vote
Answer accepted
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 4, 2022

@Javier Martín hi. We released a new firebase-deploy pipe version 3.0.0 with firebase-tools 11.

Regards, Igor

Javier Martín November 5, 2022

Working perfect, thank you!

Engine Irie
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 20, 2023

How to install it ?

Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 28, 2023

@Engine Irie hi. Check this article.

Regards, Igor

0 votes
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 21, 2022

@Javier Martín hi. We need more information.

 

Could you share your pipeline configuration and log output for a new and old version of the pipe?

 

Regards, Igor

Javier Martín October 21, 2022
- step:
          name: Install dependencies and build
          script:
            - npm install
            - npm run build:prod
          artifacts:
            - node_modules/**
            - dist/**

      - step:
          name: Deploy to Firebase
          script:
            - cd functions && npm install
            - pipe: atlassian/firebase-deploy:2.0.0
              variables:
                KEY_FILE: $KEYFILE_PROD
                PROJECT_ID: $FIREBASE_PROD
Javier Martín October 21, 2022

Old version:

 

mkdir : /usr/local/n/versions/node/16.18.0
fetch : https://nodejs.org/dist/v16.18.0/node-v16.18.0-linux-x64.tar.gz
installed : v16.18.0 (with npm 8.19.2)
INFO: Starting deployment of the project to Firebase.
=== Deploying to 'projectNameHere'...
i deploying storage, firestore, functions, hosting
Running command: npm --prefix "$RESOURCE_DIR" run lint
> lint
> eslint .
✔ functions: Finished running predeploy script.
i firebase.storage: checking storage.rules for compilation errors...
✔ firebase.storage: rules file storage.rules compiled successfully
i firestore: reading indexes from firestore.indexes.json...
i cloud.firestore: checking firestore.rules for compilation errors...
✔ cloud.firestore: rules file firestore.rules compiled successfully
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i functions: ensuring required API cloudbuild.googleapis.com is enabled...
✔ functions: required API cloudfunctions.googleapis.com is enabled
✔ functions: required API cloudbuild.googleapis.com is enabled
i functions: preparing codebase default for deployment
⚠ functions: package.json indicates an outdated version of firebase-functions. Please upgrade using npm install --save firebase-functions@latest in your functions directory.
⚠ functions: Please note that there will be breaking changes when you upgrade.
i functions: preparing functions directory for uploading...
i functions: packaged /opt/atlassian/pipelines/agent/build/functions (3.09 MB) for uploading
i functions: ensuring required API cloudscheduler.googleapis.com is enabled...
i functions: ensuring required API cloudtasks.googleapis.com is enabled...
✔ functions: required API cloudscheduler.googleapis.com is enabled
✔ functions: required API cloudtasks.googleapis.com is enabled
i storage: latest version of storage.rules already up to date, skipping upload...
i firestore: latest version of firestore.rules already up to date, skipping upload...
✔ firestore: deployed indexes in firestore.indexes.json successfully
✔ functions: functions folder uploaded successfully
i hosting[projectNameHere]: beginning deploy...
i hosting[projectNameHere]: found 39 files in dist
i hosting: adding files to version [0/39] (0%)
i hosting: uploading new files [9/11] (81%)
✔ hosting[projectNameHere]: file upload complete
✔ storage: released rules storage.rules to firebase.storage
✔ firestore: released rules firestore.rules to cloud.firestore
i functions: updating Node.js 16 function backup-create(europe-west3)...
i functions: updating Node.js 16 function certifications-create(europe-west3)...
i functions: updating Node.js 16 function certifications-uploaded(europe-west3)...
i functions: updating Node.js 16 function records-files-create(europe-west3)...
i functions: updating Node.js 16 function notifications-create(europe-west3)...
i functions: updating Node.js 16 function notifications-read(europe-west3)...
i functions: updating Node.js 16 function procedures-create(europe-west3)...
i functions: updating Node.js 16 function procedures-change-status(europe-west3)...
i functions: updating Node.js 16 function procedures-update(europe-west3)...
i functions: updating Node.js 16 function blockchain-listenerActions(europe-west3)...
i functions: updating Node.js 16 function users-create(europe-west3)...
i functions: updating Node.js 16 function users-disable(europe-west3)...
i functions: updating Node.js 16 function users-update-info(europe-west3)...
i functions: updating Node.js 16 function users-update-email(europe-west3)...
i functions: updating Node.js 16 function help-form(europe-west3)...
i functions: updating Node.js 16 function blockchain-listener(europe-west3)...
i functions: updating Node.js 16 function blockchain-retry(europe-west3)...
i functions: updating Node.js 16 function blockchain-sendTransaction(europe-west3)...
✔ functions[blockchain-listener(europe-west3)] Successful update operation.
✔ functions[backup-create(europe-west3)] Successful update operation.
✔ functions[blockchain-retry(europe-west3)] Successful update operation.
✔ functions[blockchain-sendTransaction(europe-west3)] Successful update operation.
✔ functions[certifications-create(europe-west3)] Successful update operation.
✔ functions[help-form(europe-west3)] Successful update operation.
✔ functions[users-disable(europe-west3)] Successful update operation.
✔ functions[users-create(europe-west3)] Successful update operation.
✔ functions[notifications-read(europe-west3)] Successful update operation.
✔ functions[users-update-info(europe-west3)] Successful update operation.
✔ functions[procedures-update(europe-west3)] Successful update operation.
✔ functions[certifications-uploaded(europe-west3)] Successful update operation.
✔ functions[users-update-email(europe-west3)] Successful update operation.
✔ functions[procedures-change-status(europe-west3)] Successful update operation.
✔ functions[procedures-create(europe-west3)] Successful update operation.
✔ functions[notifications-create(europe-west3)] Successful update operation.
✔ functions[records-files-create(europe-west3)] Successful update operation.
✔ functions[blockchain-listenerActions(europe-west3)] Successful update operation.
Function URL (procedures-change-status(europe-west3)): https://europe-west3-projectNameHere.cloudfunctions.net/procedures-change-status
i functions: cleaning up build files...
i hosting[projectNameHere]: finalizing version...
✔ hosting[projectNameHere]: version finalized
i hosting[projectNameHere]: releasing new version...
✔ hosting[projectNameHere]: release complete
✔ Deploy complete!

Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 21, 2022

.

Javier Martín October 21, 2022

For new version, wait a moment, I will make a deployment in a few minutes

Like Igor Stoyanov likes this
Javier Martín October 21, 2022

New version output:

Digest: sha256:450c901c08b42fb224428c4de3903aa06ac76bcfa0277e109a92c7c11677528c
Status: Downloaded newer image for bitbucketpipelines/firebase-deploy:2.0.0
INFO: Executing the pipe...
INFO: Current NodeJS version:
installing : node-v16.18.0
mkdir : /usr/local/n/versions/node/16.18.0
fetch : https://nodejs.org/dist/v16.18.0/node-v16.18.0-linux-x64.tar.gz
installed : v16.18.0 (with npm 8.19.2)
INFO: Starting deployment of the project to Firebase.
=== Deploying to 'projectNameHere'...
i deploying storage, firestore, functions, hosting
Running command: npm --prefix "$RESOURCE_DIR" run lint
> lint
> eslint .
✔ functions: Finished running predeploy script.
i firebase.storage: checking storage.rules for compilation errors...
✔ firebase.storage: rules file storage.rules compiled successfully
i firestore: reading indexes from firestore.indexes.json...
i cloud.firestore: checking firestore.rules for compilation errors...
✔ cloud.firestore: rules file firestore.rules compiled successfully
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i functions: ensuring required API cloudbuild.googleapis.com is enabled...
✔ functions: required API cloudbuild.googleapis.com is enabled
✔ functions: required API cloudfunctions.googleapis.com is enabled
i functions: preparing codebase default for deployment
i storage: latest version of storage.rules already up to date, skipping upload...
i firestore: latest version of firestore.rules already up to date, skipping upload...
✔ firestore: deployed indexes in firestore.indexes.json successfully
i hosting[projectNameHere]: beginning deploy...
i hosting[projectNameHere]: found 39 files in dist
i hosting: adding files to version [0/39] (0%)
i hosting: uploading new files [10/12] (83%)
✔ hosting[projectNameHere]: file upload complete
✔ storage: released rules storage.rules to firebase.storage
✔ firestore: released rules firestore.rules to cloud.firestore
Error: The following functions are found in your project but do not exist in your local source code:
backup-create(europe-west3)
blockchain-listener(europe-west3)
blockchain-listenerActions(europe-west3)
blockchain-retry(europe-west3)
blockchain-sendTransaction(europe-west3)
certifications-create(europe-west3)
certifications-uploaded(europe-west3)
help-form(europe-west3)
notifications-create(europe-west3)
notifications-read(europe-west3)
procedures-change-status(europe-west3)
procedures-create(europe-west3)
procedures-update(europe-west3)
records-files-create(europe-west3)
users-create(europe-west3)
users-disable(europe-west3)
users-update-email(europe-west3)
users-update-info(europe-west3)
Aborting because deletion cannot proceed in non-interactive mode. To fix, manually delete the functions by running:
firebase functions:delete backup-create --region europe-west3
firebase functions:delete blockchain-listener --region europe-west3
firebase functions:delete blockchain-listenerActions --region europe-west3
firebase functions:delete blockchain-retry --region europe-west3
firebase functions:delete blockchain-sendTransaction --region europe-west3
firebase functions:delete certifications-create --region europe-west3
firebase functions:delete certifications-uploaded --region europe-west3
firebase functions:delete help-form --region europe-west3
firebase functions:delete notifications-create --region europe-west3
firebase functions:delete notifications-read --region europe-west3
firebase functions:delete procedures-change-status --region europe-west3
firebase functions:delete procedures-create --region europe-west3
firebase functions:delete procedures-update --region europe-west3
firebase functions:delete records-files-create --region europe-west3
firebase functions:delete users-create --region europe-west3
firebase functions:delete users-disable --region europe-west3
firebase functions:delete users-update-email --region europe-west3
firebase functions:delete users-update-info --region europe-west3
✖ Deployment failed.

Javier Martín October 21, 2022

The only difference between two outputs is changing in functions/package.json:

firebase-functions from

 

"firebase-functions": "^3.24.1"

to 

 

"firebase-functions": "^4.0.1",
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 21, 2022
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 21, 2022

Also in the the pipe we use firebase-tools@10.* , could we swap your local firebase CLI to that version to see if you have the same error?

Javier Martín October 21, 2022

That is not my case and using de deploy comand in my local computer, the functions are deploying without issues.

I'm using firebase-tools 11.15.0

I will check with 10* version

Javier Martín October 21, 2022

Deployment with firebase-tools 10.3.0 is reproducing the same issue in my local CLI, so the problem is the outdated firebase-tools version in pipeline deploy

Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 24, 2022

@Javier Martín we will perform update and notify you when new version will become available.

 

Regards, Igor

Like Javier Martín likes this
Javier Martín October 25, 2022

Thank you!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events