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.

Filter by
Sorted by
Tagged with
-2 votes
0 answers
19 views

My swiftui app isnt making successful requests to my firebase cloud functions server to process payments with stripe

I am new to back end development and struggling to make a request to my firebase cloud function to allow me to process payments in my ecomm app. [firebase cloud functions code](https://i.stack.imgur....
0 votes
0 answers
10 views

Save email text attachment to firestore database with http endpoint trigger

This is a lot but I've been struggling trying to get this to work for the last few days now and hitting a brick wall. In a nutshell. Every few hours I receive an email that contains a text document. I ...
  • 297
0 votes
0 answers
11 views

Firebase Cloud Functions in Golang

Is it possible to write Firebase Cloud Functions in Golang such that they can access Firebase services such as Firestore and Storage, in both production and emulators? Ideally I would like to have a ...
0 votes
0 answers
28 views

GCP assign organization policy to all except one sub-folder

How to assign organization policy to in google cloud to assign a role at folder level to all sub folders except one folder.
0 votes
0 answers
7 views

Google Cloud Function terminated with "response error" intermittently when using Node.js - Express Framework and returning small amounts of data

I have a Google Cloud Function built with Node.js and the Express framework that is triggered by a Cloud Pub/Sub topic. The function reads messages from the topic and performs some processing before ...
0 votes
0 answers
17 views

Call to Firebase function does not set local __session cookie as expected

I understand that firebase strip by default all cookies except the __session cookie. Therefore I built the following function for login: app.post("/login", async (req, res) => { // ...
0 votes
1 answer
21 views

messages delayed from cloud functions to flutter

I create message document from api to firestore. I create a new message to phoneNumber's subscriber/{phoneNumber}/sites/{sitesId}/messages collection. Then my app display snackbar when create a new ...
  • 29
1 vote
1 answer
29 views

Make authenticated request from React to Express api deployed in Firebse function

I had very simple Firebase authentication in a React app export const register = async ( email: string, password: string, ) => { try { return await createUserWithEmailAndPassword(auth, ...
0 votes
0 answers
25 views

CORS error when creating checkout session in Stripe

I am developing using stripe. I created a checkout session, but got the error below. How can I resolve this? Access to fetch at 'https://xxx.cloudfunctions.net/createCheckoutSession' from origin 'http:...
  • 1,083
1 vote
1 answer
26 views

Dynamic Import Error Firebase Cloud Functions Typescript

im trying to make a flutter app that uses flutter cloud functions as the backend. Whenever I try to npm run serve I get this issue... has anyone seen this before? Im new to cloud functions but it ...
0 votes
0 answers
14 views

Firebase Cloud Function returns wrong value

The current firebase function logs the correct value for id_token just before the return statement. But the function returns not that value, but an empty array. Here's the function: exports.getIdToken ...
0 votes
0 answers
21 views

*** Error compiling './__MACOSX/._request.py' [Google Cloud]

I'm trying to use Cloud Function in gcloud but i get this error Build failed: *** Error compiling './__MACOSX/._request.py'... and i cannot understand why I'm getting this. (btw I'm very new to ...
0 votes
0 answers
30 views

How to call a HTTPS function that has timeout of 1hour from a function triggered by cloud storage which has a timeout of 9min

I have a 1st gen function that runs whenever a file is created in the cloud storage. Currently I've set the timeoutSeconds to the max allowed which is 540s. But the function sometimes times out when ...
0 votes
0 answers
15 views

Firebase Functions Request Body is Empty

I'm trying to make a POST request within a firebase function. Everything works fine when using Postman, but after integrating it into a cloud function, I'm getting the following error (code 400): ...
0 votes
0 answers
6 views

Environment variables from .secret.local not loading when using functions emulator

Functions emulators is not loading environment variables from .secret.local. It only works for .env.local. I'm working with Windows 11, Node.js v18.15.0 and firebase-tools v11.25.1. I have logged in ...
1 vote
0 answers
36 views

I m Not Able to Create any Function on gcp ? Firebase Deploy function error

Firebase Deploy Fails. Coz "HTTP Error: 400, Could not create Cloud Run service ssrjivayuhomeopathyclinic. spec.template.spec.containers.resources.limits.cpu: Invalid value specified for cpu. For ...
0 votes
1 answer
18 views

Firebase Cloud functions - Is there a good way to get the first two documents created in a collection?

I am working on a React-Native app that utilizes cloud functions to monitor users who join a room. When a user clicks on the join room button, they are added to a collection as a document and wait for ...
  • 3
0 votes
1 answer
30 views

Schedule firestore document deletion on document create or update

So I have an application that allow users to create events with their friends, they can specify the time and duration of the event. What I want to do is that I want to delete the firestore document ...
0 votes
0 answers
23 views

Firebase Trigger Email Stuck at Processing or Fails with ssl3_get_record: wrong version

I'm trying to set up trigger emails through Firebase. I've read other Stackoverflow posts which led me to 1) enable SMTP authentication within my mailbox settings 2) try changing the port to 587 to ...
  • 55
0 votes
1 answer
25 views

In an yearly subscription how should I update users credits every month?

I have an app where I give users 30,000 credits at every monthly subscription or renewal. Now I want to introduce an yearly subscription but instead of giving 360,000 credits at the purchase event of ...
0 votes
0 answers
11 views

Cannot read properties of undefined (reading 'id') in cloud function

when i change on firestore the function print error Cannot read properties of undefined (reading 'id') in cloud function logs i write a cloud function with node js to get the nearest deliveryboy when ...
1 vote
2 answers
45 views

I cannot run firebase emulators on fresh install. Getting ' SyntaxError: Unexpected string: re"use strict"; '

I followed the tutorial to set up Firebase Functions with Typescript at https://firebase.google.com/docs/functions/typescript However, when I run npm run serve or firebase emulators:start, emulators ...
2 votes
1 answer
38 views

Is there a way to restart running instances of Firebase Functions (GCloud Functions) without redeploying?

In production, I'd like to be able to allow a Firebase / GCloud administrator to restart Firebase Function (GCloud Function) instances without having to perform a redeployment. Use cases include ...
  • 21.3k
0 votes
0 answers
28 views

How can I use Cloud Functions to bypass Firestore Cloud security rules if I'm using custom authentication?

I'm not using Firebase Auth, instead AWS Amplify Cognito for my Flutter mobile app. How can I bypass the security rules with Cloud Functions to still have secure access to Cloud Firestore? request....
  • 21
0 votes
0 answers
13 views

Trying to create chat functionality in my android studio project using Firebase database, " Cannot resolve sender id in my item view type" appears

Everything works fine but android studio don't seem recognize my Message Model class Below is the message adapter class and the it throws error on senderId How to do it right so as message model class ...
2 votes
2 answers
62 views

How to sync custom claim token using Firebase Auth

I want to make Firestore's rule using Firebase custom token like this. match /post/{postId}{ allow create: if request.auth.token[role] == `admin`; allow read: if request.auth.token[role] =...
  • 35
0 votes
0 answers
9 views

Is there way to restart managed instance group vm one by one automatically every 30 mins

I have a managed instance group on gcp on that group we have 2 vm's instances running , I just need to restart these instances one at a time every 30 mins , so is there any way so that it can restart ...
  • 1
-1 votes
1 answer
34 views

New error but no code changes! - TypeError: '<=' not supported

I am an inexperienced developer cobbling things together but no deep knowledge and I have come unstuck! I have a Google Cloud Function running some code that uses pdfmier.six to extract content from a ...
0 votes
1 answer
37 views

What are the drawbacks of deploying an API to Firebase Cloud Functions?

On the 1st of December, 2022 Firebase announced 2nd Generation Cloud Functions for Firebase. According to the article, each instance of a 2nd-gen function can handle multiple requests, unlike their ...
  • 5,952
0 votes
0 answers
23 views

How to control the build steps google's functions framework locally before publishing to cloud build and cloud functions

i am trying to use google's functions framework to develop a typescript based http function. My project also uses a private NPM repository. Generally when we deploy a cloud function with functions ...
-1 votes
1 answer
29 views

Does creating a Express server in Google Cloud functions or AWS lambda extend the function lifetime forever (till timeout)?

I see multiple usecases of hosting a web server inside Cloud Functions. GCP by itself provides HTTP triggers and functions framework. And cloud functions are supposed to ephemeral, meaning they must ...
0 votes
1 answer
28 views

Error scheduling automatic Firestore backup

I've followed the steps here https://firebase.google.com/docs/firestore/solutions/schedule-export to create an scheduled function to backup my firestore database. I'm getting an error in the logs ...
0 votes
0 answers
23 views

Error when testing pipeline: download data from sftp folder, parse it as json, update airtable records

I am trying to set a pipeline, where the scripts are stored in Google Cloud, and lately, use CloudScheduler in order to execute each x minutes. The pipeline, accesses a sftp remote folder and ...
  • 3
0 votes
0 answers
21 views

why my axios request to cloud function turn into 404 error?

I am send a post request to google cloud function and it turn into 404 error : [AxiosError: Request failed with status code 404] I've tried to edit my code more than 2 times , but i get the same ...
1 vote
1 answer
17 views

Firebase cloud functions onCreate took 3 minutes

Below is Cloud functions code and functions log with Timestamp , it took 3 minutes of time to update in FireStore table, I was trying with change of Node JS runtime 16 to 10 , But still took long to ...
  • 151
1 vote
1 answer
44 views

Firebase Cloud Functions to write to Firestore when creating a FirebaseAuth user

TLDR How can I create a user in FirebaseAuth and then automatically write a user document to Firestore 1) without running the risk that an unfortunately timed network error on the frontend leading to ...
0 votes
0 answers
26 views

Unable to validate callback URL and verify token for Meta's WhatsApp Cloud API with Google Cloud Function

I'm trying to set up a webhook in my Google Cloud Function that can receive incoming messages from the WhatsApp Business API and forward them to platform called Front. However, when configuring the ...
0 votes
0 answers
47 views

How to prevent enroll same phone number?

I am working on this for a week just can't figure this out, My goal is prevent abuser use same phone number as second-factor to create mutiple account, But beforeSignIn doesn't get called when enroll ...
  • 1,050
0 votes
2 answers
29 views

Google cloud functions trigger to load data into big query table from storage

I am trying to create event based trigger using google cloud function which will load data from storage to biquery, however I am getting url not found error those its there into code and the bucket ...
  • 1,759
0 votes
0 answers
38 views

Functions Framework giving "Provided code is not a loadable module. Could not load the function, shutting down."

I have a Google Cloud Function I've developed. The main.py and requirements.txt file are both in a folder called "hello". Here's the entirety of my main.py file: import functions_framework ...
-1 votes
0 answers
15 views

google cloud update function not allowing trigger signals

I have 2 different functions active on google cloud. 1 is working correctly as usual while the 2nd function has been showing this message for the past few days "cloud function update function&...
-5 votes
0 answers
23 views

What is the cheapest GCP service for the Jobs that mostly sleeps? [closed]

I have an job that could run 1 minute to 2-hours. However the most of the time is spent during sleep when waiting for the API rate limit to reset. I know that Cloud Run don't charge when there isn't ...
0 votes
1 answer
41 views

Set a custom requirements.txt for a Cloud Function

I have several functions in the same main.py of a unique repo, each of them being deployed on GCP Cloud Function like that: gcloud functions deploy func1 --entry-point=my_function_1 gcloud functions ...
  • 135
-3 votes
0 answers
24 views

How to test Firebase HTTP onRequest Cloud Function using Jest

I have a Firebase HTTP onRequest Function in typescript. I want to add a unit test using the jest framework. Example code: const functions = require('firebase-functions'); const admin = require('...
0 votes
1 answer
19 views

How to change counters in multiple docs in firebase efficiently?

I am currently learning firebase & I wanted to create an e-commerce website. I have a collection "products" and it contains products with fields name, price & quantity. What I want ...
0 votes
0 answers
34 views

How to use image-magick (or similar) in google cloud function (java runtime)

I am trying to use image-magick in a google cloud function (java17 runtime) and all tutorials (including official ones) instruct you to just use the command 'convert' and it will work out of the box. ...
0 votes
0 answers
36 views

Implementing custom 2FA with Firebase Blocking Functions

Firebase with identity platform supports 2FA out of the box with an sms. There is not much progress on supporting other 2FA methods so we want to implement our own. Using Blocking Functions we let the ...
  • 2,922
0 votes
0 answers
40 views

firebase is charging me even though I am not exceeded the usage limit

I am using the firebase blaze plan for using cloud functions. I never exceeded the usage limit. But It is still charging me. And every day it stacking. My app is not published. So, Only I am using for ...
0 votes
1 answer
22 views

Deploy Firebase Functions from multiple Repos without deleting them

I have multiple firebase functions in a repo that belongs to a service and therefore we've them within that repo. Apart from those firebase functions we also have another ones living in other repos ...
0 votes
1 answer
32 views

How to use Firebase Functions with service accounts in GitHub actions?

I followed the instructions in this tutorial in order to initialize firebase-admin with environment variables, instead of hard-coded service account keys. I added an .env file and placed my service ...
  • 5,952

1
2 3 4 5
339