Azure / static-web-apps

Azure Static Web Apps. For bugs and feature requests, please create an issue in this repo. For community discussions, latest updates, kindly refer to the Discussions Tab. To know what's new in Static Web Apps, visit https://aka.ms/swa/ThisMonth
https://aka.ms/swa
MIT License
318 stars 53 forks source link

Nextjs backend call failure #1444

Open krisnashaypp opened 3 months ago

krisnashaypp commented 3 months ago

We have a nextjs app that has been running as a static web app for many months, in recent days it has started having intermittent failures were all you see is "Backend call failure", usually it starts working by itself after a while but sometimes it takes a longer time.

image

It's running next 13.5.6, thanks

DervishMarauder commented 3 months ago

I've been experiencing this issue on a Next.js SWA deployment hosted in west-europe since late on Tuesday. I've been the Azure status page, but nothing has been raised as of yet.

mmcossu commented 3 months ago

Same thing here, randomly, out of nowhere, with next.js 14.1.0 with app routing . As of today it only happened once, this monday, and we could not identify any cause.

lucas-garrido commented 3 months ago

Same here... its rly annoying

DervishMarauder commented 3 months ago

I've had to migrate away from using Static Web App resources because these past few days have been non-stop outages with this exact error. I hope that they resolve this soon as it seemed like a simpler alternative than hosting everything in a kubernetes cluster, but having this pop up for production applications that previously worked without issue isn't something that anybody wants to handle.

Good luck to everyone and I hope that a response / solution is raised for this soon.

thomasbtf commented 3 months ago

Same here unfortunately. Using the free tier.

carlos-manosalva-kc-nva commented 2 months ago

We have been experiencing this issue more often (Static web app - Standard plan), this is becoming a problem for our clients so we are thinking on migrate to azure web app.

davidhancockilfracombe commented 2 months ago

"Don't worry", M$ are on it! :S

jpaholik commented 2 months ago

The same problem here, we are using paid tier

AndreasAKD commented 2 months ago

We get this more frequently on both of our webapps for the last month and it's getting worse, what's going on??

image

serena-shen2 commented 2 months ago

Hi there, would you all be able to share your site's defaultHostname or raise an issue against our service so we can continue to investigate?

krisnashaypp commented 2 months ago

Hi there, would you all be able to share your site's defaultHostname or raise an issue against our service so we can continue to investigate?

Hi @serena-shen2 , our defaultHostname = lively-grass-00c911a03.3.azurestaticapps.net

I can add that I've noticed that the site seems to get super sluggish right as it happens. And that it's been extremely slow all day today.

mmcossu commented 2 months ago

@serena-shen2 https://zealous-rock-01a3ede03.4.azurestaticapps.net

psegalen commented 2 months ago

Hi, my paid tier SWA has these intermittent errors since march 22nd, I also observed something that wasn't there before: when a page goes 404 on purpose (article has been unpublished), next never tries to get it again (even after it's been published again), it just stays a 404 until a new deployment occurs. I really think it's related to the nextjs improvements published by the team on march 7th, here are more about my specific case: https://github.com/Azure/static-web-apps/discussions/1066#discussioncomment-9079775 I'd be happy to raise an issue and work with your service to mitigate this @serena-shen2, how can one do it?

krisnashaypp commented 2 months ago

Hi, I finally moved the app to azure container apps instead because we were having this problem daily. I'll leave the issue open of course but we have stopped using static web app so you can ignore looking into our defaultHostname @serena-shen2

angusb93 commented 2 months ago

This is becoming a big problem for me too. Noticing the same sluggishness before the site goes down

liamfiddler commented 2 months ago

I'm seeing the same issue on a site I support for a client.

The site has been crashing almost daily for the past week with "Backend call failure" messages.

Like @psegalen mentioned in their comment, I've found that performing a manual re-run of the latest Github Action can temporarily resolve it.

ottosulin commented 2 months ago

We're getting these at least once a day. Azure support is completely clueless about this.

selimeneserdogan commented 2 months ago

We are experiencing the same issue. The test environment for the same project is hosted on free AWS Amplify, and we are not encountering any similar errors or slowdowns. For now, it seems there is no solution…

nmoliveira commented 2 months ago

Same issue!

vonbv commented 2 months ago

We have encountered this too just today. Our static web app has not been touched since 5 days ago and it has been running fine. Re-running the last deployment we did fix the problem for us. Not a real solution though as we need more data into what happened. Our app's app insights is not showing anything for us.

jenspettersson commented 2 months ago

Same issue here since at least a week ago (might have been earlier). We had to deploy a second instance of our SWA because we can't even deploy to our original:

The content server has rejected the request with: BadRequest
Reason: The Static Web App contents cannot be updated while a backend migration is in progress.

The new instance also gets the Backend call failure randomly and is sluggish as well, but at least it kind of works... sometimes.

vartdalen commented 2 months ago

We started seeing this error for the first time today. It happens on deployment to both preview and production. Redeploying on this error has so far fixed the issue every time (4 times today, twice in preview and twice in production). Very unreliable and unpredictable, hope Microsoft will address this?

vonbv commented 2 months ago

