Firebase cloud functions paypal works on localhost but not server - firebase

So I have created a node server in firebase cloud functions and I have integrated PayPal-node-sdk. The problem is the Paypal payment works in firebase emulator mode which is localhost. but when I make "firebase deploy" and I enter the URL. it doesn't proceed and gives an error.
this is the code for now
const functions = require('firebase-functions');
var paypal = require('paypal-rest-sdk');
paypal.configure({
'mode': 'sandbox', //sandbox or live
'client_id': 'ARsx8xed9TXkfOaRqh3WkeG-uzeFqT0qebkrJKssZkmBh1TWoC1ZYXpzNr8TlBDygpROnAkA8pXVmhl2',
'client_secret': 'SECRET_KEY'
});
exports.helloWorld = functions.https.onRequest((request, response) => {
var create_payment_json = {
"intent": "sale",
"payer": {
"payment_method": "paypal"
},
"redirect_urls": {
"return_url": "http://return.url",
"cancel_url": "http://cancel.url"
},
"transactions": [{
"item_list": {
"items": [{
"name": "item",
"sku": "item",
"price": "1.00",
"currency": "USD",
"quantity": 1
}]
},
"amount": {
"currency": "USD",
"total": "1.00"
},
"description": "This is the payment description."
}]
};
paypal.payment.create(create_payment_json, function (error, payment) {
if (error) {
throw error;
} else {
console.log("Create Payment Response");
console.log(payment);
for (var index = 0; index < payment.links.length; index++) {
//Redirect user to this endpoint for redirect url
if (payment.links[index].rel === 'approval_url') {
console.log(payment.links[index].href);
response.redirect(payment.links[index].href);
}
}
}
});
});
This is the package.json
{
"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": {
"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
}
This how it looks in localhost and works perfectly fine
And this is how it displays in the server
enter image description here
What could be the problem here?
Log file:
[2020-11-28T20:38:09.374Z] > 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"]
[2020-11-28T20:38:09.375Z] > authorizing via signed-in user
[2020-11-28T20:38:09.376Z] [iam] checking project safedine-66679 for permissions ["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"]
[2020-11-28T20:38:09.379Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/safedine-66679:testIamPermissions
{"permissions":["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"]}
[2020-11-28T20:38:10.364Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:09 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","server-timing":"gfet4t7; dur=625","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"}
[2020-11-28T20:38:10.366Z] >>> HTTP REQUEST POST https://iam.googleapis.com/v1/projects/safedine-66679/serviceAccounts/safedine-66679#appspot.gserviceaccount.com:testIamPermissions
{"permissions":["iam.serviceAccounts.actAs"]}
[2020-11-28T20:38:11.304Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:10 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"}
=== Deploying to 'safedine-66679'...
i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint
> functions# lint C:\Users\e7cd\Documents\safedinecloudfunctions\functions
> eslint .
+ functions: Finished running predeploy script.
[2020-11-28T20:38:15.476Z] > [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": {
"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
}
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i functions: ensuring required API cloudbuild.googleapis.com is enabled...
[2020-11-28T20:38:16.873Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects/safedine-66679/services/cloudfunctions.googleapis.com
[2020-11-28T20:38:16.873Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects/safedine-66679/services/runtimeconfig.googleapis.com
[2020-11-28T20:38:16.874Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects/safedine-66679/services/cloudbuild.googleapis.com
[2020-11-28T20:38:18.073Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:17 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"}
[2020-11-28T20:38:18.102Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:17 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: required API cloudbuild.googleapis.com is enabled
[2020-11-28T20:38:18.147Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:17 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: required API cloudfunctions.googleapis.com is enabled
[2020-11-28T20:38:18.150Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects/safedine-66679/adminSdkConfig
[2020-11-28T20:38:18.628Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:18 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"}
i functions: preparing functions directory for uploading...
[2020-11-28T20:38:18.630Z] >>> HTTP REQUEST GET https://runtimeconfig.googleapis.com/v1beta1/projects/safedine-66679/configs
[2020-11-28T20:38:19.072Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:18 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"}
i functions: packaged functions (37.56 KB) for uploading
[2020-11-28T20:38:19.249Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/projects/safedine-66679/locations/-/functions
[2020-11-28T20:38:19.983Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:19 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"}
[2020-11-28T20:38:19.984Z] >>> HTTP REQUEST POST https://cloudfunctions.googleapis.com/v1/projects/safedine-66679/locations/us-central1/functions:generateUploadUrl
[2020-11-28T20:38:20.811Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:20 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"}
[2020-11-28T20:38:20.812Z] >>> HTTP REQUEST PUT https://storage.googleapis.com/gcf-upload-us-central1-d8bc2486-f64e-4507-b510-b1d84696c343/d0b11078-1545-4bd6-b169-c922d3f11142.zip?GoogleAccessId=service-884835345747#gcf-admin-robot.iam.gserviceaccount.com&Expires=1606597700&Signature=ai0sX4ZEVHlv%2Fj%2Fmgkmc1YtZIHT4XuRU8PvtmonlUGYl5tSJU%2FTfms%2Fyqe9ul0H5hGs7%2FtgwFpbmU1o5rW1HwK4QWZzUIDjkkuS%2BSRowqjzhAFIdJfjDeHpMstXHFZu%2Buwe%2FQPvckIGRalK78kz%2FSLeRphET%2FLMLLqii1iPWpquKdEkQpnSc3wqR0OgxBP6RdGUidJrHlelukJNcB3FH0WruaWgRDfEQkSLLqJ5dINzNssh%2BYpT4LZ6kyhUV0Jk%2F4FJkHroRKP7YhGhw2m0eoPqNRKnwn2qb8vNpff8mZ4OKPN5ANT0yvmEFxLRe6szJl2T7H3f78PsR2WsM84XTFw%3D%3D
<request body omitted>
[2020-11-28T20:38:21.339Z] <<< HTTP RESPONSE 200 {"x-guploader-uploadid":"ABg5-UxNRqvU0vC4ykLP7YdMfyT3wIFx_-8bUO_CoHXy43oH0kXgZIq_mDiQ0F9pqPALaXL0pb3RIY4kxpdk7vIDvg","etag":"\"db38e2617f8e5abfd2e3331528f86eb7\"","x-goog-generation":"1606595900834314","x-goog-metageneration":"1","x-goog-hash":"crc32c=CS+02g==, md5=2zjiYX+OWr/S4zMVKPhutw==","x-goog-stored-content-length":"38464","x-goog-stored-content-encoding":"identity","vary":"Origin","content-length":"0","date":"Sat, 28 Nov 2020 20:38:20 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\""}
+ functions: functions folder uploaded successfully
i functions: updating Node.js 12 function helloWorld(us-central1)...
[2020-11-28T20:38:21.347Z] Trigger is: {"httpsTrigger":{}}
i functions: updating Node.js 12 function success(us-central1)...
[2020-11-28T20:38:21.348Z] Trigger is: {"httpsTrigger":{}}
[2020-11-28T20:38:21.350Z] >>> HTTP REQUEST PATCH https://cloudfunctions.googleapis.com/v1/projects/safedine-66679/locations/us-central1/functions/helloWorld {"updateMask":"sourceUploadUrl,name,labels,runtime,environmentVariables,httpsTrigger"}
{"sourceUploadUrl":"https://storage.googleapis.com/gcf-upload-us-central1-d8bc2486-f64e-4507-b510-b1d84696c343/d0b11078-1545-4bd6-b169-c922d3f11142.zip?GoogleAccessId=service-884835345747#gcf-admin-robot.iam.gserviceaccount.com&Expires=1606597700&Signature=ai0sX4ZEVHlv%2Fj%2Fmgkmc1YtZIHT4XuRU8PvtmonlUGYl5tSJU%2FTfms%2Fyqe9ul0H5hGs7%2FtgwFpbmU1o5rW1HwK4QWZzUIDjkkuS%2BSRowqjzhAFIdJfjDeHpMstXHFZu%2Buwe%2FQPvckIGRalK78kz%2FSLeRphET%2FLMLLqii1iPWpquKdEkQpnSc3wqR0OgxBP6RdGUidJrHlelukJNcB3FH0WruaWgRDfEQkSLLqJ5dINzNssh%2BYpT4LZ6kyhUV0Jk%2F4FJkHroRKP7YhGhw2m0eoPqNRKnwn2qb8vNpff8mZ4OKPN5ANT0yvmEFxLRe6szJl2T7H3f78PsR2WsM84XTFw%3D%3D","name":"projects/safedine-66679/locations/us-central1/functions/helloWorld","labels":{"deployment-tool":"cli-firebase"},"httpsTrigger":{},"runtime":"nodejs12","environmentVariables":{"FIREBASE_CONFIG":"{\"projectId\":\"safedine-66679\",\"databaseURL\":\"https://safedine-66679.firebaseio.com\",\"storageBucket\":\"safedine-66679.appspot.com\"}"}}
[2020-11-28T20:38:21.351Z] >>> HTTP REQUEST PATCH https://cloudfunctions.googleapis.com/v1/projects/safedine-66679/locations/us-central1/functions/success {"updateMask":"sourceUploadUrl,name,labels,runtime,environmentVariables,httpsTrigger"}
{"sourceUploadUrl":"https://storage.googleapis.com/gcf-upload-us-central1-d8bc2486-f64e-4507-b510-b1d84696c343/d0b11078-1545-4bd6-b169-c922d3f11142.zip?GoogleAccessId=service-884835345747#gcf-admin-robot.iam.gserviceaccount.com&Expires=1606597700&Signature=ai0sX4ZEVHlv%2Fj%2Fmgkmc1YtZIHT4XuRU8PvtmonlUGYl5tSJU%2FTfms%2Fyqe9ul0H5hGs7%2FtgwFpbmU1o5rW1HwK4QWZzUIDjkkuS%2BSRowqjzhAFIdJfjDeHpMstXHFZu%2Buwe%2FQPvckIGRalK78kz%2FSLeRphET%2FLMLLqii1iPWpquKdEkQpnSc3wqR0OgxBP6RdGUidJrHlelukJNcB3FH0WruaWgRDfEQkSLLqJ5dINzNssh%2BYpT4LZ6kyhUV0Jk%2F4FJkHroRKP7YhGhw2m0eoPqNRKnwn2qb8vNpff8mZ4OKPN5ANT0yvmEFxLRe6szJl2T7H3f78PsR2WsM84XTFw%3D%3D","name":"projects/safedine-66679/locations/us-central1/functions/success","labels":{"deployment-tool":"cli-firebase"},"httpsTrigger":{},"runtime":"nodejs12","environmentVariables":{"FIREBASE_CONFIG":"{\"projectId\":\"safedine-66679\",\"databaseURL\":\"https://safedine-66679.firebaseio.com\",\"storageBucket\":\"safedine-66679.appspot.com\"}"}}
[2020-11-28T20:38:21.859Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:21 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"}
[2020-11-28T20:38:21.878Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:21 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"}
[2020-11-28T20:38:21.879Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/projects/safedine-66679/locations/-/functions
[2020-11-28T20:38:22.523Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:22 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"}
[2020-11-28T20:38:22.524Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvaGVsbG9Xb3JsZC96d2NJV29QNllQdw
[2020-11-28T20:38:22.525Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvc3VjY2Vzcy9CNnR2Z3ktWmRtUQ
[2020-11-28T20:38:22.900Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:22 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"}
[2020-11-28T20:38:22.904Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:22 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"}
[2020-11-28T20:38:24.911Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvc3VjY2Vzcy9CNnR2Z3ktWmRtUQ
[2020-11-28T20:38:24.911Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvaGVsbG9Xb3JsZC96d2NJV29QNllQdw
[2020-11-28T20:38:27.684Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:27 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"}
[2020-11-28T20:38:29.703Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvc3VjY2Vzcy9CNnR2Z3ktWmRtUQ
[2020-11-28T20:38:30.061Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:29 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"}
[2020-11-28T20:38:30.086Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:29 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"}
[2020-11-28T20:38:32.074Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvaGVsbG9Xb3JsZC96d2NJV29QNllQdw
[2020-11-28T20:38:32.089Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvc3VjY2Vzcy9CNnR2Z3ktWmRtUQ
[2020-11-28T20:38:32.461Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:32 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"}
[2020-11-28T20:38:32.462Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:32 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"}
[2020-11-28T20:38:34.473Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvc3VjY2Vzcy9CNnR2Z3ktWmRtUQ
[2020-11-28T20:38:34.474Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvaGVsbG9Xb3JsZC96d2NJV29QNllQdw
[2020-11-28T20:38:34.838Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:34 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"}
[2020-11-28T20:38:34.854Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:34 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"}
[2020-11-28T20:38:36.841Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvc3VjY2Vzcy9CNnR2Z3ktWmRtUQ
[2020-11-28T20:38:36.856Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvaGVsbG9Xb3JsZC96d2NJV29QNllQdw
[2020-11-28T20:38:37.211Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:36 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"}
[2020-11-28T20:38:37.217Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38:36 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"}
[2020-11-28T20:38:39.212Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvc3VjY2Vzcy9CNnR2Z3ktWmRtUQ
[2020-11-28T20:38:39.228Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvaGVsbG9Xb3JsZC96d2NJV29QNllQdw
[2020-11-28T20:38:39.582Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38: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"}
[2020-11-28T20:38:39.590Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:38: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"}
[2020-11-28T20:38:41.583Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvaGVsbG9Xb3JsZC96d2NJV29QNllQdw
[2020-11-28T20:39:22.100Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/c2FmZWRpbmUtNjY2NzkvdXMtY2VudHJhbDEvaGVsbG9Xb3JsZC96d2NJV29QNllQdw
[2020-11-28T20:39:24.854Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Sat, 28 Nov 2020 20:39:24 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[success(us-central1)]: Deployment error.
Function failed on loading 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. Additional troubleshooting documentation can be found at https://cloud.google.com/functions/docs/troubleshooting#logging
Functions deploy had errors with the following functions:
helloWorld
success
To try redeploying those functions, run:
firebase deploy --only "functions:helloWorld,functions:success"
To continue deploying other features (such as database), run:
firebase deploy --except functions
Error: Functions did not deploy properly.
C:\Users\e7cd\Documents\safedinecloudfunctions>
Log from the firebase console
3:13:13.689 am
helloWorld
Error: function terminated. Recommended action: inspect logs for termination reason. Additional troubleshooting documentation can be found at https://cloud.google.com/functions/docs/troubleshooting#logging Function invocation was interrupted.
helloWorld
Error: function terminated. Recommended action: inspect logs for termination reason. Additional troubleshooting documentation can be found at https://cloud.google.com/functions/docs/troubleshooting#logging Function invocation was interrupted.
3:13:48.825 am
helloWorld
Function execution started
3:13:49.144 am
helloWorld
Provided module can't be loaded.

From
https://github.com/paypal/PayPal-node-SDK#usage:
Add dependency 'paypal-rest-sdk' in your package.json file.
This is one reason why your function would not start.
Given that you shared your paypal access credentials publicly I strongly suggest you generate new pair and deactivate the ones you included.

Related

How to perform a multipart upload with Google Drive REST API v3

I'm trying to make an https request to upload a file by following the guide https://developers.google.com/drive/api/v3/manage-uploads#multipart . This is what I try to send:
POST https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart&key=AIz...Q4 HTTP/1.1\r\n
Authorization: Bearer ya...8A\r\n
Content-Type: multipart/related; boundary=foo_bar_baz\r\n
Content-Length: 150\r\n
\r\n
--foo_bar_baz\n
Content-Type: application/json; charset=UTF-8\n
\n
{\n
"title": "My File.jpg"\n
}\n
\n
--foo_bar_baz\n
Content-Type: text/txt\n
\n
JPEG data\n
--foo_bar_baz--\r\n
Could you tell me what I'm wrong or a working example? Thank you
UPDATE:
Ok, after several attempts I was able to find a correct https request, for example:
POST https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart&key=AI...qeQ4 HTTP/1.1\r\n
Authorization: Bearer yaSN...Q9Q\r\n
Content-Type: multipart/related; boundary=foo_bar_baz\r\n
Content-Length: 167\r\n
\r\n
--foo_bar_baz\n
Content-Type: application/json; charset=UTF-8\n
\n
{\n
"name": "My File.txt"\n
}\n
--foo_bar_baz\n
Content-Type: text/plain; charset=UTF-8\n
\n
aaaaa\n
--foo_bar_baz--
with reply:
HTTP/1.1 200 OK\r\n
X-GUploader-UploadID: ABg...lRCA\r\n
Vary: Origin\r\n
Vary: X-Origin\r\n
Content-Type: application/json; charset=UTF-8\r\n
Cache-Control: no-cache, no-store, max-age=0, must-revalidate\r\n
Pragma: no-cache\r\n
Expires: Mon, 01 Jan 1990 00:00:00 GMT\r\n
Date: Thu, 11 Feb 2021 17:37:39 GMT\r\n
Content-Length: 121\r\n
Server: UploadServer\r\n
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"\r\n
\r\n
{\n
"kind": "drive#file",\n
"id": "1_SE...8X",\n
"name": "My File.txt",\n
"mimeType": "text/plain"\n
}\n
I need to set the correct body length, otherwise the server returns an error.
The user UPDATE is the answer
Ok, after several attempts I was able to find a correct https request, for example:
POST https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart&key=AI...qeQ4 HTTP/1.1\r\n
Authorization: Bearer yaSN...Q9Q\r\n
Content-Type: multipart/related; boundary=foo_bar_baz\r\n
Content-Length: 167\r\n
\r\n
--foo_bar_baz\n
Content-Type: application/json; charset=UTF-8\n
\n
{\n
"name": "My File.txt"\n
}\n
--foo_bar_baz\n
Content-Type: text/plain; charset=UTF-8\n
\n
aaaaa\n
--foo_bar_baz--
with reply:
HTTP/1.1 200 OK\r\n
X-GUploader-UploadID: ABg...lRCA\r\n
Vary: Origin\r\n
Vary: X-Origin\r\n
Content-Type: application/json; charset=UTF-8\r\n
Cache-Control: no-cache, no-store, max-age=0, must-revalidate\r\n
Pragma: no-cache\r\n
Expires: Mon, 01 Jan 1990 00:00:00 GMT\r\n
Date: Thu, 11 Feb 2021 17:37:39 GMT\r\n
Content-Length: 121\r\n
Server: UploadServer\r\n
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"\r\n
\r\n
{\n
"kind": "drive#file",\n
"id": "1_SE...8X",\n
"name": "My File.txt",\n
"mimeType": "text/plain"\n
}\n
I need to set the correct body length, otherwise the server returns an error.

Deploying Firebase (Web) Fails but emulators work. "Function failed on loading user code"

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.

How to Perform Large Deletes in the Firebase Realtime Database

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.

Firebase checking deployed files

When I run firebase deploy command, I would like to know which files are deployed.
I tried firebase deploy --debug, but I don't see any information about uploaded files.
[2018-05-25T09:48:26.423Z] ----------------------------------------------------------------------
[2018-05-25T09:48:26.426Z] Command: /usr/local/bin/node /usr/local/bin/firebase deploy --debug
[2018-05-25T09:48:26.427Z] CLI Version: 3.18.4
[2018-05-25T09:48:26.427Z] Platform: darwin
[2018-05-25T09:48:26.427Z] Node Version: v9.2.0
[2018-05-25T09:48:26.428Z] Time: Fri May 25 2018 11:48:26 GMT+0200 (CEST)
[2018-05-25T09:48:26.428Z] ----------------------------------------------------------------------
[2018-05-25T09:48:26.439Z] > 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"]
[2018-05-25T09:48:26.440Z] > authorizing via signed-in user
[2018-05-25T09:48:26.441Z] > 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"]
[2018-05-25T09:48:26.442Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token
{ refresh_token: '1/sNSNg7xxbzwVujBEzRAQ2eZHkEuT0d6A2jVVUGa-e9Jgrc8NASizU4RK7MEmNnov',
client_id: '563584335869-fgrhgmd47bqnekij5i8b5pr03ho849e6.apps.googleusercontent.com',
client_secret: 'j9iVZfS8kkCEFUPaAeJV0sAi',
grant_type: 'refresh_token',
scope: 'email https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloudplatformprojects.readonly https://www.googleapis.com/auth/firebase openid' }
Fri May 25 2018 11:48:26 GMT+0200 (CEST)
[2018-05-25T09:48:26.585Z] <<< HTTP RESPONSE 200 cache-control=no-cache, no-store, max-age=0, must-revalidate, pragma=no-cache, expires=Mon, 01 Jan 1990 00:00:00 GMT, date=Fri, 25 May 2018 09:48:26 GMT, vary=X-Origin, Origin,Accept-Encoding, content-type=application/json; charset=UTF-8, x-content-type-options=nosniff, x-frame-options=SAMEORIGIN, x-xss-protection=1; mode=block, server=GSE, alt-svc=hq=":443"; ma=2592000; quic=51303433; quic=51303432; quic=51303431; quic=51303339; quic=51303335,quic=":443"; ma=2592000; v="43,42,41,39,35", accept-ranges=none, connection=close
[2018-05-25T09:48:26.593Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/test-table
Fri May 25 2018 11:48:26 GMT+0200 (CEST)
[2018-05-25T09:48:27.222Z] <<< HTTP RESPONSE 200 server=nginx, date=Fri, 25 May 2018 09:48:27 GMT, content-type=application/json; charset=utf-8, content-length=141, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store
[2018-05-25T09:48:27.223Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/database/test-table/tokens
Fri May 25 2018 11:48:27 GMT+0200 (CEST)
[2018-05-25T09:48:27.777Z] <<< HTTP RESPONSE 200 server=nginx, date=Fri, 25 May 2018 09:48:27 GMT, content-type=application/json; charset=utf-8, content-length=274, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store
=== Deploying to 'test-table'...
i deploying hosting
i hosting: preparing dist directory for upload...
[2018-05-25T09:48:28.900Z] >>> HTTP REQUEST PUT https://deploy.firebase.com/v1/hosting/test-table/uploads/-LDLglCdzpfzQK77Fbrb?fileCount=2&message=
Fri May 25 2018 11:48:28 GMT+0200 (CEST)
Uploading: [ ] 0%[2018-05-25T09:48:32.752Z] <<< HTTP RESPONSE 200 server=nginx, date=Fri, 25 May 2018 09:48:32 GMT, content-type=application/json; charset=utf-8, content-length=49, connection=close, access-control-allow-origin=*, access-control-allow-methods=GET, PUT, POST, DELETE, OPTIONS, strict-transport-security=max-age=31556926; includeSubDomains; preload, x-content-type-options=nosniff
[2018-05-25T09:48:32.753Z] [hosting] .tgz uploaded successfully, waiting for extraction
✔ hosting: 2 files uploaded successfully
[2018-05-25T09:48:33.642Z] [hosting] deploy completed after 5190ms
[2018-05-25T09:48:33.643Z] >>> HTTP REQUEST POST https://deploy.firebase.com/v1/projects/test-table/releases
{ hosting:
{ public: 'dist',
ignore: [ 'firebase.json', '**/.*', '**/node_modules/**' ],
version: '-LDLglCdzpfzQK77Fbrb',
prefix: '-LDLglCdzpfzQK77Fbrb/',
manifest: [] } }
Fri May 25 2018 11:48:33 GMT+0200 (CEST)
[2018-05-25T09:48:34.951Z] <<< HTTP RESPONSE 200 server=nginx, date=Fri, 25 May 2018 09:48:34 GMT, content-type=application/json; charset=utf-8, content-length=34, connection=close, access-control-allow-origin=*, access-control-allow-methods=GET, PUT, POST, DELETE, OPTIONS, strict-transport-security=max-age=31556926; includeSubDomains; preload, x-content-type-options=nosniff
✔ Deploy complete!
The only information the Firebase CLI shows is:
i hosting: preparing dist directory for upload...
So this means that everything in your dist directory is deployed, and nothing else.
Since the files are uploaded as a single .tgz file, there is no progress report for individual files.

Why is Mule HTTP PollingConnector returning 403 Forbidden Error when trying to read some RSS feeds

I'm trying to pull an RSS feed with Mule Studio. I can view this feed in the browser using an RSS feeder and using CURL but I can't do it with the Mule application. This Mule application works with other RSS feeds so I don't understand why I would be receiving a 403 Forbidden error for this feed.
This is my Mule flow XML
<http:polling-connector name="PollingHttpConnector" pollingFrequency="60000" doc:name="HTTP Polling" clientSoTimeout="10000" cookieSpec="netscape" receiveBacklog="0" receiveBufferSize="0" sendBufferSize="0" serverSoTimeout="10000" socketSoLinger="0" validateConnections="true"/>
<flow name="mondavi" doc:name="mondavi">
<http:inbound-endpoint exchange-pattern="one-way" doc:name=" " address="http://www.theaggie.org/feed/" connector-ref="PollingHttpConnector" encoding="UTF-8"/>
<logger message=" #[header:INBOUND:http.version] #[header:INBOUND:http.method] #[header:INBOUND:http.request] " level="INFO" category="mule.http.accesslog" doc:name="Logger"/>
<component class="edu.ucdavis.edustream.esb.news.rss.OrigFeedSplitter" doc:name="Java"/>
<foreach doc:name="For Each">
<component class="edu.ucdavis.edustream.esb.news.rss.EntryReceiver" doc:name="Java"/>
<logger level="INFO" doc:name="Logger"/>
<http:outbound-endpoint exchange-pattern="request-response" host="${edus.host}" port="${edus.port}" path="api/v1/activity" method="POST" mimeType="application/json" doc:name="HTTP"/>
</foreach>
</flow>
Here is the response from the successful CURL request, only requesting the header:
HTTP/1.1 200 OK
Date: Fri, 12 Jul 2013 19:06:51 GMT
Server: Apache
Set-Cookie: PHPSESSID=l0eg8e93ihb3r65plms64l84f7; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
X-Pingback: http://www.theaggie.org/xmlrpc.php
Last-Modified: Fri, 12 Jul 2013 03:37:00 GMT
ETag: "556af474b6fdedb235c46e19926f69db"
Content-Type: text/html; charset=UTF-8
http://www.theaggie.org/feed/ rejects HTTP GETs when the user agent is "Jakarta Commons-HttpClient/3.1", which is what Mule uses.
$ curl -I -H "User-Agent: Jakarta Commons-HttpClient/3.1" http://www.theaggie.org/feed/
HTTP/1.1 403 Forbidden
Date: Fri, 12 Jul 2013 19:27:20 GMT
Server: Apache
Status: 403 Forbidden
Connection: Close
Content-Type: text/html; charset=UTF-8

Resources