Backend Call Failure on Next.js 15.2.0
PETER MARINOV
5
Reputation points
We have an issue with Next.js hosted on Azure Static WebApp. We find recurring and sporadic downtime behavior, which from what we can tell is not related to traffic spikes or increased load.
The site is hosted using node:20 and next.js 15.2. The behavior is that the entire site is down and after idle time we see "backend call failure" error with status code 404 (see attached image)
The entire site is not able to process the requests with the favicon.ico failing at that time as the first one the browsers are trying to fetch.
Details which are worth sharing:
- site has been hosted for months and performs great with the exception of these sporadic once per day downtimes
- we are using the hybrid mode with SSR, middleware.js, Reac tserver components and have followed all steps from the guide - https://learn.microsoft.com/en-us/azure/static-web-apps/deploy-nextjs-hybrid
- we cannot attribute traffic to the issue - you can see that this example had less than 60 hits - mostly from my team trying to reproduce and measure
- we use middleware which allows the .swa health and it is working at
.swa/health.html
- the backend span tracing from AppInsights gives nothing as an error and we cannot drill down to the actual error message or exception that occured on the server (check last image)
- we use standard hosting plan (the most expensive Azure Static Web App plan).
- we use custom domain, but don't use Entreprise-grade Edge yet
Questions:
- Can you recommend steps to avoid the issue as this seems to be known issue - https://github.com/Azure/static-web-apps/issues/1444. Is there a recommendation to NOT use Azure Static Web App for hosting Next.js in hybrid mode? What can you recommend to us as hosting in Azure for this Next.js app?
- Can we improve logging or otherwise access server logs to understand which process is failing?
- Any other steps or data we can collect to triage and solve?
Thanks,
Peter
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,155 questions
Sign in to answer