Giter VIP home page Giter VIP logo

Comments (4)

chiragpurohit71085 avatar chiragpurohit71085 commented on July 25, 2024 3

When I am trying to deploy functions locally

Using

firebase serve --only functions

I am getting following error. My PC's (MC) time is proper i.e I have set automatic date&time

✔ functions: helloWorld: http://localhost:5000/pingbuds-268a1/us-central1/helloWorld
✔ functions: getFaceBookUserData: http://localhost:5000/pingbuds-268a1/us-central1/getFaceBookUserData
info: User function triggered, starting execution
info:

getFaceBookUserData req.body = { facebookIdArray: ' ["102062727235361","12345678"]' }
error: FIREBASE WARNING: {"code":"app/invalid-credential","message":"Credential implementation provided to initializeApp() via the "credential" property failed to fetch a valid Google OAuth2 access token with the following error: "Error fetching access token: invalid_grant (Token has been expired or revoked.)". There are two likely causes: (1) your server time is not properly synced or (2) your certificate key file has been revoked. To solve (1), re-sync the time on your server. To solve (2), make sure the key ID for your key file is still present at https://console.firebase.google.com/iam-admin/serviceaccounts/project. If not, generate a new key file at https://console.firebase.google.com/project/_/settings/serviceaccounts/adminsdk."}

from functions-samples.

katowulf avatar katowulf commented on July 25, 2024

Try upgrading your firebase-tools lib to the latest version, then call firebase logout followed by firebase login. If that doesn't help, reach out via our support/community channels.

from functions-samples.

chris08002 avatar chris08002 commented on July 25, 2024

@chiragpurohit71085 I had the same error message when running firebase experimental:functions:shell

I "solved" the issue by updating

npm install -g firebase-tools@latest
npm install --save firebase-functions@latest firebase-admin@latest firebase@latest

BUT: It seems that all write operations on the real time database are not executed. The function returns after a while with a timeout.

E.g.:

`
import { database as dbEvent } from "firebase-functions";

export default dbEvent.ref("/tariffs/removeHistory").onCreate((event: any) => {
const bikesHistoryRef = event.data.adminRef.parent.parent.child("bikesHistory");
return bikesHistoryRef.set(null);
});

`

Set never gets executed and function hangs until it runs into a timeout.

Strange thing is that it used to work before. This is why I have been trying with different firebase and node versions.

from functions-samples.

goelmk avatar goelmk commented on July 25, 2024

are you behind a firewall or proxy?

from functions-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.