Questions tagged [google-cloud-functions]

Google Cloud Functions is a lightweight, event-based, asynchronous compute solution that allows you to create small, single-purpose functions written in Node.js, Python or Go that respond to cloud events without the need to manage a server or a runtime environment.

Google Cloud Functions is a lightweight, event-based, asynchronous compute solution that allows you to create small, single-purpose functions written in or that respond to cloud events without the need to manage a server or a runtime environment.

Related tags:

12970 questions
36
votes
6 answers

How to test `functions.https.onCall` firebase cloud functions locally?

I can't seem to find the solution for this in the Firebase Documentation. I want to test my functions.https.onCall functions locally. Is it possible using the shell or somehow connect my client (firebase SDK enabled) to the local server? I want to…
czphilip
  • 777
  • 1
  • 6
  • 16
36
votes
12 answers

How to perform an HTTP file upload using express on Cloud Functions for Firebase (multer, busboy)

I am trying to upload a file to Cloud Functions, using Express to handle requests there, but i am not succeeding. I created a version that works locally: serverside js const express = require('express'); const cors = require('cors'); const…
Eindbaas
  • 835
  • 1
  • 8
  • 15
35
votes
12 answers

Firebase Callable Function + CORS

I'm trying to call a callable Cloud Function from my app, but I'm facing CORS issues. I can't enable Cors since I don't have access to the request and response on the onCall function. This is my function: exports.UserInvitation =…
Pietro Coelho
  • 1,216
  • 1
  • 17
  • 32
35
votes
2 answers

FieldValue undefined when using functions and Firestore

I have the following function: const functions = require('firebase-functions'); const admin = require('firebase-admin'); const FieldValue = require('firebase-admin').FieldValue; module.exports = functions.firestore …
35
votes
6 answers

Firebase cloud function deploy error

irregularly my firebase deployment get stuck at this log: i functions: updating function [FUNCTION NAME]... After canceling the deploy and retrying it throws the following error message: ⚠ functions: failed to update function resetBadgeCount ⚠ …
Florian
  • 373
  • 1
  • 3
  • 5
35
votes
4 answers

Set timeout for Cloud Functions for Firebase does not persist in the Console; is this a bug?

Update: I updated the question, to reflect what I described in the body of the question, and what was happening at the time. It also justifies why I did not mark Sanyam's response as correct. There was a bug in the Console that was causing the…
Lindauson
  • 2,213
  • 1
  • 21
  • 28
34
votes
2 answers

Google Cloud Functions Python Logging issue

I'm not sure how to say this but, I'm feeling like there is something under the hood that was changed by Google without me knowing about it. I used to get my logs from my python Cloud Functions in the Google Cloud Console within the logging…
34
votes
2 answers

Firestore Add value to array field

Im trying to use Firebase cloud functions to add the id of a chatroom to the users document in an array field. I cant seem to figure out the way to write to an array field type. here is my cloud function exports.updateMessages =…
34
votes
2 answers

Getting the user id from a database trigger in Cloud Functions for Firebase?

In the example below, is there a way to get the uid of the user who wrote to /messages/{pushId}/original? exports.makeUppercase = functions.database.ref('/messages/{pushId}/original') .onWrite(event => { // Grab the current value of what was…
34
votes
1 answer

Write temporary files from Google Cloud Function

Can I write to the container's local filesystem from a Google Cloud Function? AWS Lambda allows writing to /tmp: Q: What if I need scratch space on disk for my AWS Lambda function? Each Lambda function receives 500MB of non-persistent disk space…
Trevor Dixon
  • 17,772
  • 8
  • 66
  • 100
33
votes
1 answer

Function killed. Error: quota exceeded

Im working with Firebase's cloud functions on the Spark Plan. I'm using a cronJob to invoke a function every 2 min. I have recently gotten this error: Function killed. Error: quota exceeded When trying to deploy I get a similar error: Deploy…
huddie96
  • 1,140
  • 1
  • 10
  • 24
32
votes
1 answer

Firebase Cloud Functions - slow response when querying Firestore

I have a simple Cloud Function in Firebase that takes JSON in an http POST and saves it to a Firestore collection. It's allocated 512MB memory. The performance of this cloud function is very poor. If executed continuously, the round trip varies from…
32
votes
3 answers

Firebase configuration for multiple projects/environments

I'm using Cloud Functions for Firebase with three different projects for development, testing and production purposes. Each project has a service-account.json. When I deploy the sources to an environment, the initialization looks like this: var…
user7930645
  • 321
  • 3
  • 3
31
votes
1 answer

Firebase cloud functions using Python?

We are using GCP's Firebase with Firestore for a new mobile app we are developing. As part of this effort we need to deploy a number of cloud functions which will act as Firestore triggers for doing some back end processing. Our intention is to…
31
votes
3 answers

How to make an HTTP request in Cloud Functions for Firebase?

I am trying to make a call to apples receipt verification server using Cloud Functions for Firebase. Any idea how to make an HTTP call?