Trying to deploy firebase functions..which deploys fine after giving warning on the first try
console warning:
Functions deploy had errors with the following functions:
To try redeploying those functions, run:
firebase deploy --only functions:
To continue deploying other features (such as database), run:
firebase deploy --except functions
redeploying does not give any error in console and functions deploys without any problem
but calling the function does not show any logs in firebase console, while giving this error in chrome console
Error: Forbidden
Your client does not have permission to get URL /sampleFunc from this server.
So I contacted firebase support and there seems to be an issue with functions:
here is what they replied:
There is an ongoing issue with the deployment of new functions as they are deployed as private, please update to the latest version 8.0.0 of the CLI with the command: npm install -g firebase-tools, which it might fix the error.
Our engineering team is already working to solve this issue, however there is no tell on when this fix will be released. At the moment the only workaround for this is to manually set a function to public using Cloud Console or gcloud CLI.
Let me know if you have more questions
Cheers,
Related
I am supporting the operation of a system that runs over Firebase, connects to Web, IoT and also iOS/Android flutter apps.
I am trying to add a new endpoint/function to my API, but after I do npm run build and npm run deploy it shows errors like below upon using one basic endpoint:
Error: Value for argument "seconds" is not a valid integer.
at Object.validateInteger (/workspace/node_modules/#google-cloud/firestore/build/src/validate.js:200:19)
at new Timestamp (/workspace/node_modules/#google-cloud/firestore/build/src/timestamp.js:70:20)
at Function.fromMillis (/workspace/node_modules/#google-cloud/firestore/build/src/timestamp.js:126:16)
at Function.fromDate (/workspace/node_modules/#google-cloud/firestore/build/src/timestamp.js:108:26)
at Bill.openBill (/workspace/lib/model/Bill.js:17:55)
at Object.fromFirestore (/workspace/lib/model/Bill.js:59:14)
at QueryDocumentSnapshot.data (/workspace/node_modules/#google-cloud/firestore/build/src/document.js:315:40)
at QueryDocumentSnapshot.data (/workspace/node_modules/#google-cloud/firestore/build/src/document.js:495:28)
at _admin.firestore.collection.doc.collection.get.then (/workspace/lib/controller/userController.js:535:71)
at process._tickCallback (internal/process/next_tick.js:68:7)
Another problem that showed up, after new deploy, was this one:
iot
TypeError: snapshot.data is not a function
at Object.fromFirestore (/workspace/lib/model/Bill.js:57:31)
at QueryDocumentSnapshot.data (/workspace/node_modules/#google-cloud/firestore/build/src/document.js:309:36)
at QueryDocumentSnapshot.data (/workspace/node_modules/#google-cloud/firestore/build/src/document.js:466:28)
at _admin.firestore.collection.doc.collection.get.then (/workspace/lib/controller/userController.js:535:71)
at process._tickCallback (internal/process/next_tick.js:68:7)
I haven't touched the code, to check if the problem was anything I could have changed and simply deployed again, with success but with the Type Error when calling a function that I never chaged the TS code!
For me, it seems that there is some kind of "package mismatch" between what the API should be using to deploy and what I it is really using from the build and deploy in my computer.
How can I know what's wrong with my API's deployment?
Can I build and deploy with same function version and older (or newer) packages without "breaking" their use online, as it happens now?
using express app as function. my functions engines:node was set to 12. I had to upgrade node locally -- so I also updated engines:node to 16. suddenly couldn't deploy the functions, I reverted back to engines:node 12. Still can't deploy functions. Seeing this error:
Missing URI for HTTPS function in printTriggerUrls. This shouldn't happen
And a bunch of messages referring to previously deployed functions:
Could not find image for function
Extremely frustrated... tried reinstalling all the local npm packages with no luck.
The solution that finally worked was to delete all the previously deployed functions and re-deploy all the functions fresh.
Try running this command to see the logs
firebase functions:log
When deploying to firebase functions, I had an error occur during post-install script due to missing dependency. I'll be honest that I was surprised it was even being run. I've come to the realization I don't really understand what gets run during deployment.
I suspect it's something like:
npm install --production
npm run build
The issue I'm having is that it cannot find a dependency for post-install, which i suspect it's not installing dev dependencies.
Are there are a list of things that occur when you push to firebase functions?
I'm trying to get some Firebase functions emulated locally, and have followed Google's local emulator instructions. When I run firebase serve I get this error:
Error from emulator. FirebaseError: HTTP Error: 403,
Mobile SDK API has not been used in project <my project ID>
before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/mobilesdk-pa.googleapis.com/overview?project=<my project ID> then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
Seems straightforward, except that when I follow the supplied URL I get an error because the "Mobile SDK API" does not exist. I've tried searching on Google's API page as well and there is definitely not an API with that name.
Anybody know how I can get around this issue?
(I also tried firebase functions:shell and get the same error)
I got this issue fixed by logging into firebase, since the error was showing on a different machine.
After running firebase login and the authentication process, firebase serve worked without issues.
I was having the same problem and fixed it for myself. I was running Node v11.14.0 and downgraded to the latest version of Node 8 (v 8.16.0).
In my case, the problem was that I was running an outdated version of firebase-tools on the CLI. Running npm update firebase-tools resolved the issue.
Recently found out what is Firebase and started studying it. I need Firebase functions for the server side of my project so I was trying to see how they work but unsuccessfully.
They have nice "little" collection of functions examples there. I tried to start few of them like image-maker but none of them worked for me. Image maker shows me this errors while serving the local server for it:
! functions: Failed to load functions source code. Ensure that you
have the latest SDK by running npm i --save firebase-functions inside
the functions directory.
! functions: Error from emulator.
FirebaseError: Error parsing triggers: Cannot find module
'canvas-prebuilt'
I have no idea what are they talking about. I installed everything by Firebase tutorial through firebase init.
I have:
npm -v: 5.5.1
node --version: v8.9.1
I don't know how to check for Firebase version but I guess I have the latest one since I have just installed it. How can I fix this problem and actually try the functions? Can these functions samples be outdated? Where can I find the better ones?