Firebase Hosting says, "Needs Setup" - firebase

I’m having the same issue as described in Firebase hosting: Needs Setup
I have a project hosted on firebase and DNS set up via Cloudflare. The domain resolves properly and browsers show the certificates are valid and the connection is secure etc. but, firebase shows status as, “Needs setup”.
I have followed the “Advanced” setup (as described in the URL above) setting both A records and a “.well-known/acme-challenge/[generated filename]” file in place. SSL zone on Cloudflare is set to “Full”. I also set a CNAME record to the Firebase URL as another post suggested. (I did each step over time to try to see which if any fixed the issue or made it worse giving at least 12 hours between.)
Everything seems to work, but firebase still says setup is still required which is ok I guess, but I'm curious about the cause.

In Cloudflare set Proxy Status as DNS only.
Work for me.

Related

RequestHeaderSectionTooLarge: Your request header section exceeds the maximum allowed size

We are using AWS Amplify for our NextJS web app and keep receiving error when ever I try to load the application once deployed to Amplify. Locally there is no issue.
I am using Amplify's default Auth configuration, with basic email and password auth. It looks like it could be related to the Amplify cookie being set in the header but I cannot find any documentation within AWS to prevent this or reduce the amount of information passed with the header. Any help would be appreciated.
I have faced the same issue and was able to solve it. Here's how -
Identify the CloudFront Distribution ID for your app. You can find it in the Deploy logs of your app build console.
Search & open that particular CF Distribution and go to the Behaviours tab.
Select the Default behaviour (5th one in my case) and hit Edit.
Scroll down to the Cache key and origin requests section.
Here you will find settings to control what's included in the headers of the request that goes to the server. In my case, I didn't need any Cookies so I chose None, and it solved the issue for me.
In your case, you can do the same or pick what all info needs to be in the headers.
Check to see if there are any unnecessary cookies for that domain.
I was getting this error (on a site I don't own). I took a look at the request headers and found a very large number of cookies (several dozen) for the site's domain. I cleaned up the cookies which seemed non-critical and the error went away.
As the error implies, the size of the entire request header section is above 8192 bytes. Request headers include the accept headers, the user agent, the cookies, etc. and all combined can get rather large. Large headers look malicious to some WAFs. I once had a single user having trouble with our site. Turns out they were a polyglot and had configured their browser to accept several dozen languages causing their accept-language header to be suspiciously long, and the WAF refused to proxy the request.
I faced the same issue using Nextjs, amplify and an external Auth provider.
The problem is that AWS S3 service has a request header maximum allowed size of 8192 bytes, so when ever you try to access the static generated pages of Nextjs it returns that error. This has already been asked here
In my case, I was using an external Auth provider and I was able to solve the issue configuring the cookies only for the '/api/' path. That way the Auth cookies are sent only to the Nextjs api endpoints, so your request header is lighter whenever you try to get the static pages.

Diagnosing an additional redirect in a "Request initiator chain" when moving from localhost to a hosted site

I'm in the process of deploying my React site to AWS via Amplify, and the first step on the site is authenticating with Spotify. Here in their auth guide, they call the type of auth I am performing "Authorization Code Flow" where the first step is the site requesting a scoped auth and receiving a code via a http redirect.
This all works fine and dandy when I am running the app locally - the network logs and associated looks like this (apologies, I'm not sure how to best reproduce for you this devtools output):
localhost network logs
localhost initiator chain
But when I attempt this on my live site soundfound.io I instead receive in additional redirect which makes it impossible for me to retrieve the code (I believe at least - I could not figure out a workaround where I just capture the code from the 2nd 302 here but if you do, please enlighten me b/c I'm at the end of my rope here).
live network logs
localhost initiator chain
and here - my boilerplate AWS Amplify domain config: https://ibb.co/SV1N809
I've been reading up but this is just not clicking with me - WHO or WHAT is causing this additional redirect? It's certainly not the React application itself, that doesn't make any sense. Spotify knows about both redirect urls (localhost:3000/redirect and soundfound.io/redirect) so I don't understand how that could behave differently. The only place I can think to look is within the domain registration and control part of AWS Amplify - but I don't see (or don't understand) anything that would cause this sort of issue?
I'm just so lost as to where to begin trying to troubleshoot this, any and all help would be appreciated. Thanks
The AWS Amplify automatically creates a rule in the console App settings under "Rewrites and redirects" that redirects all requests to my base domain "soundfound.io" to "www.soundfound.io". Erasing this rule solved the issue.

Mapping GoDaddy domain to Firebase Hosting does not get verified

I'm probably doing something silly, but I can't seem to be able to figure this out.
I've waited over 24 hours for Firebase to validate my domain, but the status just stays at "needs setup" and "domain not verified".
Per other other related answers on StackOverflow, I use # as the Name for TXT, instead of what Firebase said to put there (I also tried the "acme-challenge.www.mydomain.com" for a while).
Here are my GoDaddy records:
Anyone got ideas what might be wrong?
OK. I think I got to the bottom of it finally (I'm really new to this domain business). I originally added www.mydomain.com and not the naked mydomain.com to the "connect domain wizard". And I believe since I didn't have a CNAME www pointing to # it could never have worked.
Now I just added mydomain.com to the wizard, and Firebase instantly validated the domain.
The status is now "pending" since it takes up to 24 hours to validate the certificate, but the site already works.
Make sure to delete the original A records using the name #. Only keep the A records that are pointing to the Firebase Hosting IP address.
EDIT:
Change your TXT value to google-site-verification=YOURCODE.
It must include google-site-verification=.
Add custom domain from GoDaddy to firebase hosting
Simple step-by-step solutions with screenshots are found here

Error from Firebase Project URL: Adding www causes "Your connection is not private"

I have a firebase project that loads properly unless I type the url to my project with www. in front.
This works:
https://myproject.firebaseapp.com
This returns an error:
https://www.myproject.firebaseapp.com
Your connection is not private
Attackers might be trying to steal your information from
www.myproject.firebaseapp.com (for example, passwords, messages, or
credit cards). Learn more NET::ERR_CERT_COMMON_NAME_INVALID
Attempt to resolve
I followed the "Learn More" in the error above and it seems that
the error might be that firbase by default sets up
myproject.firebaseapp.com but not www.myproject.firebaseapp.com.
I then checked the firebase app in the hosting console (i.e. https://console.firebase.google.com/project/myProjectNameHere/hosting/main)
and it does show only the non-www version, but adding the www version here does not seem possible since I do not own the firebaseapp domain so I cannot add the provided TXT file at this point to the DNS records.
Does anyone know why this is occurring and how to get the project to load when www. is added to the url?
Thank you in advance!
This is not supported.
To give some technical detail, wildcard SSL certificates are only valid for a single level; so *.firebaseapp.com but not *.*.firebaseapp.com. In addition, this is (in my estimation) entirely unnecessary as it simply makes the URL longer.
What I would encourage you to do is purchase a domain name for use with your Firebase Hosting site, and connect it. Read "Connect a Custom Domain" in our docs for more info.

Google Domain - DNS Configuration for Firebase Hosting - Connect Domain

I am trying to connect my firebase app in to a domain -where the domain purchesd from google.Need help to to do the setup for DNS configuration.
my app is working fine in firebase app.
firebase app is - https://.firebaseapp.com/
My Firebase setup
And
Google Domain (https://domains.google.com/) - DNS Configuration
1.Name servers
Default is "Use the Google Domains name servers" is it OK?, if not what to setup
2.Registered hosts
If anything, need to add- please let me know.
3.Synthetic records
If anything, need to setup - please let me know.
4. Custom resource records
I am trying to add two records but getting error while trying to add second record - is "Record already in use"
please find the screen shot
Update
Now I have added both the IP address, but still it is not working.
Click the little + icon to the right of the field where you're entering the IP address. That will open a second textbox that you can use for the second value.
I noticed in your screenshot
That you have #-------------.com (where I assume ----------- is your URL). You don't want that. You want simply # there (and www if you want to redirect www.--------.com as well). # means "this domain name", which in your case is ----------
Hope this helps!
This was really helpful but there was one missing thing I was still confused on. On the firebase docs page for this https://firebase.google.com/docs/hosting/custom-domain if you scroll down the page it give you an example of how to setup a google domain. It asks that you put in the following information.
I could not find any "verification value provided in firebase console" for a TXT record. I ended up just putting the DNS A record inputs and that worked for domainName.com and www.domainName.com
Addition to Editing and (+) adding records together. You might want to also add 2 records for # and and 2 for www.
I had same problem, every setup was right but site doesn't work.
Finally I removed the domain from Firebase and add it again without changing DNS setup, then problem resolved.

Resources