ASP.NET Core 2: Intermittent Correlation Failed Errors

I’ve gone through it 8-10 times now, normally it fails about 50% of the time, so I would say it’s currently not happening.

What could have changed? It seems that changing the timeout was the only variable… Other than. perhaps, not letting the server sit there idle for hours. Which would have the effect of perhaps shutting down the web server and causing compilation to occur the next time the site is visited. But that shouldn’t be causing an issue like this…

@nicolas_sabena I bumped the timeout up to an hour, and still no problems. What could have changed?

Quick update for anyone else who has this problem: login pages expire after 15m, and this happens any time you try to log in using a stale login page.

You can get to a stale login page in some unexpected ways. Leaving one open for 15m is the most obvious, but also the back button or perhaps a bookmark.

I am not sure how the session timeout part factored in. That did seem to have an effect at the time… That was some time ago however - maybe I was just wrong and I really was timing out somehow?

The best thing to do is handle the error in the IoC for auth0, like this: Add code showing how to handle remote auth errors · Issue #46 · auth0-samples/auth0-aspnetcore-mvc-samples · GitHub

It actually translates more like:

… Under options.Events = new OpenIdConnectEvents

                    // handle correlation failed errors caused by stale lock login pages.
                    OnRemoteFailure = (context) =>
                    {
                        if (context.Failure.Message == "Correlation failed.")
                        {
                            // [ log error ]
                            context.HandleResponse();
                            // redirect to some help page or handle it as you wish
                            context.Response.Redirect("/Account/CorrelationFailed");
                        }

                        return Task.CompletedTask;
                    }
2 Likes

I had two Service Fabric nodes and I was getting intermitent Correlation Failed errors. I’ve configured a common key ring and it works perfect now. Thanks a lot.

1 Like

Glad you made it work @jesuscampos1975!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.