Retrieve error ERR_NAME_NOT_RESOLVED from firebaseio.com - firebase

Network Firebase Error
Hi, I got some problem with firebase realtime database. When I try my firebase configuration (prod) on local or staging (same server as production), it's not show this error. But when I deploy it to production, error occurs when I try hit firebaseio.com. Can someone explain it?
The server I use is AWS CloudFront (staging and production).
Firebase I use is here https://www.npmjs.com/package/firebase with Vue 3

In the screenshots there's an additional %27%2C after firebaseio.com in the URL, which is not supposed to be there. So it looks like you have a ', in the database URL that you initialize Firebase with, which are not supposed to be there. Remove those and this problem should disappear.

Related

AWS DataStore not working with API Key configuration

Getting this warning Data won't be synchronized. No GraphQL endpoint configured. Did you forget Amplify.configure(awsconfig)? which I assume is the reason my data isn't being synced to the cloud and is only working locally while testing my application.
I have read many of the pasts posts about this issue and have followed all the steps such as configuring the endpoint url in aws-exports.js but nothing I'm finding online is working. Anyone have any success with this issue using API key as the default auth setting?

Unable to call Firebase function from React.js application

I have a React.js application powered by a number of Firebase functions and real time database standing behind them. It has been working without any issue for the past 2-3 months and now I am getting a warning on the functions logs which says that:
#firebase/database: 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: \"Failed to parse access token response: Error: Server responded with status 404.\"."}
The way I initialize firebase from my React.js application looks like this:
I have double-checked everything standing behind process.env and it seems to be as expected. The website written in React.js in hosted under the Firebase hosting.
And this is how Firebase functions connect to Admin SDK:
I am not sure what would be the issue here. Nothing has changes in the code base from our side. Not sure if Firebase changed something internally that we need to consider.
What solved the issue for me was to go to the google cloud console (where Firebase functions are also available). Then I opened one of the failing cloud functions and I navigated to
My_Function_Name/Edit/RUNTIME, BUILD AND CONNECTIONS SETTINGS/RUNTIME SERVICE ACCOUNT/
And then I noticed there that for all of my functions it was selected App Engine Default Service Account instead of Firebase Admin SDK. I never explicitly set the runtime to this option. So, when I brought it back to Firebase Admin SDK the error was gone I was able to use the application once again.

Error: Failed to get Firebase project project-name. Please make sure the project exists and your account has permission to access it

I tried running firebase deploy like I have always done but came across this Error:
Error: Failed to get Firebase project project-name. Please make sure the project exists and your account has permission to access it.
I have run firebase login and I get 'Already logged in as email#example.com'
The firebase-debug.log file shows a few 401 http responses and some of them have the following text:
'Request had invalid authentication credentials' and also 'invalid token'
How can this be solved?
For me this worked,
firebase logout
firebase login
This worked for me:
Run
firebase use --add
And re-select the project
Simply
use firebase login --reauth
For me, I was setting up a new machine with an existing firebase project. This is what I did:
First successfully login to firebase from your command console
firebase login
Get a list of your projects
firebase projects:list
Tell firebase which project you are using
firebase use <Project ID>
Then, I was able to deploy and use other commands for this project. Hope this helps someone.
sometimes there is a token error you can check debug.log
Error Message in debug.log : [debug] [2020-10-13T23:01:28.050Z] <<< HTTP RESPONSE BODY {"error":{"code":401,"message":"Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED"}}
Solution of error use
firebase login --reauth
and again firebase init for reinitializing the project
select project and
firebase deploy
Run
firebase use --add
And re-select the project
This works 100%
Try logging out of firebase CLI and then log back in with the account that has the project that you are trying to run.
This was the case with me. I was logged in to another firebase account.
Steps:
`firebase logout`
`firebase login`
Any typo inside the .firebaserc would show this error. For me I had an extra comma, removing it solved the error.
Disconnecting the company's VPN and trying it again worked for me.
If none of the other answers worked for you, I had the same problem and received this solution from Firebase Support. (ty Sergei)
My system will occasionally create and Environment Variable named FIREBASE_TOKEN. The token will expire, but the variable does not. Restarts and logout/login cycles did nothing. Deleting the variable works every time though.
Remove-Item Env:\FIREBASE_TOKEN
It's really awesome and confusing------>
just did these command ->
> firebase logout
>
> firebase login
if you use Mac or Linux, you can write this command export http_proxy=http://127.0.0.1:1087 to make sure your terminal uses the proxy, which is useful for me.
None of the above solutions worked for me but removing/editing the stored value of the default project in $HOME/.config/configstore/firebase-tools.json did work.
If you have this issue in a CI pipeline, you can regenerate a token on your local machine with
firebase login:ci
Put the generated token as an environment variable, e.g. FIREBASE_TOKEN and run like this:
firebase deploy --token "$FIREBASE_TOKEN"
1.run this
firebase logout
firebase login
2.if u can not login successfully , like this ?
[https://i.stack.imgur.com/4MJM5.png][1]
run this , export http_proxy=http://localhost:your proxy port
4.successfully!!!
[https://i.stack.imgur.com/sRcvG.png][1]
It is possible you are trying to deploy without internet connection. The first thing to look for is if your internet is okay.
Make sure that you don't have this file .firebaserc already existing in your project directory if you already do!
Delete it and try firebase init in console again.
I got this error in Linux when I was out of disk space, freeing some space resolved it.

Can't connect to Firebase Database temporarily

Sometimes when I load my app, I just can't seem to connect to Realtime Database using REST APIs. This is only a problem I have been having very recently; it mostly always works but sometimes, randomly, just cannot resolve the destination host.
During one of these times, I have tried using my browser to go to the Firebase Realtime Database page manually: https://project-id.firebaseio.com/
This page should redirect me to my project console. Instead, it just returned a 404.
So I think the problem has nothing to do with my code but it is something Firebase Server-side... what could be the problem?

Error: HTTP error: 400, Project 'my_project' is not a Firestore enabled project

While I run the command firebase deploy I get this error:
Error: HTTP Error: 400, Project 'my_project' is not a Firestore enabled project.
Are you trying to use Cloud Firestore?
If so, visit the database section of the console and initialize Cloud Firestore
If not, remove the firestore.rules file locally
I figured it out myself. It was just an ignorance while using the firebase console. I just had to enable the firestore beta from the console itself, under Database.
If you’re not using Cloud Firestore, comment firestore in firebase.json
I had the same problem. The solution is this: Go to Firebase console and login there [Firebase console]. Here you will see your Recent projects. Go to your project e.g. “stepintothepresent” and then go to database at left side panel, then choose cloud firestore and then I selected the 2nd option.
After that I run firebase deploy from command prompt and the result is this
You can enable the REST APIs using below URL:
https://console.cloud.google.com/apis/library?project=
selected Cloud Firestore while initial firebase setup?
Just go to console and enable Cloud Firestore.
When prompted for once you can select test mode to start off and later change it to private.
I had to create a DB environment and it worked fine after that. I'm using the realtime DB, not Cloud storage so it shouldn't have stopped it, anyway, its fixed.
someone with another answer please.
Are you trying to use Cloud Firestore?
If so, visit the database section of the console and initialize Cloud Firestore
* Can you post the url please?
If not, remove the firestore.rules file locally
*Error: Error reading rules file firestore.rules

Resources