Applicationinsights-js: [BUG] Suddenly cannot load ai.2.min.js anymore due to CORS error

Created on 17 Mar 2021  路  15Comments  路  Source: microsoft/ApplicationInsights-JS

Description/Screenshot
Since yesterday there seems to be an issue when using the JS-Snippet based setup as the js file cannot be loaded anymore due to a CORS error.
image

Steps to Reproduce

  • OS/Browser: Edge (tried different versions)
  • SDK Version [e.g. 22]: Latest snippet from the github repo here
  • How you initialized the SDK: snippet, without any changes

Expected behavior
The js file should load.

Additional context
Seems seems to have worked totally fine until ~ 8pm UTC on March 16 - as I can tell by my telemetry flow into AppInsights
image

tagging @MSNev for visibility

bug cdn issue mitigated p1 production

Most helpful comment

@MSNev I can confirm, it just started to work again for me! :)

All 15 comments

We're experiencing exactly the same issue, since around exactly the same moment.
We're using the snippet based setup and by coincidence we found that removing the 'crossOrigin: "anonymous"' parameter the issue seems to go away, which is totally unexpected to us.
The issue is reproducible on Chrome & FF as well.

I have the same problem with:

src: "https://az416426.vo.msecnd.net/scripts/b/ai.2.min.js",crossOrigin: "anonymous",

And also with the new version:

src: "https://js.monitor.azure.com/scripts/b/ai.2.min.js",crossOrigin: "anonymous",

Using Google Chrome and FF.

good to know that the error is not on my side :) I'll also open a support case on this

Everybody who has additional details to add, please do so on this thread

Any update ?

Investigating

The issue is that yesterday we changed the storage account that is used as the origin for the CDN to a new definition, however, this new definition did not have it's CORS configuration set correctly -- I've now updated it.

Based on the define TTL that was listed the CDN's may cache this for up to 60 minutes.

Please let us know if the issue doesn't resolve in this timeframe

thanks @MSNev for the quick turnaround! I'll watch out if it resolves in the next hour

I have the same problem with:

src: "https://az416426.vo.msecnd.net/scripts/b/ai.2.min.js",crossOrigin: "anonymous",

And also with the new version:

src: "https://js.monitor.azure.com/scripts/b/ai.2.min.js",crossOrigin: "anonymous",

Using Google Chrome and FF.

For everyones reference, both of these CDN endpoints are backed by the same storage, this enables us to publish once and both endpoints get the new bit

@MSNev I can confirm, it just started to work again for me! :)

The change of the file storage is a one-off and is not something that should normally occur it was caused by adding additional resiliency, so that we can recover automatically from

  • CDN provider issue (the new js.monitor.azure.com domain only)
  • A storage account regional outage (all domains), we now have multiple regions so we can switch to a different region in the event of some form of regional based outage.

I'll leave this issue open until tomorrow, so if anyone else continues the have the issue you can comment and I'll keep an eye on it.

Confirmed: Working Again.

Thanks

Based on investigations into how we can identify this sort of issue sooner both on our side and on yours, if you update your snippet to the current version (currently version 5), this will report this sort of error directly as outlined here https://github.com/microsoft/ApplicationInsights-JS/blob/master/docs/SdkLoadFailure.md

ReadMe version:
https://github.com/Microsoft/ApplicationInsights-JS#snippet-setup-ignore-if-using-npm-setup

Checked in version:
https://github.com/microsoft/ApplicationInsights-JS/blob/master/AISKU/snippet/snippet.min.js

With previous versions (< v3) this sort of error goes completely un-reported and no-one has direct visibility (except for the drop in reported telemetry)

Closing as no additional reports and local monitoring are not showing any further issues.

Was this page helpful?
0 / 5 - 0 ratings