Can't upgrade from 1.4.5

Topics: ASP.NET 2.0
Nov 8, 2010 at 8:42 PM

Hello,

I have a blog in version 1.4.5 with SQL Server database.
I am trying to upgrade to 1.6 but encounter a weird error.

I have run both scripts : MSSQLUpgradeTo1.5.0.0From1.4.5.0.sql and MSSQLUpgradeFrom1.5To1.6.sql.
I have updated the website and Web.config and deleted the ExtensionManager folder.

After update, I can't display any page of the blog.
Instead of displaying the page, all I get is scrambled text like this :

�`I�%&/m�{J�J��t��`$ؐ@�����iG#)�*��eVe]f@�흼 ��{���{��;�N'���?\fdl��J�ɞ!���?~|?"��Ey�')=��y6����h����z��<=��~|W>�Z5�u�A:�f��/>����y�(��G�d^ϲe��!z���Ѳ�Y)5�

The pages don't even have HTML structure, it looks like a dump of a binary file...

The problem seems related to my existing database because when I switch my the defaultProvider from DbBlogProvider to XmlBlogProvider, the blog displays fine with the default post...

Any clue would be really appreciated.
Thanks in advance !

Coordinator
Nov 8, 2010 at 10:31 PM

In the global.asax file in the blog root, I would comment out or remove this line:

// context.Server.Transfer("~/error.aspx");

Then in the web.config file, I would change the custom errors mode from RemoteOnly to Off (note, it's case sensitive).

<customErrors mode="Off" defaultRedirect="~/error404.aspx">

These changes should hopefully lead to a meaningful error message to appear.

Nov 8, 2010 at 11:11 PM

Custom errors were already off.
I commented the line in global.asax, but sadly I still get the scrambled text..

Nov 9, 2010 at 9:52 AM

I have another clue that my current database is the culprid.
If I create a new database with the script MSSQLSetup1.6.0.0.sql, then everything works fine.

I compared woth databases and the schema is the same.
There must be something wrong with my data, but I don't know what it is...

Anyawy, do you know what the scrambled text could be? I've never met such a behavior on a website, this is really strange.

Coordinator
Nov 9, 2010 at 5:38 PM

The garbage text is something that I've seen with BE many times.  It shows up when an unhandled error occurs.  Depending on where the error is occurring, you'll sometimes get a more normal error message, and sometimes you'll get those garbage characters.

You could try replacing the Application_Error handler in the global.asax file with the one below.  It might work better.  I think what might be happening now is that the unhandled error occurs, Application_Error is picking this up, but then another unhandled error is occurring within that.

If you cannot get an actual error message, you could try deleting data out of the be_DataStoreSettings table.  I think someone else recently had a problem with data in that table that caused an error.  Not sure if that's the case here too.  Extension and widget data is in that table.  Probably only deleting the Extension data is necessary (I'm guessing the widget data is okay).  So the DELETE statement would be:

delete be_DataStoreSettings where ExtensionType = 0

... and here's that modified Application_Error handler for the global.asax file you could try using before deleting any data.

void Application_Error(object sender, EventArgs e)
{
	HttpContext context = ((HttpApplication)sender).Context;
	Exception ex = context.Server.GetLastError();
	if (ex == null || !(ex is HttpException) || (ex as HttpException).GetHttpCode() == 404)
	{
		return;
	}
	StringBuilder sb = new StringBuilder();

	try
	{
		sb.AppendLine("Url : " + context.Request.Url);
		sb.AppendLine("Raw Url : " + context.Request.RawUrl);

		while (ex != null)
		{
			sb.AppendLine("Message : " + ex.Message);
			sb.AppendLine("Source : " + ex.Source);
			sb.AppendLine("StackTrace : " + ex.StackTrace);
			sb.AppendLine("TargetSite : " + ex.TargetSite);
			ex = ex.InnerException;
		}
	}
	catch (Exception ex2)
	{
		sb.AppendLine("Error logging error : " + ex2.Message);
	}

	context.Response.Clear();
	context.Response.Write(sb.ToString());
	context.Response.End();
}

Nov 9, 2010 at 11:54 PM

You're right, your new error handler displayed the actual error instead of garbage text.

This helped me to correct the problem.
I had simply forgotten to reinstall my theme...
Once I had reset the "theme" value to "Standard" in "be_Settings" table, everything worked just fine.

Thanks a lot for your help !!!

Mar 5, 2011 at 4:37 AM

Thanks for the code BenAmada!

Mar 5, 2011 at 5:35 AM
Edited Mar 5, 2011 at 5:37 AM

The error message I'm getting after introducing your code is:

Url : http://intuitionlogic.com/default.aspx Raw Url : /default.aspx Message : Exception of type 'System.Web.HttpUnhandledException' was thrown. Source : System.Web StackTrace : at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.default_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) TargetSite : Boolean HandleError(System.Exception) Message : Operation could destabilize the runtime. Source : BlogEngine.Core StackTrace : at BlogEngine.Core.Utils.ParseEnum[T](String value, T defaultValue) at BlogEngine.Core.SecuritySiteMapProvider.IsAccessibleToUser(HttpContext context, SiteMapNode node) in E:\Projects\BlogEngine-HG-10\Source\BlogEngine\BlogEngine.Core\Security\SecuritySiteMapProvider.cs:line 35 at System.Web.SiteMapNode.IsAccessibleToUser(HttpContext context) at System.Web.StaticSiteMapProvider.GetChildNodes(SiteMapNode node) at System.Web.SiteMapNode.get_ChildNodes() at Admin.Menu.BindMenu() at Admin.Menu.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) TargetSite : T ParseEnum[T](System.String, T)

That is, it seems to be related with SiteMap security. In my case, I'm not doing any upgrade. This is my first try at BE and I'm trying to deploy it to WinHost.

Any help with that would be totally appreciated!

Albino

Coordinator
Mar 5, 2011 at 5:51 AM

Albino, see this message.  You can copy and paste the contents for the web.sitemap that I posted into your web.sitemap file (replacing the contents in your file).

Mar 5, 2011 at 5:58 AM

I have a similar problem but I am using the xml provider. Would you please tell me what would be equivalent to the delete be_DataStoreSettings where ExtensionType = 0 command in the xml files?

Mar 5, 2011 at 6:09 AM
Edited Mar 5, 2011 at 6:10 AM

BenAmada, thank you very much! Everything is working perfectly now!

I hope I get the opportunity to pay you a beer :-)