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.

0
votes
0answers
2 views

“413 Request Entity Too Large” with Firebase Cloud-Functions when passing a 6KB string

i'm using firebase cloud functions http triggers. it's working fine except when i send a large JSON object (about 6KB) i get this error: and i have a string i want to pass it like this: response....
0
votes
1answer
22 views

Cannot get req.path and req.query.abc with firebase functions

I'm trying to get the request query params and url in firebase functions. Here is the code I'm using firebase.json { "hosting": { "public": "build", "rewrites": [{ "...
1
vote
1answer
24 views

Url from getSignedUrl will expire in few weeks

I've got storage trigger function which resize and replace uploaded image into storage and then update URL in my database }).then(() => { console.log('Original file deleted', filePath) ...
0
votes
2answers
18 views

What exactly is “source” in the context of Firebase rewrites?

I've read the Firebase documents and watched other tutorials multiple times and none of them explicitly explained what source was. so in Layman's terms, what exactly is source in the context of the ...
2
votes
1answer
21 views

How to send a list as a parameter to Firebase Functions in Flutter?

I would like to know, how to send or post a list (of maps) using the Cloud Functions Plugin for Flutter. I have some maps like these: var customer1 = {'name':'tom','lastname':'smith'}; var ...
0
votes
1answer
15 views

Credential system for Firebase Custom Auth System Using Cloud Functions

Scenario: I want to create an android app which uses username and password for authentication. I decided to use firebase custom auth for that purpose. From my android app, I am calling a firebase ...
1
vote
2answers
19 views

Firestore Cloud Function - How to read params from url

I need to extract the params from http url in firestore cloud function, HTTP URL https://us-central-xxxxxxxxxxx.cloudfunctions.net/somefunction?name=ABC&age=80 Firestore Cloud function export ...
0
votes
1answer
14 views

I'm using cloud-functions-emulator, 1 Param is OK, but 2 Param?

I'm trying to use cloud-functions-emulator, When I try to call with 1 Parameter, like functions call auth --data {\"token\":\"1234ssss\"} everythings fine, but When I try to call with 2 Param, like ...
1
vote
1answer
18 views

wait until trigger is fired on firebase in ionic-angular

In my ionic app I am calling a Firebase Authentication trigger in Cloud Functions, which creates a Stripe customer. When the Stripe customer is created it stores customer id to Firebase Realtime ...
0
votes
0answers
20 views

I wrote code exactly as shown from a Firebase tutorial and it doesn't work

so here's the tutorial that I watched: https://www.youtube.com/watch?v=LOeioOKUKI8&t=865s basically I'm trying to do local hosting of a webpage through Firebase and it keeps failing and this is ...
0
votes
1answer
20 views

Firebase is not picking up my index.js located in functions folder

I want to make sure if Firebase automatically hosts whatever html file is in "Public" folder located in my root directory and if it can't find that, it will host whatever is sitting inside "functions" ...
0
votes
0answers
13 views

Error when testing Firestore online with Jest: “Auth error:TypeError: fetch is not a function”

I am trying to test Cloud Firestore with Jest, but have the following error. const admin = require('firebase-admin'); const serviceAccount = require("../../../config/YOUR-PROJECT-NAME-firebase-...
1
vote
0answers
15 views

Do a debounce with Firebase Functions

I sorta wish to make something like this with firebase functions but slower. So I write to the realtime DB and after some minutes it will set to false. This is my attempt: const debounce = require('...
0
votes
0answers
10 views

os.tmpdir() not working as expected when testing Firebase Functions LOCALLY

Operating System: Mac OSX-MOJAVE Expected Outcome: I am testing my firebase cloud function LOCALLY using firebase functions:shell and here is what my code should do: 1) Download a pdf file from ...
2
votes
1answer
15 views

How to use Firebase scheduled functions in Cloud functions inline editor?

I'm looking to make a basic scheduled function for firebase, however I'm using the inline editor on Cloud Functions. For now I'm just testing the basic example they provided in the docs: const ...
0
votes
2answers
22 views

How to clean temporary files in Firebase Cloud Functions

I'm trying to process two different images with the same name (and this is not exchangeable) with cloud functions. The function is triggered to process only a image and the same happend for the ...
0
votes
0answers
11 views

how to upload the following histogram to bucket without saving it on disk, to then use in a Cloud Function?

Hello since I am designing one python cloud function to plot a histogram from a csv stored in a bucket, I tried as follows: def plot(event, context): client = storage.Client() csv = client....
0
votes
2answers
31 views

Why does cloud functions return ‘Optional()’ with the value

I have a function to check wether an email is in use or not, here’s the code for the function: import * as functions from 'firebase-functions' import * as admin from 'firebase-admin' admin....
0
votes
1answer
37 views

How can I get the params from a “get request” in a firebase function?

I know the request param in a firebase https.onRequest corresponds to a Express response. I want to run the cloud function using this format (local testing): http://localhost:5000/test-2c6e8/us-...
0
votes
0answers
32 views

Call Firebase cloud function via GET and return parameters

I have created this cloud function: exports.returnUid = functions.https.onRequest(async(req, res) => { const uid = req.query.uid res.send(uid) }); When I call https://<project>....
0
votes
2answers
21 views

Google Cloud Function JS Error: Cannot convert undefined or null to object

I have deployed the following JavaScript Google Cloud Function which sends a notification to a device triggered by the .onCreate call. The function seems to be working fine but I am getting the ...
0
votes
1answer
8 views

Is it possible to detect when a node module is running as a Google Cloud Function?

Is there any way to check if a node function/module is running as a Google Cloud Function other than setting an environment variable via the console and checking for that?
1
vote
1answer
32 views

How do I calculate average points scored by a team with a Firebase API resource in a React App?

I'm trying to build a React app to calculate the average points scored of the Raptors basketball team in in it's last N home games. Assuming that I'm using fetch (url) in the componentDidMount method ...
0
votes
0answers
29 views

Subscribe user to a plan using Stripe, Google Cloud Functions and Swift works, but

I have implemented the following solution to subscribe a user to a plan which works 99% of the time. The problem is that from time-to-time the app displays an error message even though the user has ...
1
vote
0answers
23 views

How do I create a dev and prod instance of the same cloud function using serverless?

I have a Cloud Function named getVendors that is deployed using serverless. I need to create both a dev and production instance of the same function. When I deploy using the dev variable in my yml ...
0
votes
0answers
15 views

Getting calculated result from BigQuery immediately after stream inserting data?

I have a firestore-based app where users can vote on various questions. The app is then saving the vote to a firestore collection. At the same time, we want to display real time (live updating) ...
1
vote
1answer
21 views

Module 'express' is not listed as dependency in package.json

I am getting Module 'express' is not listed as dependency in package.json when executing firebase deploy in the terminal. When tapping on the link next to it it takes me to this part of my code: ...
0
votes
1answer
34 views

Firebase nodejs serve error “AssertionError [ERR_ASSERTION]: missing path”

Getting below error message after issuing command "firebase serve --only functions,hosting" ! AssertionError [ERR_ASSERTION]: missing path at Module.require (module.js:594:3) at require (...
0
votes
0answers
17 views

TypeError: handler is not a function using Firebase and DialogFlow with Google Actions

I keep getting this error message in Firebase functions/logs dialogflowFirebaseFulfillment TypeError: handler is not a function at cloudFunction (/srv/node_modules/firebase-functions/lib/...
0
votes
1answer
27 views

Emulating Firebase Database Trigger Function Error: the service “firebaseio.com” is not yet supported

UPDATE: SOLVED! The firebase-tools npm package needed updating to the latest version. I am trying to emulate/test my cloud function (specifically a database trigger) using Firebase's firebase ...
0
votes
1answer
21 views

Why Cloud function URL (Firebase) is publicly accessible? How to restrict access to specific external call? [duplicate]

I am using Firebase in order to send push notification, Firestore database to store user informations and notification send and a cloud function which will interact with external API call in order to ...
0
votes
2answers
26 views

Read files from Cloud Storage having definite prefix but random postfix

I am using the following code to read the contents of a file in Google Cloud Storage from Cloud Functions. Here the name of file (filename) is defined. I now have files that will have a definite ...
0
votes
0answers
22 views

Firebase express.js put/patch function

Hello I'm having a problem with setting up a put/patch request function with express.js to update a value in the firebase real time database. I have post and get functions with similar that work ...
1
vote
1answer
30 views

how to handle root path request with node.js on firebase hosting?

I'm developing web system using firebase hosting + functions. Inspite of specifying rewrite rules on firebase.json, a part of routing doesn't work. root/  ├ functions/  │ ├index.js  │ ├routes/  │ │...
-1
votes
0answers
10 views

Watch mode for cloud functions logs

My task is somehow watch for new updates in logs locally. I've looked for something like watch mode for cloud function logs: gcloud functions logs read MyFunctionNmae --watch. Or firebase functions:...
0
votes
1answer
29 views

When to use Firebase cloud functions

I have a Flutter app with Firestore backend. I set up a cloud function to use Stripe payment. But I am a bit confused about cloud functions - should I only be using it only when I need to react to a ...
0
votes
0answers
16 views

Speeding up Python Firebase Cloud Function [on hold]

I have setup a HTTP triggered Firebase / Google Cloud Function written in Python. However, the function takes quite a long time to run, usually around 8-9 seconds. I don't really think this is cold ...
0
votes
1answer
28 views

Firebase Google Cloud Function call external endpoint

I'm trying to have a Google Cloud Function that invokes an external API. I'm on the Blaze plan, so I should be able to make external invocations. I have an Express app and these test routes: app.get('...
0
votes
0answers
60 views

i functions: Your functions could not be parsed due to an issue with your node_modules (see above)

In relation to this question I am trying to firebase emulators:start but I get the bellow output. Which when I type and press enter does nothing now. i Starting emulators: ["functions"] ⚠ Your ...
0
votes
1answer
50 views

How can I quickly test firebase functions

I am working with Typescript on firebase functions. As I have been developing I have found it very difficult to test (or experiment) with the code. I am using the Lint plugin so at leased I see the ...
0
votes
0answers
15 views

How to upgrade a firebase cloud function code to version 1.0 or higher

I was trying to Push Notification on real time database change using firebase cloud functions , I searched the web to learn how to do it then I found a code on how to do it , I tried to upload the ...
0
votes
1answer
21 views

How to deploy express app on firebase hosting

I have built an express app and the folder structure is below. Then i created firebase init hosting on a dummy folder and copied the firebase.json and .firebase files I created index.js file ...
0
votes
0answers
11 views

Set different cache control(s-maxage) on the same url based on different query params

I have a couple of questions about setting cache on firebase hosting. I am trying to set cache-control on a cloud function url which is accessed through firebase hosting. 1) If the url has different ...
1
vote
1answer
15 views

Is there any way to view a DataProc cluster's 'scheduled deletion' property in Python?

I'm writing a cloud function that basically iterates over all our DataProc clusters and alerts us when they don't have a scheduled deletion policy. As I understand it this can be viewed in the CLI ...
0
votes
0answers
27 views

Google uid null when creating custom token with Functions

I’m creating a custom token with Firebase Functions. The method I’m using: exports.generateUserToken = functions.https.onCall((data, context) => { const uid = context.auth.uid; const ...
1
vote
1answer
28 views

How do I iterate over ALL DataProc clusters in a GCP project in Python?

I'm trying to create a google cloud function that iterates over all currently running DataProc clusters, however the dataproc.list_functions() method requires the region be passed in as a parameter. ...
0
votes
0answers
11 views

ValueError Exception is raised for a definition which was working fine earlier

I have some deployed functions in Google Cloud Functions. They were working fine so far, but now ValueError exception is raised. What can be the reason? I have tried to rearrange the code without the ...
0
votes
1answer
42 views

Cloud Function deletes node instantly instead of after two hours based off timestamp (delete-old-child-nodes not working)

I am trying to implement the "delete-old-child-nodes" Cloud Functions example (https://github.com/firebase/functions-samples/tree/master/delete-old-child-nodes). When the directory is written to, it ...
0
votes
0answers
11 views

How can I redirect back to a home url after logging into redmine using a google hangouts chat bot?

I'm using google cloud functions for a hangouts chat bot. The goal is to be able to update issues in redmine from the chat by calling the bot. In order to use the Redmine api I need to be logged in. I ...
0
votes
0answers
24 views

Firestore Cloud Functions to trigger sms

I have the following cloud function that will trigger a sms message to be sent using Twillio. It works as is but it causes the text message to be sent twice. Is there a way I can modify my function to ...

http://mssss.yulina-kosm.ru