Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWA auth middleware randomly crash #1061

Open
remirobichet opened this issue Jan 30, 2023 · 21 comments
Open

SWA auth middleware randomly crash #1061

remirobichet opened this issue Jan 30, 2023 · 21 comments
Labels
bug Something isn't working triaged

Comments

@remirobichet
Copy link

I encounter a big issue right now.
I have 4 static web apps deployed on azure (Central France datacenter) and they all break at the same time. More specifically the Auth middleware from the static web app seems to be broken for ~3min every 10min. During this downtime, all auth routes (eg: <host>/.auth/*) are not redirecting following staticwebapp.config.json configuration.
As result, all these routes are handled by my Nuxt.js app and fallback to a 404 error.

Additionnal informations:

  • each SWA is deployed on independant resource group
  • this behavior started since 1/25/23
  • I never had similar issue before this date
@RyanMatCook
Copy link

Also having a problem and can't figure it out. It comes and goes so can't find a root cause.

No changes to the auth flows and users have been experiencing issues since basically the Azure outage.

When in my live SWA, users seem to get stuck in a redirect loop between /.auth/me and app root. The error I get is
"Uncaught (in promise) SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON" which I can see in the console.

When I run a JS function to get /.auth/me from the console, it returns the app root page as html markup, whereas on my local it returns the usual JSON I'd expect to see with user roles etc.

PS, I was viewing a Power BI report now and saw the same thing coming up in the console as a warning so maybe this issue is related to Azure AD rather?

@remirobichet
Copy link
Author

I've made further investigation, but I still don't have any answer.

Here is my use case :
I've created 2 new SWA, one located in "westeurope" and one in "centralus". Then I deployed the exact same application on both using SWA cli. They are all good, without any issue.

My 4 others SWA are still broken... They are deployed from azure pipeline, this is the only difference.

@danbasszeti
Copy link

I have the same issue. Opened a ticket with Microsoft and not had much back after sending them two Fiddler traces.

This is critical for us, it's blocking all of my apps in production and there's nothing I can do about it. At the moment we seem to be able to get people online if they choose another browser - but I'm not convinced that its anything beyond just having a fresh cache.

@anthonychu this is really a big problem for us right now!

@admin-vzd
Copy link

I also have the same issue and also opened a ticket.

This is blocking two of my production apps since both have restricted access to the entire application... so no auth, no app access.

@roboalbers
Copy link

I also have the same issue and also opened a ticket.

This is blocking two of my production apps since both have restricted access to the entire application... so no auth, no app access.

Experiencing exactly the same. Entire application behind auth. Stuck in a redirection loop from Azure AD, at some times, you are enable to login, otherwise an infinite loop trying to redirect the user back and forth from the login point. Issues started around 25/1.

@admin-vzd
Copy link

@roboalbers I bet if you go to “Diagnose and solve problems” under the swa settings in Azure your auth config will be null as reported in #1038

@johnnyreilly
Copy link

johnnyreilly commented Jan 31, 2023

I too have this issue; seems to have been happening since around 25/01/2023 - in case it's significant, we're deployed to West Europe.

@roboalbers
Copy link

roboalbers commented Jan 31, 2023

@admin-vzd
Actually not, I can see the auth config. Been told by the support to add
"responseOverrides": { "401": { "statusCode": 302, "redirect": "/.auth/login/aad?post_login_redirect_uri=.referrer" } },
But doesn't change anything regarding my infinite loop from aad, where I before didnt have the post_login_redirect_uri.

Update: I've also got confirmation from Microsoft support that the issue is on their side.

@nrandell
Copy link

I've got exactly the same - they have said it's a known issue and the product group are working on it! It's taken them 3 days to get round to telling me this! Not impressed

@danbasszeti
Copy link

Currently having to prep backup plans, none of which are nice really, and most likely end up with us having to host everything either on an App Service or a Container (presuming that AAD B2C itself isn't broken as this appears to be a static web apps issue given the others here who are using various 3rd party auth providers)

@nrandell
Copy link

nrandell commented Jan 31, 2023

I've just tried a brand new deployment on a totally separate site - exactly the same issue! Looks like it's something core to static web apps. Tried both in Europe and the US - same issue!

@anthonychu - is there any ETA for this. I need something to tell our customer.

@sgollapudi77
Copy link

I've got exactly the same - they have said it's a known issue and the product group are working on it! It's taken them 3 days to get round to telling me this! Not impressed

Hi @nrandell we're working on this, and we'll let you know once we get more details on this.

@sgollapudi77
Copy link

Hey everyone,
`Azure Static Web Apps in West Europe users might have experienced failures with login access. We have identified that there was a misconfiguration on a local node affecting a node which had caused login requests to be left in a suspended state.

Mitigation: We made a networking change to a unhealthy node to bring back the node to a healthy state.

Next steps: We will continue to investigate to establish the full root cause and prevent future occurrences.`

@nrandell
Copy link

nrandell commented Feb 1, 2023

This is looking a lot better for us! as you can see. Thank you.
image

@sulabh-msft sulabh-msft added triaged bug Something isn't working labels Feb 1, 2023
@Bionic711
Copy link

I have been having the same issues and paid the $29 for developer support but it has not gone anywhere yet. My dev site is working as expected but my production site does not allow any of the authentication pages to log in users.

@nrandell
Copy link

nrandell commented Feb 5, 2023

I have been having the same issues and paid the $29 for developer support but it has not gone anywhere yet. My dev site is working as expected but my production site does not allow any of the authentication pages to log in users.

Sounds like it may be another problem. Make sure support are aware of this github issue as well. As far as I can see, our site has been working perfectly for the last 4 days.

@johnnyreilly
Copy link

Is this issue re-occurring? I'm experiencing issues. See also #1076

@jonnekleijer
Copy link

Not sure if this is related, but since a recent release of our app b2c keeps redirecting?
I opened a seperate ticket.

image

@StanSymphonia
Copy link

We're experiencing the original issue since yesterday (swa hosted in West Europe).

Any info or news would be greatly appreciated.

@TonyLunt
Copy link

TonyLunt commented Apr 1, 2024

We are also experiencing this intermittently in the East US 2 region.

@johhau
Copy link

johhau commented Apr 22, 2024

Same issue here since late last week. SWA hosted in West Europe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triaged
Projects
None yet
Development

No branches or pull requests