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

HTTP 500 error (OSOE-633) #61

Closed
DemeSzabolcs opened this issue May 24, 2023 · 2 comments
Closed

HTTP 500 error (OSOE-633) #61

DemeSzabolcs opened this issue May 24, 2023 · 2 comments

Comments

@DemeSzabolcs
Copy link
Member

DemeSzabolcs commented May 24, 2023

The Privacy module sometimes throws the error below:

2023-05-04 21:20:31.6287|Redacted|Redacted||Microsoft.AspNetCore.Server.IIS.Core.IISHttpServer|ERROR|Connection ID "Redacted", Request ID "Redacted": An unhandled exception was thrown by the application. System.NullReferenceException: Object reference not set to an instance of an object.
   at Lombiq.Privacy.Startup.IsConsentNeededAsync(HttpContext httpContext) in E:\Projects\Redacted\Redacted\Redacted\src\Modules\Lombiq.Privacy\Lombiq.Privacy\Startup.cs:line 53
   at Lombiq.Privacy.Startup.<>c.<ConfigureServices>b__1_1(HttpContext context) in E:\Projects\Redacted\Redacted\Redacted\src\Modules\Lombiq.Privacy\Lombiq.Privacy\Startup.cs:line 42
   at Microsoft.AspNetCore.CookiePolicy.ResponseCookiesWrapper.get_IsConsentNeeded()
   at Microsoft.AspNetCore.CookiePolicy.ResponseCookiesWrapper.ApplyAppendPolicy(String& key, String& value, CookieOptions options)
   at Microsoft.AspNetCore.CookiePolicy.ResponseCookiesWrapper.Append(String key, String value, CookieOptions options)
   at Microsoft.AspNetCore.CookiePolicy.ResponseCookiesWrapper.Append(String key, String value, CookieOptions options)
   at Microsoft.AspNetCore.Authentication.Cookies.ChunkingCookieManager.AppendResponseCookie(HttpContext context, String key, String value, CookieOptions options)
   at Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler.FinishResponseAsync()
   at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.FireOnStarting()    at Lombiq.Privacy.Startup.IsConsentNeededAsync(HttpContext httpContext) in E:\Projects\Redacted\Redacted\Redacted\src\Modules\Lombiq.Privacy\Lombiq.Privacy\Startup.cs:line 53
   at Lombiq.Privacy.Startup.<>c.<ConfigureServices>b__1_1(HttpContext context) in E:\Projects\Redacted\Redacted\Redacted\src\Modules\Lombiq.Privacy\Lombiq.Privacy\Startup.cs:line 42
   at Microsoft.AspNetCore.CookiePolicy.ResponseCookiesWrapper.get_IsConsentNeeded()
   at Microsoft.AspNetCore.CookiePolicy.ResponseCookiesWrapper.ApplyAppendPolicy(String& key, String& value, CookieOptions options)
   at Microsoft.AspNetCore.CookiePolicy.ResponseCookiesWrapper.Append(String key, String value, CookieOptions options)
   at Microsoft.AspNetCore.CookiePolicy.ResponseCookiesWrapper.Append(String key, String value, CookieOptions options)
   at Microsoft.AspNetCore.Authentication.Cookies.ChunkingCookieManager.AppendResponseCookie(HttpContext context, String key, String value, CookieOptions options)
   at Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationHandler.FinishResponseAsync()
   at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.FireOnStarting()

The error seems to be happening after some time passing, 30-40 minutes.

There is a quick fix implemented for it (#60). The fix just requests consent consentService is null which would result in a new cookie popup, but it results in the following:

Now I tried logged in, unauthenticated too, and no repro (didn’t get a new cookie popup either though).

Guess:
The above mentioned fix, would make a new cookie popup appear when the error happens. Which didn't happen, so my guess is that the app enters Privacy's Startup.cs multiple times, consentService would be null (now it returns true with the above mentioned fix), but since it no longer fails, it enters again, and for some reason this time it loads the service, so it can get the saved value (this is why no new popup appears).

Jira issue

@github-actions github-actions bot changed the title HTTP 500 error HTTP 500 error (OSOE-633) May 24, 2023
@Piedone
Copy link
Member

Piedone commented May 24, 2023

This is here only if we see it happening again, can repro it reliably and thus need to implement a more proper fix.

@Piedone
Copy link
Member

Piedone commented Aug 8, 2023

We didn't see this since then.

@Piedone Piedone closed this as completed Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants