Google Translate API authentication error - google-translate

I am trying to call the Google Translate API and using the following to authenticate from my local - gcloud auth application-default login.
The command works successfully and I am authenticated but when I try to call the API i get the following error message which indicates that it is being read as an anonymous API call
google.cloud.exceptions.Forbidden: 403 Daily Limit Exceeded

I ran into this issue too this week,
I thought i was well authenticated but when i was running my code which is C# using the google translate API v2 package, it gave me the same 403 code daily limit exceeded,
I fiddled around with the CLI, made several accounts, service accounts API keys and all and it never worked.
https://cloud.google.com/dotnet/docs/getting-started/hello-world
this page, (the .NET guide part) says you should be using the google cloud platform plugin they release for visual studio, and login via that, i used it and it worked.
If you look on the bottom left part there are guides for any other language that you might be using. (consider adding that as info it helps me help you).
I would love it if it only worked via CLI but as long as it works i guess it's fine...

Related

How to Fix Permission Issues in Firebase Cloud Functions (Nextjs Experimental Hosting)

I have an issue related to Firestore, Hosting, and Cloud functions. I deployed a Nextjs application using the just-released experimental web framework support. I'm using Nextjs's Image API, and as expected, the Firebase CLI creates a cloud function for the project. Everything works fine at the start, but when I try to open a page in the application that reads some data from Firestore, it redirects to an auth page, which is unexpected.
Even when I auth with my Google account (since that's the logged-in user to the application), it returns a forbidden error and logs me out.
When I go back and try again, it returns a different error (most likely because I was logged out automatically).
I tried doing some research, and some people suggested adding an allUsers principal permission to Cloud functions, but that didn't work (Error: Principals of type allUsers and allAuthenticatedUsers cannot be added to this resource), and that's even insecure permission. Only authenticated users should be able to read data from the page as already configured in my Firestore security rules. So it's unclear what I need to do since Firebase created the Cloud function automatically or if this is related to my security rules and cloud functions.
What could be wrong? Everything works fine in my existing deployment setup to Netlify (where Edge functions are created automatically using their Nextjs plugin). I'm only trying to test the new Firebase web framework hosting features. Please let me know if you'd need me to provide some more context or debug files to better help you help me.
Thank you!
The message “ App requesting permission to access your google account “ pops up if the function runs in any region other than us-central1.
Currently, Firebase Hosting does not support Cloud Functions in any other regions, Except us-central1.
You can refer to this StackOverflow thread.

How to investigate errors in Firebase Remote Config API?

I see errors for the Firebase Remote Config API in the Google Cloud Console > API/Service Details metrics.
Looking at "Traffic by response code" I see that a specific API key is causing HTTP code 400 responses from the API for the method:
google.firebase.remoteconfig.v1.RemoteConfigService.FetchRemoteConfig
I'm not able to reproduce this issue locally so how can I find out more about these errors in the Google Cloud Console?
What I've checked so far:
The credential that is causing the errors is restricted to the correct package name and SHA-1 hash (hash taken from Google Play Console > App Integrity)
It's apparently not hitting a quota limit from looking at the quote graph
From the client side logs I only see the exception:
com.google.firebase.remoteconfig.g: The client had an error while calling the backend!
This is a standard error message used in the Remote Config SDK for a client error (ex: a connection timeout, SSL issue, etc.). I suggest that you double check your implementation. You could also use the Android network debugger to simulate the network calls, so it could create a handling mechanism to ensure that the actual device has a proper connectivity on doing the fetch.
You may also refer to the Stackoverflow post and the GitHub Link.
Google Developer Support pointed me to a known bug in the Firebase Remote Config library which has been fixed recently. Upgrading the library indeed fixed the issue.

Google API requested! - Displayed in firebase serve

I have trouble authenticating my Google API and have no clue how to solve it. I want to get my Firestore document by using the REST api but it gives me no data at all in postman.
http://localhost:5000/<project-id>/us-central1/api/todos
I have tried this in my project dir and using cmd.
set GOOGLE_APPLICATION_CREDENTIALS="/functions/util/apikey.json"
But still no changes.
Below is my terminal that shows the warning.

"An account already exists with the same email address" without a switched account

I'm experiencing a very weird issue with the Firebase Auth using Facebook. A month ago I've created a test user in Facebook to log in with like I always do, when I try to use it now, I get this error:
Error: An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.
I've seen this error before when people move from Facebook to Google with the same email. HOWEVER, this is not the case. This dummy Facebook user is totally not linked to a Google account. I can also find it's email address back in the Firebase console where it is still marked as Facebook:
This issue first appeared in the same timeframe as an upgrade of the Facebook plugin and SDK. I've however retested this account now on the old plugin and SDK versions and the issue remains, so this seems to be a coincidence.
Other accounts seem to work but we had a similar issue in our production environment which we now think could have been the same. This gives us the opportunity to fully debug this one.
Extra information:
The (web)app runs on Angular (Ionic cordova). We are using the firebase.auth.FacebookAuthProvider, the error appears on both the Cordova (firebase.auth().signInWithCredential) as web (afAuth.auth.signInWithPopup) version.
The network calls to Facebook and Googleapis seem to be ok and return the correct identity (see screenshot 2), it seems as if the Firebase package is incorrectly giving this error.
Console error:
Firebase Identitytoolkit Network response:

Fulfillment URL is not valid in Dialogflow | Using Cloud Functions

I was using Dialogflow API V1 until now and everything was working fine. It seems like the Dialogflow API V2 is now the default. I am not sure if this is the reason but I am not able to deploy cloud functions anymore.
In the fulfillment tab, it is not letting me enabled the cloud function toggle. Every time I try to enable and click deploy it gives me the following error:
Fulfillment URL is not valid
It's weird because I am not using fulfillment URL and still I am getting this error.
One workaround that worked for me when. I wanted to create a back up bot for my existing LIVE bot to use it for testing. I was getting the same issue once I restored my zip and after that try to edit the stock fulfillment.
What worked for me was, I edited the fulfillment first .index.js and package.json both after which I restored the bot using zip folder that added intents and entities to the agent. after which I was able to deploy cloud functions without getting the error.

Resources