We encountered this again today and running the last deployment did not fix it this time. We tried doing it three times and with each successful deployment, the website just shows the "Backend call failure" message. So we decided to create a new SWA and the site is backed up. That process it no sustainable.

Jbveas01 commented 2 months ago

We have been experiencing the same issue around ~3:40 EST a few times a week without us touching anything. Usually comes back up in 10-15 minutes. The only backend part of our SWA is our NextAuth authorization

psegalen commented 1 month ago

Hi all, I don't know this has anything to do with an action from the Azure team but our production NextJS app hasn't crashed for a whole week, this is a nice change! Kudos to MSFT teams if it's their doing!

enesceb commented 1 month ago

Until now, the environment was supposed to crash at least once, but I just realized that it didn't. Do you think the problem may have been solved?

psegalen commented 1 month ago

Until now, the environment was supposed to crash at least once, but I just realized that it didn't. Do you think the problem may have been solved?

I really hope so! 🤞

Ambyli commented 1 month ago

Hi all, I don't know this has anything to do with an action from the Azure team but our production NextJS app hasn't crashed for a whole week, this is a nice change! Kudos to MSFT teams if it's their doing!

Unfortunately for us, it has crashed and been down for at least a minute every day last week. Oddly always at the same time in the afternoon in EST?

sellimenes commented 1 month ago

It seems like the problem has been resolved for the past few days. However, since we don't have concrete data, I cannot say anything definitive. I only synchronized the fetch operations on the SSR pages with Promise.all in terms of performance. I'm not sure if this could have an effect, but I suggest to try.

liamgsmith commented 1 month ago

Can confirm it's still happening as of just now; two sites on free ; https://ambitious-desert-0308b531e.5.azurestaticapps.net/ and https://mango-flower-0ef1f931e.5.azurestaticapps.net/. Both worked again after a few minutes of getting the backend call failure Guessing it's some kind of warm up / time out combinatoin where there host is turned off and needs to respond after a period of inactivity; felt a bit like the old Heroku plans used to.

psegalen commented 1 month ago

... Guessing it's some kind of warm up / time out combinatoin where there host is turned off and needs to respond after a period of inactivity; felt a bit like the old Heroku plans used to.

I don't think so, having way too issues a month ago I created a probe on my Azure Functions that tests a SSR page of our NextJS app (it's a CRON running every 5 minutes, that's how I could monitor the frequency of crash happening) so I think our NextJS app (and SWA) never goes cold but it would crash anyway.

jan-bock commented 1 month ago

Have contacted Azure and they've reported they're working on it. They've shared that fixes have been rolled out to East Asia and West US 2 regions. Anyone in either of these two regions still having issues?

mattfrear commented 1 month ago

Have contacted Azure and they've reported they're working on it. They've shared that fixes have been rolled out to East Asia and West US 2 regions. Anyone in either of these two regions still having issues?

I have an Azure SWA deployed to East Asia and I'm seeing that error for the first time today. Although, in the Azure Portal the location says "Global".

ottosulin commented 1 month ago

SWAs are replicated eventually globally, but from the Azure API's perspective you first deploy it to one region, where I guess the original versions of the assets are stored.

And we're still experiencing this issue too daily.

CatalinBalan commented 1 month ago

Any news? This is a critical issue and seems many people are experiencing it.

iaggocapitaniovamo commented 1 month ago

same issue here

mattfrear commented 1 month ago

FWIW I'm not seeing this any more (East Asia). I was seeing it when I was having some auth issues, occasionally I'd get 401s and occasionally I'd see "Backend call failure" (can't remember with which response code).

MichaelZh1104 commented 1 month ago

same issue here

victorpotasso commented 1 month ago

Same issue here

jenspettersson commented 1 month ago

Was working ok for us the last week, but now we're facing:

image

Backend call failure again... And still no official statement as far as I can see... SWA does NOT feel like something you want to invest in for the future...

Edit: West Europe here.

janosgy commented 1 month ago

We've been experiencing this issue more and more often since the last week. Last time it was not recovering on its own even after several hours. What helped is that we re-deployed the application and the issue was gone. I hope this helps.

jenspettersson commented 1 month ago

We've been experiencing this issue more and more often since the last week. Last time it was not recovering on its own even after several hours. What helped is that we re-deployed the application and the issue was gone. I hope this helps.

Thanks, a re-deploy "fixed" it. For now.

D1slife commented 1 month ago

Is this happening for apps that use SSR or CSR?

JardelFelp commented 1 month ago

Same problem :(

Vbaungartem commented 1 month ago

Same problem here :(

gfrnca commented 1 month ago

Same problem here, too.

victorpotasso commented 1 month ago

Same issue and I'm running a Next.js 14 on a SWA in US. I'm making use of SSR

mfathi91 commented 1 month ago

Same issue here: Next 14 and Azure static web app

yhpredeyes commented 1 month ago

Same issue here as well with Next version "13.2.4". Redeploying the app is fixing the issue but just temporarily. Issue comes back anyway.

EmanH5 commented 1 month ago

After struggling from the same problem, this is how I fixed it for my app. First, no work around worked for me on Azure static web app even the paid plan! So I shifted to Azure app service and it won't work until you include some files and modifications. I wrote all about it and added the files needed, code and references here Just jump to the solution part.

I hope this helps.