firebase-tools: Firebase CLI deploy functions HTTP Error: 404 Not Found
Version info
6.2.2
Platform Information
Windows,
Steps to reproduce
firebase deploy --only functions
=== Deploying to 'vagtplan-1e00d'...
i deploying functions
Running command: npm --prefix "functions" run lint
> functions@ lint C:\Users\srenb\Documents\Arbejde\skemadoktor.dk\cfunctions\functions
> tslint --project tsconfig.json
Running command: npm --prefix "functions" run build
> functions@ build C:\Users\srenb\Documents\Arbejde\skemadoktor.dk\cfunctions\functions
> tsc
+ functions: Finished running predeploy script.
i functions: ensuring necessary APIs are enabled...
+ functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...
i functions: packaged functions (48.09 KB) for uploading
! functions: Upload Error: HTTP Error: 404, Not Found
Error: HTTP Error: 404, Not Found
Debug shows that it cannot find the required bucket:
Error: HTTP Error: 404, Not Found
[2019-01-15T11:17:12.995Z] Error Context: {
"body": {
"error": {
"message": "Not Found"
}
},
"response": {
"statusCode": 404,
"body": "<?xml version='1.0' encoding='UTF-8'?><Error><Code>NoSuchBucket</Code><Message>The specified bucket does not exist.</Message></Error>",
Expected behavior
It should upload no problem
Actual behavior
Fails because it can’t find the bucket returned from
HTTP REQUEST POST https://cloudfunctions.googleapis.com/v1/projects/vagtplan-1e00d/locations/us-central1/functions:generateUploadUrl
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 26 (3 by maintainers)
I came across this same error and resolved it by making sure the site name in Firebase matched what I had in my
firebase.json
file.This error looks project-specific. Please reach out to Firebase support for help, as the issue likely lies with the backend servers and not the Firebase CLI.
Thanks!
It was
npm i -g firebase-tools
which resolved the issue for me. It updated my old firebase tools. Hope this helps to someone.Ideally, the site names shouldn’t be added to
firebase.json
. If you use different Firebase projects for staging and production (as recommended by Firebase), having the site names hardcoded infirebase.json
poses a problem when you switch between projects withfirebase use <projectName>
. Site names are unique across projects; no matter which project youuse
, deploys will be made to the same Firebase site.Instead, set up deploy targets in
.firebaserc
. Here’s an example of an app that has two Firebase projects (dev and prod), with two sites:.firebaserc:
firebase.json:
This way you can switch between, and deploy to, different Firebase projects without having to change your
firebase.json
.@mbleigh Was this project-specific? I am running into the same issue. ? Opened a case (2-2819000025743) as recommended by you, but could be a mistake that I am making?
For me, this was resolved by setting the “Default GCP resource location” under Project settings.
Firebase doesn’t accept
groups
name with white spaces. e.g:- iOSiOS SIT Tester always get failed on
wheres JinglePayTesters succeed without any problem.
update your Firebase npm package to latest version . I works for me https://www.npmjs.com/package/firebase
For me updating the
firebase-tools
package from version 6.12 to the latest one (8.9) fixed this problem.If you add a new target to firebaserc file, make sure you add the same site in the firebase hosting @ firebase console too.