3
votes

I'm trying to make a firebase firestore function to send a notifications from device to device but when I deploy it I get this error in the console log.

{"@type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{"code":9,"message":"FAILED_PRECONDITION"},"authenticationInfo":{"principalEmail":"[email protected]"},"requestMetadata":{"callerIp":"156.208.116.97","callerSuppliedUserAgent":"FirebaseCLI/7.2.1,gzip(gfe),gzip(gfe)","requestAttributes":{"time":"2019-07-29T16:14:02.968Z","auth":{}},"destinationAttributes":{}},"serviceName":"cloudfunctions.googleapis.com","methodName":"google.cloud.functions.v1.CloudFunctionsService.UpdateFunction","authorizationInfo":[{"permission":"cloudfunctions.functions.update","granted":true,"resourceAttributes":{}},{"resource":"projects/pharmacy-20900/locations/us-central1/functions/sendNotification","permission":"cloudfunctions.functions.update","granted":true,"resourceAttributes":{}}],"resourceName":"projects/pharmacy-20900/locations/us-central1/functions/sendNotification","request":{"updateMask":"sourceUploadUrl,name,labels,runtime,eventTrigger.resource,eventTrigger.eventType,eventTrigger.service","@type":"type.googleapis.com/google.cloud.functions.v1.UpdateFunctionRequest","function":{"eventTrigger":{"eventType":"providers/cloud.firestore/eventTypes/document.write","resource":"projects/pharmacy-20900/databases/(default)/documents/pharmacies/{pharmacy_id}/notifications/{notification_id}","service":"firestore.googleapis.com"},"sourceUploadUrl":"https://storage.googleapis.com/gcf-upload-us-central1-0d95e983-f4fa-4c11-81b9-6e4469829392/ddcadf56-bd44-4316-a945-6736ef01c7eb.zip?GoogleAccessId=service-410106319211@gcf-admin-robot.iam.gserviceaccount.com&Expires=1564418639&Signature=ElmWD3IeTx8j%2FdJKqMOjBZ4BnZ22MUS7uiZ77xtX1lZULFtHQ0%2F4QVBU%2BIum8%2Fdrv%2BaeTNa7mjN00HZEL7eVnDlX1ogxKdDv3ZeBBfrKDDz9NWqY3M126mFT48dAVdkRDBBEMcKllQoELKgwnJK6aRyDWawYVx5O64Ybrczr3y4RlmlFxa57ZT7418HoWRgV%2FH5IlFymTYPbHTG2lbJfEN4KBrTUv0WBvYx%2BViOvwAMnq8DerXj9q6SkBXt8zSTDmUirsOWEUcsVGh6nEYvg0EWRNCiklxiQys%2BLeJvE4pSsUrs%2BwPeErOFWZd%2FeOwyojpkA617f8Yf6qHrpjrugyA%3D%3D","runtime":"nodejs8","name":"projects/pharmacy-20900/locations/us-central1/functions/sendNotification","labels":{"deployment-tool":"cli-firebase"}}}}

what this error implies?

1

1 Answers

0
votes

In my case, I could deploy successfully after deleting the existing version of the function giving the error. Maybe the cause of the error was the existing version used node 10, while the new version used node 8.