0

I'm getting below error in 10 % of my requests on production env.

"error": "[ProgressEvent]",
"headers": "[ti]",
"message": "Http failure response for https://api.xxxxxx:5000/api/public-web/files: 0 Unknown Error",
"name": "HttpErrorResponse",
"ok": false,
"status": 0,
"statusText": "Unknown Error",
"url": "https://api.xxxxxx:5000/api/public-web/files"

Logs are from Sentry.
Stack:

  • Angular 15 - Universal
  • .Net Core 6
  • Server: IIS 10

Firstly, I was thinking an issue is related to the CORS but although that I had already configured CORS on backend side, I've also added following to all response headers on the server in web-config (IIS):

access-control-allow-headers: *
access-control-allow-methods: GET,POST,PATCH,PUT,DELETE,OPTIONS
access-control-allow-origin: *

I've covered CORS just on the IIS with above custom headers in web.config, not on the application side.

Also I've read that it might be related to the bad internet connection (as per Angular official documentation) but that is not an issue here (maybe but just in 1% of 10% of cases).

Users have tried to change their network connection from WIFI to mobile but still the same issue appears.

  • Maybe you can take a look at similar thread about CORS issue: https://stackoverflow.com/questions/31612931/cors-issue-on-localhost-while-calling-rest-service-from-angularjs – YurongDai Dec 01 '22 at 07:08
  • @YurongDai On my side it's not happening on the localhost but on production env. Should not be due to CORS, because as I said I've added custom headers in IIS configuration (web-config). – mmiroslav13 Dec 01 '22 at 08:21
  • Open the website, try to reproduce the problem and check your browser's console for error messages. – YurongDai Dec 02 '22 at 09:08
  • @YurongDai I've tried that many times, from many different browsers and devices (BrowserStack) and I still didn't succeed to reproduce an issue. For Log Management I'm using Sentry and I've attached the logs that I'm getting (Uknown error (ProgressEvent)). – mmiroslav13 Dec 02 '22 at 13:05
  • I don't want to catch you off-guard, but I've noticed that there's some problems after deploying an ASP.NET Core + Angular + Universal project in release configuration. Still trying to figure this out. It's odd since my project (deployed some time ago) still runs fine... – Pieterjan Dec 02 '22 at 13:30
  • @Pieterjan Me to... Still it's happenning randomly and now I'm again suspect it's a CORS issue even it should not be since it's working for 90%+ of users, but how knows.. – mmiroslav13 Dec 07 '22 at 08:27
  • For us, it is impossible to reproduce your problem, I suggest you open a case via: https://support.microsoft.com. – YurongDai Dec 14 '22 at 08:03

0 Answers0