Posts get corrupted

Topics: Business Logic Layer
Mar 1, 2008 at 9:19 PM
Edited Mar 25, 2008 at 6:11 AM
I've now twice tried having a blogpost get corrupted and bringing down the entire website.

For whatever reason, one of the blogposts in App_Data suddenly contained only this:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<title>This is yet another blog post</title>
<description />

All the contents, comments etc were lost.

I have no idea how this happened (it was not while I was editing the blog), but I have a feeling it has something to do with when someone comments or pings the post (although that usually works).

After this, the entire website crashes, and I either have to reconstruct the blogpost or delete the post to get the site back up and running.

Has anyone else experienced this?

This is really annoying and means that I have to constantly make backups to preserve comments etc.

I wish I could be more specific as to what caused this. I'm willing to add some logic in there to try and catch and log this, if someone could point me to the places where this could have occured.

I'm running v1.3
Mar 25, 2008 at 6:10 AM
Make that 3 times :-(
Apr 2, 2008 at 12:14 AM
Ehm 4. times. This is really getting annoying. Lost a lot of good recent comments this time.
Apr 3, 2008 at 5:06 PM
And yet again. This is REALLY annoying !!!

Anyone who knows the internals of BlogEngine PLEASE tell me about possible places where such a corruption could occur, so I can start putting in some code to track what's going on.
Apr 3, 2008 at 8:43 PM
Edited Apr 3, 2008 at 8:44 PM
I'm not a BlogEngine expert - I've only begun exploring it. I can only try and help you to troubleshoot.

To rephrase a bit (to make sure I understand): (likely) sometimes when comments/pings get added to your posts, the post's xml file gets corrupted and renders BlogEngine non-funcitonal (requiring you to redo the post).

Some ideas to get more info:
  • Move to use the SQL Provider, see if corruption persists
  • Rule out something on the server HW itself. Is there anything in the event logs? Can you move the web site to a different server temporarily? Run HW checks - like a memory test & defrag. Also monitoring performance...
  • Has there been a spike in traffic to your site? Maybe more traffic has caused issues.
  • Anything in the IIS logs around the time when it fails? Look at scripts being accessed, timings (users submitting comments at the same time?) and maybe client's IPs (maybe it's something specific a visitor is doing, or specific to a user agent configuration)

Assuming that it's when comments are added, you can look for AddComment (implemented in post.cs) and see where it's called, and try and log more info - maybe try and work your way up to the entry points where it might be called in the post/pingback/trackback logic.