title: Firebase-functions auth failure after Firebase-tools upgrade
body: <p>ERROR : @firebase/database: FIREBASE WARNING: Provided authentication credentials for the app named "[DEFAULT]" are invalid. This usually indicates your app was not initialized correctly. Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.</p>
  
  <p>This error just started showing up with my app after I updated firebase-tools to 6.3.1. Was working great for months prior. To make matter worse.... there seems to be an endless loop in the call which, I am unable to find.  </p>
  
  <p>According to the Firebase docs and vids I have initialized the script correctly.</p>
  
  <ol>
  <li>Deleted and redeployed the function</li>
  <li>Changed rules to allow all read/write capabilities</li>
  <li>Updated IAM permissions within Google dev console (although this seems foreign to me as I'm an IOS dev by nature)</li>
  </ol>
  
  <pre><code> const admin = require('firebase-admin');
   const stripe = require("stripe")("sk_***********");
  
   stripe.setApiVersion('2018-09-24');
  
   admin.initializeApp();
  
   exports.chargeCustomer = functions.https.onRequest((req, res) =&gt; {
  
   const _amount = req.query.amount;
   const _id = req.query.customerId;
   const _uid = req.query.uid;
  
   console.log('Charge customer started');
  
   stripe.charges.create({
       amount: _amount,
       customer: _id,
       currency: "usd"
   }, (err, charge) =&gt; {
       if (err !== null) {
           console.log("Error charging customer: ", err);
           res.status(500).send(err);
           return;
       } else {
           console.log('Stripe returned. Starting Firebase');
  
  -below is where things go haywire-
  
           admin.database().ref(`/users/${_uid}/balance`)
               .once("value", (snap) =&gt; { 
  
                   admin.database().ref(`/users/${_uid}    /`).update({"some:data"}, (err) =&gt; {
                       if (err !== null) {
  
                           res.status(301).send(err.message);
                           return;
                       } else {
                           res.status(200).send(true);
                           return;
                       }
                   })
                 }
               }).catch((err) =&gt; {
                   console.log("error getting balance: " + err);
                   res.status(301).send(err);
                   return;
               })
       }
   });
  })
  
  
  </code></pre>