This project is read-only.

Error using SQL, not there using XML

Oct 26, 2010 at 7:20 PM

I want to use SQL Server for my data store for BlogEngine.  I am testing it now and for the most part things are working pretty well.  However, when a comment is submitted, I get an error message saying "There was an error in the callback."  The thing is, the comment DOES get saved but the notification email does NOT get sent.  When I test this using XML as the data store, this error message does not happen.


Oct 27, 2010 at 6:09 AM

Not sure, but you could try disabling the SendCommentMail extension (on the Extensions tab), to see if the error continues.  The error may or may not be related to the SendCommentMail extension.  It could be an error that occurs after the comment is saved, but before the comment notification email gets sent out.

I would maybe go thru the Settings (email settings and others too) to make sure it looks okay and filled out.  There shouldn't be much of a difference between XML and SQL when it comes to saving a comment.  It could be some setting that is set one way for XML, and set differently or incorrectly for SQL.  Just throwing out some wild guesses.

Oct 28, 2010 at 12:48 AM

In further testing, it wasn't sending the email because I had the "noreply" address in there (that's a separate issue).  So when I put my email address in there, I still got the "callback error" message, but the email got sent and the comment still gets saved.  Again, this doesn't happen using XML as the data store, only SQL.

Oct 28, 2010 at 4:21 AM

One thing I would do is disable extensions on the extensions tab.  Specifically any comment filtering extensions like Akismet Filter, Typepad Filter, Simple Captcha, Recaptcha.  Akismet filter in particular can throw errors if its enabled and there isn't a valid API key entered in for it.

Oct 28, 2010 at 6:26 PM

I went and compared all of the settings between using XML and SQL.  I made sure the settings using SQL matched those of the XML settings.  This made no difference.  So then I tried your suggestion of disabling extensions.  Out of the box, Akismet was already disabled so I know that wasn't it.  I went down the list one by one, trying a comment post after each one but there was no change until I got to ReCaptcha.  Once I disabled that, I no longer get the "callback error" message.  The problem is that I need to use anti-spam so having that disabled isn't really a solution to the problem.  I don't understand why this doesn't occur using XML but it does using SQL.  It seems like it shouldn't be related to that at all.  This is the only things preventing me from putting this into production right now.

Help? Anybody?

Oct 28, 2010 at 7:34 PM

OK, I set the project up in VS2008 so that I could run it in debug mode.  Where it is stopping is in the file App_Code/Extensions/ReCaptcha/ReCaptchaControl.cs on this line:

Stream s = (Stream)BlogService.LoadFromDataStore(BlogEngine.Core.DataStore.ExtensionType.Extension, "RecaptchaLog"); in the UpdateLog method.

The error is "Unable to cast object of type 'System.String' to type 'System.IO.Stream'."


Oct 28, 2010 at 8:16 PM

Glad you debugged to discover that.  That was fixed after 1.6.1 was released.  This post here seems to fix it.  You can use that fix without needing to do a full upgrade to the latest developer build.

Oct 28, 2010 at 9:16 PM

Ben, thanks for the link to that code.  In looking into it further, that section of code only gets hit if you are logging reCaptcha.  I set it to not log and the error doesn't happen.  Also, instead of replacing the "Stream s" with "string s", it seems like you could check the data store type and branch to either block of code based on that.  Is that how it's fixed in the next build?

Thanks again for your on to the next issue...