Im following a tutorial online on using express and firebase together (never used firebase before, but have worked with some express). For some reason everything seems to work when I use firebase serve or firebase emulators:start , but when I try to do a firebase deploy, it wont work. It did work the first time when I just started the project, but not anymore.
I saw one other question regarding the same error (I think he/she was following the same tutorial), but it wasn't helpful.
Console Error Displayed:
Function failed on loading user code. This is likely due to a bug in the user code. Error message: Error: please examine your function logs to see the error cause: https://cloud.google.com/functions/docs/monitoring/logging#viewing_logs.
Functions deploy had errors with the following functions:
api
Error: Functions did not deploy properly.
I added the firebase logs below. Also my repo: https://github.com/Sarman5432/SocialMediaApp/tree/master/functions.
[debug] [2020-12-19T05:48:54.719Z] ----------------------------------------------------------------------
[debug] [2020-12-19T05:48:54.722Z] Command: C:\Program Files\nodejs\node.exe C:\Users\Sarman\AppData\Roaming\npm\node_modules\firebase-tools\lib\bin\firebase.js deploy
[debug] [2020-12-19T05:48:54.722Z] CLI Version: 9.0.1
[debug] [2020-12-19T05:48:54.722Z] Platform: win32
[debug] [2020-12-19T05:48:54.722Z] Node Version: v12.14.0
[debug] [2020-12-19T05:48:54.724Z] Time: Sat Dec 19 2020 00:48:54 GMT-0500 (Eastern Standard Time)
[debug] [2020-12-19T05:48:54.724Z] ----------------------------------------------------------------------
[debug] [2020-12-19T05:48:54.724Z]
[debug] [2020-12-19T05:48:54.734Z] > 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] [2020-12-19T05:48:54.734Z] > authorizing via signed-in user
[debug] [2020-12-19T05:48:54.734Z] [iam] checking project socialmedia-5f158 for permissions ["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get","firebasehosting.sites.update"]
[debug] [2020-12-19T05:48:54.738Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/socialmedia-5f158:testIamPermissions
{"permissions":["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get","firebasehosting.sites.update"]}
[debug] [2020-12-19T05:48:55.060Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 19 Dec 2020 05:48:54 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","server-timing":"gfet4t7; dur=160","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-19T05:48:55.064Z] >>> HTTP REQUEST POST https://iam.googleapis.com/v1/projects/socialmedia-5f158/serviceAccounts/socialmedia-5f158#appspot.gserviceaccount.com:testIamPermissions
{"permissions":["iam.serviceAccounts.actAs"]}
[debug] [2020-12-19T05:48:55.365Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 19 Dec 2020 05:48:55 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-19T05:48:55.368Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects/socialmedia-5f158
[debug] [2020-12-19T05:48:55.641Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 19 Dec 2020 05:48:55 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[warn] ! functions: package.json indicates an outdated version of firebase-functions.
Please upgrade using npm install --save firebase-functions#latest in your functions directory.
[info]
[info] === Deploying to 'socialmedia-5f158'...
[info]
[info] i deploying functions, hosting
[debug] [2020-12-19T05:48:58.992Z] > [functions] package.json contents: {
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"lint": "eslint .",
"serve": "firebase emulators:start --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "12"
},
"main": "index.js",
"dependencies": {
"busboy": "^0.3.1",
"firebase-admin": "^9.2.0",
"firebase-functions": "^3.11.0"
},
"devDependencies": {
"eslint": "^5.12.0",
"eslint-plugin-promise": "^4.0.1",
"firebase-functions-test": "^0.2.0"
},
"private": true
}
[info] i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
[info] i functions: ensuring required API cloudbuild.googleapis.com is enabled...
[debug] [2020-12-19T05:49:00.832Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects/socialmedia-5f158/services/cloudfunctions.googleapis.com
[debug] [2020-12-19T05:49:00.832Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects/socialmedia-5f158/services/runtimeconfig.googleapis.com
[debug] [2020-12-19T05:49:00.832Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects/socialmedia-5f158/services/cloudbuild.googleapis.com
[debug] [2020-12-19T05:49:01.274Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 19 Dec 2020 05:49:01 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-19T05:49:01.330Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 19 Dec 2020 05:49:01 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[info] + functions: required API cloudfunctions.googleapis.com is enabled
[debug] [2020-12-19T05:49:01.341Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 19 Dec 2020 05:49:01 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[info] + functions: required API cloudbuild.googleapis.com is enabled
[debug] [2020-12-19T05:49:01.345Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects/socialmedia-5f158/adminSdkConfig
[debug] [2020-12-19T05:49:01.595Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 19 Dec 2020 05:49:01 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-19T05:49:01.601Z] >>> HTTP REQUEST POST https://firebasehosting.googleapis.com/v1beta1/sites/socialmedia-5f158/versions
{"config":{"rewrites":[{"glob":"**","path":"/index.html"}]},"labels":{"deployment-tool":"cli-firebase"}}
[debug] [2020-12-19T05:49:02.410Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 19 Dec 2020 05:49:02 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[info] i functions: preparing functions directory for uploading...
[debug] [2020-12-19T05:49:02.413Z] >>> HTTP REQUEST GET https://runtimeconfig.googleapis.com/v1beta1/projects/socialmedia-5f158/configs
[debug] [2020-12-19T05:49:02.918Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 19 Dec 2020 05:49:02 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-19T05:49:02.920Z] >>> HTTP REQUEST GET https://runtimeconfig.googleapis.com/v1beta1/projects/socialmedia-5f158/configs/api/variables
[debug] [2020-12-19T05:49:03.261Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 19 Dec 2020 05:49:03 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-19T05:49:03.264Z] >>> HTTP REQUEST GET https://runtimeconfig.googleapis.com/v1beta1/projects/socialmedia-5f158/configs/api/variables/meaurementid
[debug] [2020-12-19T05:49:03.265Z] >>> HTTP REQUEST GET https://runtimeconfig.googleapis.com/v1beta1/projects/socialmedia-5f158/configs/api/variables/messagingsenderid
[debug] [2020-12-19T05:49:03.265Z] >>> HTTP REQUEST GET https://runtimeconfig.googleapis.com/v1beta1/projects/socialmedia-5f158/configs/api/variables/appid
[debug] [2020-12-19T05:49:03.266Z] >>> HTTP REQUEST GET https://runtimeconfig.googleapis.com/v1beta1/projects/socialmedia-5f158/configs/api/variables/key
[debug] [2020-12-19T05:49:03.464Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 19 Dec 2020 05:49:03 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-19T05:49:03.737Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 19 Dec 2020 05:49:03 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-19T05:49:03.743Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 19 Dec 2020 05:49:03 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-19T05:49:03.745Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 19 Dec 2020 05:49:03 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[info] i functions: packaged functions (47.16 KB) for uploading
[debug] [2020-12-19T05:49:04.508Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/projects/socialmedia-5f158/locations/-/functions
[debug] [2020-12-19T05:49:04.983Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 19 Dec 2020 05:49:04 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-19T05:49:04.988Z] >>> HTTP REQUEST POST https://cloudfunctions.googleapis.com/v1/projects/socialmedia-5f158/locations/us-central1/functions:generateUploadUrl
[debug] [2020-12-19T05:49:05.674Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 19 Dec 2020 05:49:05 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-19T05:49:05.676Z] >>> HTTP REQUEST PUT https://storage.googleapis.com/gcf-upload-us-central1-962ccae0-e24e-4d88-b0a2-d16db2e20c76/5cf7c6db-376e-483f-8e0b-ff8032a6a9b2.zip?GoogleAccessId=service-98194542320#gcf-admin-robot.iam.gserviceaccount.com&Expires=1608358745&Signature=ZfN05IUBG8tORoQvu67AzWLhLV01cC2C2PKWNe2yNYnhASSn6moWJ6wBzNdHp7mjjP7N3iJraaeTC8Vn7FEXSJ3yi1Zn4QLzGExoi8aiWDH%2BH6AxHLSYqEzhGa6YeqJIxIgCJTg2PxjoQkirf8TwNl5Ugo4intWpfmTQx%2F1a%2BsIJ6y5Y%2Bhvi9tpAVWXGGzrs0BDrGTF1Q4VTIdh72VA3t880RuH5rea%2BtrukA97EIfj6LzKRnRahdGZPcQESJ02Zy4jiXhurO1ifYHKTeAl2ifYbWxGVZBUUqiAYQoS%2F4EMF2%2FwNvUU0PGI4MjRFgYiJzUHcXUB%2FBmUivelQ5il4fw%3D%3D
<request body omitted>
[debug] [2020-12-19T05:49:06.038Z] <<< HTTP RESPONSE 200 {"x-guploader-uploadid":"ABg5-UzFi8fOApFhGG39w-A4SDe0GEI1RNC22-bc1BFAJ_pyTixewDMTCF_vHTnd_0o5K_YJwSsEJxXyr-X2jmI3tbqGXyO1YA","etag":"\"144ab95f99b5aca6b19fa25003cc63f1\"","x-goog-generation":"1608356945967446","x-goog-metageneration":"1","x-goog-hash":"crc32c=X2x8dQ==, md5=FEq5X5m1rKaxn6JQA8xj8Q==","x-goog-stored-content-length":"48292","x-goog-stored-content-encoding":"identity","vary":"Origin","content-length":"0","date":"Sat, 19 Dec 2020 05:49:05 GMT","server":"UploadServer","content-type":"text/html; charset=UTF-8","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""}
[info] + functions: functions folder uploaded successfully
[info] i hosting[socialmedia-5f158]: beginning deploy...
[info] i hosting[socialmedia-5f158]: found 1 files in public
[debug] [2020-12-19T05:49:06.065Z] > refreshing access token with scopes: []
[debug] [2020-12-19T05:49:06.065Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token
<request body omitted>
[debug] [2020-12-19T05:49:06.068Z] [hosting] hash cache [cHVibGlj] stored for 1 files
[debug] [2020-12-19T05:49:06.068Z] [hosting][hash queue][FINAL] {"max":3,"min":3,"avg":3,"active":0,"complete":1,"success":1,"errored":0,"retried":0,"total":1,"elapsed":7}
[debug] [2020-12-19T05:49:06.229Z] <<< HTTP RESPONSE 200 {"pragma":"no-cache","date":"Sat, 19 Dec 2020 05:49:06 GMT","cache-control":"no-cache, no-store, max-age=0, must-revalidate","expires":"Mon, 01 Jan 1990 00:00:00 GMT","content-type":"application/json; charset=utf-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","server":"scaffolding on HTTPServer2","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-19T05:49:06.243Z] >>> [apiv2][query] POST https://firebasehosting.googleapis.com/v1beta1/sites/socialmedia-5f158/versions/7cac918590bf79d0:populateFiles [none]
[debug] [2020-12-19T05:49:06.244Z] >>> [apiv2][body] POST https://firebasehosting.googleapis.com/v1beta1/sites/socialmedia-5f158/versions/7cac918590bf79d0:populateFiles {"files":{"/index.html":"9cf85a1fb57e777006bcf68ba0de7b72871e96c0e7ce7b72ec2267f46c5b04aa"}}
[debug] [2020-12-19T05:49:06.609Z] <<< [apiv2][status] POST https://firebasehosting.googleapis.com/v1beta1/sites/socialmedia-5f158/versions/7cac918590bf79d0:populateFiles 200
[debug] [2020-12-19T05:49:06.609Z] <<< [apiv2][body] POST https://firebasehosting.googleapis.com/v1beta1/sites/socialmedia-5f158/versions/7cac918590bf79d0:populateFiles {"uploadRequiredHashes":["9cf85a1fb57e777006bcf68ba0de7b72871e96c0e7ce7b72ec2267f46c5b04aa"],"uploadUrl":"https://upload-firebasehosting.googleapis.com/upload/sites/socialmedia-5f158/versions/7cac918590bf79d0/files"}
[debug] [2020-12-19T05:49:06.610Z] >>> [apiv2][query] POST https://upload-firebasehosting.googleapis.com/upload/sites/socialmedia-5f158/versions/7cac918590bf79d0/files/9cf85a1fb57e777006bcf68ba0de7b72871e96c0e7ce7b72ec2267f46c5b04aa [none]
[debug] [2020-12-19T05:49:06.610Z] >>> [apiv2][body] POST https://upload-firebasehosting.googleapis.com/upload/sites/socialmedia-5f158/versions/7cac918590bf79d0/files/9cf85a1fb57e777006bcf68ba0de7b72871e96c0e7ce7b72ec2267f46c5b04aa [stream]
[debug] [2020-12-19T05:49:06.611Z] [hosting][populate queue][FINAL] {"max":546,"min":546,"avg":546,"active":0,"complete":1,"success":1,"errored":0,"retried":0,"total":1,"elapsed":547}
[debug] [2020-12-19T05:49:06.611Z] [hosting] uploads queued: 1
[debug] [2020-12-19T05:49:07.406Z] <<< [apiv2][status] POST https://upload-firebasehosting.googleapis.com/upload/sites/socialmedia-5f158/versions/7cac918590bf79d0/files/9cf85a1fb57e777006bcf68ba0de7b72871e96c0e7ce7b72ec2267f46c5b04aa 200
[debug] [2020-12-19T05:49:07.406Z] <<< [apiv2][body] POST https://upload-firebasehosting.googleapis.com/upload/sites/socialmedia-5f158/versions/7cac918590bf79d0/files/9cf85a1fb57e777006bcf68ba0de7b72871e96c0e7ce7b72ec2267f46c5b04aa [stream]
[debug] [2020-12-19T05:49:07.406Z] [hosting][upload queue][FINAL] {"max":797,"min":797,"avg":797,"active":0,"complete":1,"success":1,"errored":0,"retried":0,"total":1,"elapsed":797}
[info] + hosting[socialmedia-5f158]: file upload complete
[debug] [2020-12-19T05:49:07.408Z] [hosting] deploy completed after 1359ms
[info] i functions: updating Node.js 12 function api(us-central1)...
[debug] [2020-12-19T05:49:07.691Z] Trigger is: {"httpsTrigger":{}}
[debug] [2020-12-19T05:49:07.695Z] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"]
[debug] [2020-12-19T05:49:07.695Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token
<request body omitted>
[debug] [2020-12-19T05:49:07.862Z] <<< HTTP RESPONSE 200 {"pragma":"no-cache","date":"Sat, 19 Dec 2020 05:49:07 GMT","expires":"Mon, 01 Jan 1990 00:00:00 GMT","cache-control":"no-cache, no-store, max-age=0, must-revalidate","content-type":"application/json; charset=utf-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","server":"scaffolding on HTTPServer2","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-19T05:49:07.874Z] >>> HTTP REQUEST PATCH https://cloudfunctions.googleapis.com/v1/projects/socialmedia-5f158/locations/us-central1/functions/api {"updateMask":"sourceUploadUrl,name,labels,runtime,environmentVariables,httpsTrigger"}
{"sourceUploadUrl":"https://storage.googleapis.com/gcf-upload-us-central1-962ccae0-e24e-4d88-b0a2-d16db2e20c76/5cf7c6db-376e-483f-8e0b-ff8032a6a9b2.zip?GoogleAccessId=service-98194542320#gcf-admin-robot.iam.gserviceaccount.com&Expires=1608358745&Signature=ZfN05IUBG8tORoQvu67AzWLhLV01cC2C2PKWNe2yNYnhASSn6moWJ6wBzNdHp7mjjP7N3iJraaeTC8Vn7FEXSJ3yi1Zn4QLzGExoi8aiWDH%2BH6AxHLSYqEzhGa6YeqJIxIgCJTg2PxjoQkirf8TwNl5Ugo4intWpfmTQx%2F1a%2BsIJ6y5Y%2Bhvi9tpAVWXGGzrs0BDrGTF1Q4VTIdh72VA3t880RuH5rea%2BtrukA97EIfj6LzKRnRahdGZPcQESJ02Zy4jiXhurO1ifYHKTeAl2ifYbWxGVZBUUqiAYQoS%2F4EMF2%2FwNvUU0PGI4MjRFgYiJzUHcXUB%2FBmUivelQ5il4fw%3D%3D","name":"projects/socialmedia-5f158/locations/us-central1/functions/api","labels":{"deployment-tool":"cli-firebase"},"httpsTrigger":{},"runtime":"nodejs12","environmentVariables":{"FIREBASE_CONFIG":"{\"projectId\":\"socialmedia-5f158\",\"databaseURL\":\"https://socialmedia-5f158-default-rtdb.firebaseio.com\",\"storageBucket\":\"socialmedia-5f158.appspot.com\",\"locationId\":\"us-central\"}"}}
[debug] [2020-12-19T05:49:08.338Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 19 Dec 2020 05:49:08 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-19T05:49:08.339Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/projects/socialmedia-5f158/locations/-/functions
[debug] [2020-12-19T05:49:08.755Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 19 Dec 2020 05:49:08 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-19T05:49:08.758Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c29jaWFsbWVkaWEtNWYxNTgvdXMtY2VudHJhbDEvYXBpL0ZhX21RTDdVNlgw
[debug] [2020-12-19T05:49:08.925Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 19 Dec 2020 05:49:08 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-19T05:49:10.929Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c29jaWFsbWVkaWEtNWYxNTgvdXMtY2VudHJhbDEvYXBpL0ZhX21RTDdVNlgw
[debug] [2020-12-19T05:49:39.903Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 19 Dec 2020 05:49:39 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-19T05:49:41.904Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c29jaWFsbWVkaWEtNWYxNTgvdXMtY2VudHJhbDEvYXBpL0ZhX21RTDdVNlgw
[debug] [2020-12-19T05:49:42.073Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 19 Dec 2020 05:49:42 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
functions: package.json indicates an outdated version of firebase-functions.
Attempt to update firebase-function via the npm package manager to start with.
Secondly functions on Firebase will require a Blaze Plan due to cloud building, please ensure this is enabled - I would highly recommend setting an alert for pricing if this is a small personal project.
Please also ensure you're using Node12 in your package.json file as previous versions of Node will no longer work with Firebase in the future (read something about this while having the same issue). Just to clarify as far as I'm aware deploying Node12 code also requires a Blaze Plan.
Finally ensure that you have modularised your project by calling multiple different versions of app, you can do this by creating a new express instance, for example: const someEndpoints1 = express() + const someEndpoints2 = express() then routing accordingly; as having multiple routes under one app caused this issue for me.
Please let me know if this fixed any issues and / or you are getting an alternative output.
I am using Firebase realtime database. I want to delete a node which has huge records. So i can not delete with normal ways. When i try to delete with using rest, i can not do that. Default setting is "large". I have to set defaultWriteSizeLimit to "unlimited".
$firebase database:settings:set defaultWriteSizeLimit unlimited --instance <dbname>
When i execute above code, i receive an error message.
"Error: Unexpected error fetching configs at defaultWriteSizeLimit"
Below is firebase-debug.log:
[debug] [2020-12-09T09:24:13.317Z] ----------------------------------------------------------------------
[debug] [2020-12-09T09:24:13.318Z] Command: /usr/local/lib/node_modules/firebase-tools/lib/bin/firebase.js /Users/emrekhan/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/bin/firebase database:settings:set defaultWriteSizeLimit unlimited --instance dbname
[debug] [2020-12-09T09:24:13.318Z] CLI Version: 8.17.0
[debug] [2020-12-09T09:24:13.318Z] Platform: darwin
[debug] [2020-12-09T09:24:13.318Z] Node Version: v12.18.1
[debug] [2020-12-09T09:24:13.319Z] Time: Wed Dec 09 2020 12:24:13 GMT+0300 (GMT+03:00)
[debug] [2020-12-09T09:24:13.319Z] ----------------------------------------------------------------------
[debug] [2020-12-09T09:24:13.319Z]
[debug] [2020-12-09T09:24:13.322Z] > 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] [2020-12-09T09:24:13.323Z] > authorizing via signed-in user
[debug] [2020-12-09T09:24:13.324Z] [iam] checking project dbname for permissions ["firebase.projects.get","firebasedatabase.instances.update"]
[debug] [2020-12-09T09:24:13.325Z] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"]
[debug] [2020-12-09T09:24:13.325Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token
<request body omitted>
[debug] [2020-12-09T09:24:13.668Z] <<< HTTP RESPONSE 200 {"date":"Wed, 09 Dec 2020 09:24:14 GMT","expires":"Mon, 01 Jan 1990 00:00:00 GMT","pragma":"no-cache","cache-control":"no-cache, no-store, max-age=0, must-revalidate","content-type":"application/json; charset=utf-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","server":"scaffolding on HTTPServer2","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-09T09:24:13.682Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/dbname:testIamPermissions
{"permissions":["firebase.projects.get","firebasedatabase.instances.update"]}
[debug] [2020-12-09T09:24:14.782Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Wed, 09 Dec 2020 09:24:15 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","server-timing":"gfet4t7; dur=768","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-09T09:24:14.783Z] >>> HTTP REQUEST GET https://firebasedatabase.googleapis.com/v1beta/projects/dbname/locations/-/instances/dbname
[debug] [2020-12-09T09:24:15.499Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Wed, 09 Dec 2020 09:24:16 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-09T09:24:15.501Z] > refreshing access token with scopes: []
[debug] [2020-12-09T09:24:15.501Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token
<request body omitted>
[debug] [2020-12-09T09:24:15.766Z] <<< HTTP RESPONSE 200 {"date":"Wed, 09 Dec 2020 09:24:16 GMT","cache-control":"no-cache, no-store, max-age=0, must-revalidate","expires":"Mon, 01 Jan 1990 00:00:00 GMT","pragma":"no-cache","content-type":"application/json; charset=utf-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","server":"scaffolding on HTTPServer2","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-09T09:24:15.780Z] >>> [apiv2][query] PUT https://dbname.firebaseio.com/.settings/defaultWriteSizeLimit.json [none]
[debug] [2020-12-09T09:24:15.780Z] >>> [apiv2][body] PUT https://dbname.firebaseio.com/.settings/defaultWriteSizeLimit.json "unlimited"
[debug] [2020-12-09T09:24:16.568Z] <<< [apiv2][status] PUT https://dbname.firebaseio.com/.settings/defaultWriteSizeLimit.json 400
[debug] [2020-12-09T09:24:16.568Z] <<< [apiv2][body] PUT https://dbname.firebaseio.com/.settings/defaultWriteSizeLimit.json {"error":"defaultWriteSizeLimit should be one of {\"large\", \"medium\", \"small\", \"unlimited\"}"}
[debug] [2020-12-09T09:24:16.907Z] FirebaseError: HTTP Error: 400, defaultWriteSizeLimit should be one of {"large", "medium", "small", "unlimited"}
at module.exports (/Users/emrekhan/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/responseToError.js:38:12)
at Client.<anonymous> (/Users/emrekhan/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/apiv2.js:191:27)
at Generator.next (<anonymous>)
at fulfilled (/Users/emrekhan/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/apiv2.js:5:58)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
[error]
[error] Error: Unexpected error fetching configs at defaultWriteSizeLimit
I was able to fix this problem for myself by patching firebase-tools: in database/settings.js I replaced line 23 with return JSON.stringify(input) and updated the setting successfully.
This has also been reported to Firebase Tools Issues on Github and fixed and merged today in this Pull Request
I assume we can expect a version bump on firebase-tools and then running
firebase database:settings:set defaultWriteSizeLimit unlimited
should work after updating to the latest version.