firebase-tools: 6.3.0
Platform: macOS
Hello everyone. I'm getting weird HTTP 400 Error while trying to deploy the functions to firebase.
For instance, deploying exactly the same functions to my other test project works completely fine!
I can't understand what's the problem is. I tried also to do firebase init.
Weirdly enough, removing the function works just fine! Only problem is with deploy
Including logs.
Thanks!
[debug] [2019-01-24T20:53:52.701Z] ----------------------------------------------------------------------
[debug] [2019-01-24T20:53:52.704Z] Command: /usr/local/bin/node /usr/local/bin/firebase deploy --only functions --debug
[debug] [2019-01-24T20:53:52.704Z] CLI Version: 6.3.0
[debug] [2019-01-24T20:53:52.704Z] Platform: darwin
[debug] [2019-01-24T20:53:52.704Z] Node Version: v8.12.0
[debug] [2019-01-24T20:53:52.705Z] Time: Thu Jan 24 2019 21:53:52 GMT+0100 (CET)
[debug] [2019-01-24T20:53:52.705Z] ----------------------------------------------------------------------
[debug]
[debug] [2019-01-24T20:53:52.714Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2019-01-24T20:53:52.715Z] > authorizing via signed-in user
[debug] [2019-01-24T20:53:52.715Z] [iam] checking project proclubs-c0955 for permissions ["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"]
[debug] [2019-01-24T20:53:52.717Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/proclubs-c0955:testIamPermissions
[debug] [2019-01-24T20:53:53.593Z] <<< HTTP RESPONSE 200
[info]
[info] === Deploying to 'proclubs-c0955'...
[info]
[info] i deploying functions
[info] Running command: npm --prefix "$RESOURCE_DIR" run build
[info] ✔ functions: Finished running predeploy script.
[debug] [2019-01-24T20:53:58.072Z] > [functions] package.json contents: {
"name": "functions",
"scripts": {
"lint": "tslint --project tsconfig.json",
"build": "tsc",
"serve": "npm run build && firebase serve --only functions",
"shell": "npm run build && firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"main": "lib/index.js",
"dependencies": {
"@google-cloud/storage": "^2.3.1",
"@sendgrid/mail": "^6.3.1",
"@types/moment-timezone": "^0.5.8",
"@types/uuid": "^3.4.3",
"body-parser": "^1.18.3",
"cron": "^1.4.1",
"express": "^4.16.3",
"express-basic-auth": "^1.1.5",
"firebase-admin": "~5.13.0",
"firebase-functions": "^2.0.0",
"he": "^1.2.0",
"moment": "^2.22.2",
"moment-timezone": "^0.5.21",
"node-fetch": "^2.3.0",
"sendgrid": "^5.2.3",
"uuid": "^3.3.2"
},
"devDependencies": {
"@types/node": "^10.12.10",
"tslint": "~5.8.0",
"typescript": "~3.1.0"
},
"private": true
}
[info] i functions: ensuring necessary APIs are enabled...
[debug] [2019-01-24T20:53:58.073Z] >>> HTTP REQUEST GET https://servicemanagement.googleapis.com/v1/services/cloudfunctions.googleapis.com/projectSettings/proclubs-c0955?view=CONSUMER_VIEW
[debug] [2019-01-24T20:53:58.074Z] >>> HTTP REQUEST GET https://servicemanagement.googleapis.com/v1/services/runtimeconfig.googleapis.com/projectSettings/proclubs-c0955?view=CONSUMER_VIEW
[debug] [2019-01-24T20:53:59.578Z] <<< HTTP RESPONSE 200
[info] ✔ functions: all necessary APIs are enabled
[debug] [2019-01-24T20:53:59.950Z] <<< HTTP RESPONSE 200
[debug] [2019-01-24T20:53:59.950Z] >>> HTTP REQUEST GET https://cloudresourcemanager.googleapis.com/v1/projects/proclubs-c0955
[debug] [2019-01-24T20:54:00.974Z] <<< HTTP RESPONSE 200
[debug] [2019-01-24T20:54:00.974Z] >>> HTTP REQUEST GET https://mobilesdk-pa.googleapis.com/v1/projects/610036645559:getServerAppConfig
[debug] [2019-01-24T20:54:01.211Z] <<< HTTP RESPONSE 200
[info] i functions: preparing functions directory for uploading...
[debug] [2019-01-24T20:54:01.213Z] >>> HTTP REQUEST GET https://runtimeconfig.googleapis.com/v1beta1/projects/proclubs-c0955/configs
[debug] [2019-01-24T20:54:01.557Z] <<< HTTP RESPONSE 200
[info] i functions: packaged functions (175.4 KB) for uploading
[debug] [2019-01-24T20:54:02.145Z] >>> HTTP REQUEST POST https://cloudfunctions.googleapis.com/v1/projects/proclubs-c0955/locations/us-central1/functions:generateUploadUrl
[debug] [2019-01-24T20:54:02.613Z] <<< HTTP RESPONSE 200
[debug] [2019-01-24T20:54:02.614Z] >>> HTTP REQUEST PUT https://storage.googleapis.com/gcf-upload-us-central1-cb0f36f8-0c1b-42b0-aded-c432f3572975/b6afd2e6-0ff6-4956-9813-c280a9f3b825.zip?GoogleAccessId=service-610036645559@gcf-admin-robot.iam.gserviceaccount.com&Expires=1548365042&Signature=ZwDRZ4YF10QImYNMumXt184vS2J0wn4dOwEkU%2BalopAjIXe3qReabol4tTF6VYqwdcCWfZWFpIauGFzGN6cNbp1lp1MLZA6h4s5iAxP%2BlKjEONc8VaeSIX3wJsBtAVI7nKgTTP%2BOUZM0hf3BnjzDuXCaYXEiOUwdYCeN7psr1dEvyitwo80lvn8oYkbIn6Wus6xLlK2e%2Bzo6d5oGtQt8W95Iaax1Oxx08JPyvxoc31b3Bnc6e%2ByJsVw9yPNBdnGo4cA53jRhDj9xzzManAndRouXNM5dcKFGAb%2BSZsZga5D4uOVGqWNICtMgpcYFELxhLe1mXFgV1BTl8sAtJOjRnA%3D%3D
[debug] [2019-01-24T20:54:03.319Z] <<< HTTP RESPONSE 400
[debug] [2019-01-24T20:54:03.319Z] <<< HTTP RESPONSE BODY <?xml version='1.0' encoding='UTF-8'?><Error><Code>InvalidArgument</Code><Message>Invalid argument.</Message></Error>
[warn] âš functions: Upload Error: HTTP Error: 400, Unknown Error
[error]
[error] Error: HTTP Error: 400, Unknown Error
[debug] [2019-01-24T20:54:03.322Z] Error Context: {
"body": {
"error": {
"message": "Unknown Error"
}
},
"response": {
"statusCode": 400,
"body": "<?xml version='1.0' encoding='UTF-8'?><Error><Code>InvalidArgument</Code><Message>Invalid argument.</Message></Error>",
"headers": {
"x-guploader-uploadid": "AEnB2UqmpphQkiGf-amlEWdNJTeaBqT0fu-iNYpuk74pPX-FcaWyDIICLee9ovPJwWL5zPYeGbjBpGPtDcDVwC-2zaTxCMjN9Q",
"content-type": "application/xml; charset=UTF-8",
"content-length": "117",
"vary": "Origin",
"date": "Thu, 24 Jan 2019 20:54:03 GMT",
"server": "UploadServer",
"alt-svc": "quic=\":443\"; ma=2592000; v=\"44,43,39\""
},
"request": {
"uri": {
"protocol": "https:",
"slashes": true,
"auth": null,
"host": "storage.googleapis.com",
"port": 443,
"hostname": "storage.googleapis.com",
"hash": null,
"search": "?GoogleAccessId=service-610036645559@gcf-admin-robot.iam.gserviceaccount.com&Expires=1548365042&Signature=ZwDRZ4YF10QImYNMumXt184vS2J0wn4dOwEkU%2BalopAjIXe3qReabol4tTF6VYqwdcCWfZWFpIauGFzGN6cNbp1lp1MLZA6h4s5iAxP%2BlKjEONc8VaeSIX3wJsBtAVI7nKgTTP%2BOUZM0hf3BnjzDuXCaYXEiOUwdYCeN7psr1dEvyitwo80lvn8oYkbIn6Wus6xLlK2e%2Bzo6d5oGtQt8W95Iaax1Oxx08JPyvxoc31b3Bnc6e%2ByJsVw9yPNBdnGo4cA53jRhDj9xzzManAndRouXNM5dcKFGAb%2BSZsZga5D4uOVGqWNICtMgpcYFELxhLe1mXFgV1BTl8sAtJOjRnA%3D%3D",
"query": "GoogleAccessId=service-610036645559@gcf-admin-robot.iam.gserviceaccount.com&Expires=1548365042&Signature=ZwDRZ4YF10QImYNMumXt184vS2J0wn4dOwEkU%2BalopAjIXe3qReabol4tTF6VYqwdcCWfZWFpIauGFzGN6cNbp1lp1MLZA6h4s5iAxP%2BlKjEONc8VaeSIX3wJsBtAVI7nKgTTP%2BOUZM0hf3BnjzDuXCaYXEiOUwdYCeN7psr1dEvyitwo80lvn8oYkbIn6Wus6xLlK2e%2Bzo6d5oGtQt8W95Iaax1Oxx08JPyvxoc31b3Bnc6e%2ByJsVw9yPNBdnGo4cA53jRhDj9xzzManAndRouXNM5dcKFGAb%2BSZsZga5D4uOVGqWNICtMgpcYFELxhLe1mXFgV1BTl8sAtJOjRnA%3D%3D",
"pathname": "/gcf-upload-us-central1-cb0f36f8-0c1b-42b0-aded-c432f3572975/b6afd2e6-0ff6-4956-9813-c280a9f3b825.zip",
"path": "/gcf-upload-us-central1-cb0f36f8-0c1b-42b0-aded-c432f3572975/b6afd2e6-0ff6-4956-9813-c280a9f3b825.zip?GoogleAccessId=service-610036645559@gcf-admin-robot.iam.gserviceaccount.com&Expires=1548365042&Signature=ZwDRZ4YF10QImYNMumXt184vS2J0wn4dOwEkU%2BalopAjIXe3qReabol4tTF6VYqwdcCWfZWFpIauGFzGN6cNbp1lp1MLZA6h4s5iAxP%2BlKjEONc8VaeSIX3wJsBtAVI7nKgTTP%2BOUZM0hf3BnjzDuXCaYXEiOUwdYCeN7psr1dEvyitwo80lvn8oYkbIn6Wus6xLlK2e%2Bzo6d5oGtQt8W95Iaax1Oxx08JPyvxoc31b3Bnc6e%2ByJsVw9yPNBdnGo4cA53jRhDj9xzzManAndRouXNM5dcKFGAb%2BSZsZga5D4uOVGqWNICtMgpcYFELxhLe1mXFgV1BTl8sAtJOjRnA%3D%3D",
"href": "https://storage.googleapis.com/gcf-upload-us-central1-cb0f36f8-0c1b-42b0-aded-c432f3572975/b6afd2e6-0ff6-4956-9813-c280a9f3b825.zip?GoogleAccessId=service-610036645559@gcf-admin-robot.iam.gserviceaccount.com&Expires=1548365042&Signature=ZwDRZ4YF10QImYNMumXt184vS2J0wn4dOwEkU%2BalopAjIXe3qReabol4tTF6VYqwdcCWfZWFpIauGFzGN6cNbp1lp1MLZA6h4s5iAxP%2BlKjEONc8VaeSIX3wJsBtAVI7nKgTTP%2BOUZM0hf3BnjzDuXCaYXEiOUwdYCeN7psr1dEvyitwo80lvn8oYkbIn6Wus6xLlK2e%2Bzo6d5oGtQt8W95Iaax1Oxx08JPyvxoc31b3Bnc6e%2ByJsVw9yPNBdnGo4cA53jRhDj9xzzManAndRouXNM5dcKFGAb%2BSZsZga5D4uOVGqWNICtMgpcYFELxhLe1mXFgV1BTl8sAtJOjRnA%3D%3D"
},
"method": "PUT"
}
}
}
what do you mean by "removing the function"? Can you deploy any function successfully? Or do any attempts fail. If any attempts fail, can you tell us more about how you've written your functions?
Here is the screenshot of CLI

@bkendall By removing i meant deleting previously deployed function with firebase functions:delete function1-name.
No, i can't deploy any function.
The thing is, i don't have any problem of deploying same functions to my clone/test project (i use it for testing). But with my primary project, i have this problem and can't figure out why.
Based on log, i can guess that something is wrong with the service account and storage? No idea...
I'd check to make sure that service account (service-610036645559@?) exists in your project. This is going to be an issue for which you should reach out to Firebase Support as this is more account related than CLI related.
having the same issue. Unknown error is not very helpfull as a log here unfortunately. EDIT: in my case the functions folder was too big causing the deployment to fail. Removing huge files that did not belong there solved the issue for me.
Is this solved now because i am also facing same issue
Most helpful comment
having the same issue. Unknown error is not very helpfull as a log here unfortunately. EDIT: in my case the functions folder was too big causing the deployment to fail. Removing huge files that did not belong there solved the issue for me.