CodeGeek
CodeGeek

Reputation: 721

Firebase Function returning connection error

I am using firebase functions Database Triggers.

My Function :

exports.function_name = functions.database
  .ref("/transact/{entry_type}/{id1}/{id2}/trigger_cross_entry_function")
  .onCreate((data, context) => {
    console.log("trigger_cross_entry_function value", data.val());

    if (data.val() == true) {

      console.log("Function Calling parent data");

      return data.ref.parent.once('value').then(function(snapshot){


      }, function(error) {
        // The Promise was rejected.
        console.error("THIS IS THE ERROR:"+error);
      });

    } else {
      console.log("Function Returned");
      return 0;
    }
 });

Whenever I want to trigger this function I put trigger_cross_entry_function into that partcular path from the Mobile App. Everything works fine and function is called as expected.

After sometime If I again try to do the same thing it gives me

Function execution took 16 ms, finished with status: 'connection error'

If I restart the function than it again works perfectly. and If I trigger it continously than it has no issue.

But once I keep it idle and try to trigger it again after sometime, it gives me this error.

And I am using Firebase Pay as you go Plan.

Also, as you can see I am returning all the promises correctly and function is being triggered everytime but It doesnt go into the function. it just exit with connection error.

What might be the cause for this ? I have a spent a day finding this.

Upvotes: 4

Views: 925

Answers (1)

Michael Yavorovsky
Michael Yavorovsky

Reputation: 126

Experiencing the same issue. Looks like Google changed the status of the service to down https://status.firebase.google.com/incident/Functions/18046 https://status.firebase.google.com/

So most likely the Google side problem.

Upvotes: 1

Related Questions