`InvalidOperationException` due to failing `VerifyIntegrity`
See original GitHub issueOur Web Server code uses AngleSharp to do various HTML cleanup and Colourization. Today we start to get InvalidOperationExceptions on only 1 of our 6 servers From the stack trace, it looks like something might be missing some error handling.
Exception of type ‘System.InvalidOperationException’ was thrown.
at System.Runtime.CompilerServices.ConditionalWeakTable`2.VerifyIntegrity()
at System.Runtime.CompilerServices.ConditionalWeakTable`2.TryGetValue(TKey key, TValue& value)
at System.Runtime.CompilerServices.ConditionalWeakTable`2.GetValue(TKey key, CreateValueCallback createValueCallback)
at AngleSharp.Css.StyleAttributeObserver.AngleSharp.Dom.IAttributeObserver.NotifyChange(IElement host, String name, String value)
at AngleSharp.Dom.Element.SetupElement()
at AngleSharp.Html.Dom.HtmlImageElement.SetupElement()
at AngleSharp.Html.Parser.HtmlDomBuilder.CloseCurrentNode()
at AngleSharp.Html.Parser.HtmlDomBuilder.InBodyStartTagBreakrow(HtmlTagToken tag)
at AngleSharp.Html.Parser.HtmlDomBuilder.InBodyStartTag(HtmlTagToken tag)
at AngleSharp.Html.Parser.HtmlDomBuilder.Parse(HtmlParserOptions options)
at AngleSharp.Html.Parser.HtmlParser.Parse(HtmlDocument document)
at CodeProject.Modules.Articles.Article.get_FormattedContent()
Issue Analytics
- State:
- Created 3 years ago
- Comments:17 (17 by maintainers)
Top Results From Across the Web
c# - InvalidOperationException in my Lazy<> value factory
It turned out that this error only occurred when trying to inspect the Value property of the Lazy<> in the Visual Studio debugger....
Read more >Major Install Problem With VS Community 2019 (or 2017) ...
Error: Unable to verify the integrity of the installation files: the certificate could not be verified. VisualStudio Bootstrapper:25/01/2021 11: ...
Read more >Verify Integrity of Game Files
One or more files may fail to verify. This is normal for most Steam games. The files that fail to verify are local...
Read more >System.InvalidOperationException
Goto My Library on Steam. Right-Click Terraria and Select Properties. Goto Local Files Tab. Now Select Verify Integrity of Game Cache. If you ......
Read more >Package installation keeps failing - Something Else
The feed is either invalid or required packages were removed while the current operation was in progress. Verify the package exists on the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FYI, I’ve eliminated all code that could cause Thread Aborts and the issue has not been observed since.
I though you might be using the same value for multiple IDocuments based on the implementation of Document.Equals.
I’ve tracked down how the CWT is being corrupted.
When we load an Article for display, we use AngleSharp to format/sanitize the HTML content of the article if it hasn’t been cached recently. There are a few pages that load a lot of Articles, and under high load, these pages are timing out, usually in the formatting methods. When a page times out, it throws a ThreadAbortException, and because of where the code is executing there is a better chance than average of the exception being thrown while in the CWT code, causing the CWT corruption.
This may be causing issues in other libraries we are using, and I am investigating, Probably will need to write a Tip/Article about this.