Errors on view a post

Topics: ASP.NET 2.0
Mar 5, 2010 at 10:17 PM

Hi All recently moved to version 1.6 and seem to be having a few teething issues...

http://blog.deer-park.co.uk/

Any time i click on a post i'm getting the "opps" error even though i have set the webconfig to show errors...wierd.

When i ADD a new post i get the same error but the post does get added when i do a fresh on the home page, do i have a bug or an incorrect setting??

Regards,

Stephen

 

 

Coordinator
Mar 6, 2010 at 2:36 AM

It's not just viewing individual posts that are resulting in errors, also trying to view other types of pages too result in this error:

All posts for March 2010
http://blog.deer-park.co.uk/2010/03/default.aspx

News category posts
http://blog.deer-park.co.uk/category/News.aspx

It looks like it's the virtual URLs that are resulting in error 500.

Are you using the web.config and global.asax files that come with BE 1.6?

Do you also have the error.aspx and error.aspx.cs files in the root of your blog?  These two files are new with BE 1.6.  These two files plus the global.asax file that comes with BE 1.6 includes error handling code that is supposed to display the details of a 500 error directly on the web page (error.aspx).

Mar 7, 2010 at 10:28 PM

Hi Ben,

Thanks for posting some suggestions.  Yes I am using the web.config and glbal.asax files that come with 1.6, just checked that on the live server.  I can also see the error.aspx and cs files in the root of the blog also.

The blog folder is running within the main site folder, i.e D:\vhosts\deer-park.co.uk\httpdocs\blog

but i have done this with another site on the server without any problem although that's using verison "Powered by BlogEngine.NET 1.5.1.42".

I only ever seem to get the frienly error without any of the error details, even when i run the blog locally on my development machine.

Thanks again,

Stephen

 

 

 

Mar 7, 2010 at 11:01 PM

StephenD, you may already know this, but the error page only shows the error details when you're logged in to BE as an Administrator.  If you're not logged in then it won't show the error details.

If you didn't know this, then I hope it helps... otherwise never mind :p

Also,l I would suggest turning on the Logger extension (and enable logging in the settings).  Then check /App_Data/logger.txt for the details.

Mar 7, 2010 at 11:28 PM

I did not realise that Creepin, thanks for the heads up!  Here is the error I'm getting..

Error Details:

Url : http://blog.deer-park.co.uk/post.aspx?id=e071cb15-f66a-482f-92c6-1fdf043798a2

Raw Url : /post/Freddie-Mercury-Tribute-Night.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.post_aspx.ProcessRequest(HttpContext context) in c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\fb37cb1c\6ccdbc1f\App_Web_nyizxj6n.10.cs:line 0

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 : Cannot use a leading .. to exit above the top directory.

Source : System.Web

StackTrace : at System.Web.Util.UrlPath.ReduceVirtualPath(String path)

at System.Web.Util.UrlPath.Reduce(String path)

at System.Web.Util.UrlPath.Combine(String appPath, String basepath, String relative)

at System.Web.UI.Control.ResolveClientUrl(String relativeUrl)

at System.Web.UI.WebControls.Image.AddAttributesToRender(HtmlTextWriter writer)

at System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer)

at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer)

at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)

at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)

at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)

at System.Web.UI.WebControls.HyperLink.RenderContents(HtmlTextWriter writer)

at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer)

at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)

at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)

at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)

at ASP.themes_deerpark_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in d:\vhosts\deer-park.co.uk\httpdocs\blog\themes\DeerPark\site.master:line 25

at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)

at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)

at System.Web.UI.Control.Render(HtmlTextWriter writer)

at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)

at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)

at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)

at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)

at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)

at System.Web.UI.Page.Render(HtmlTextWriter writer)

at BlogEngine.Core.Web.Controls.BlogBasePage.Render(HtmlTextWriter writer) in C:\Data\Development\BlogEngine.NET\BlogEngine\DotNetSlave.BusinessLogic\Web\Controls\BlogBasePage.cs:line 333

at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)

at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)

at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

TargetSite : System.String ReduceVirtualPath(System.String

Mar 8, 2010 at 12:57 AM
StephenD wrote:

I did not realise that Creepin, thanks for the heads up!  Here is the error I'm getting..

Error Details:

Url : http://blog.deer-park.co.uk/post.aspx?id=e071cb15-f66a-482f-92c6-1fdf043798a2

Raw Url : /post/Freddie-Mercury-Tribute-Night.aspx

Message : Exception of type 'System.Web.HttpUnhandledException' was thrown.

...

Message : Cannot use a leading .. to exit above the top directory.

Source : System.Web

StackTrace : at System.Web.Util.UrlPath.ReduceVirtualPath(String path)

at System.Web.Util.UrlPath.Reduce(String path)

...

It looks like the error is coming from a file path starting with "../" (meaning 'up a level') but it is trying to get above the root.  Usually this won't cause an error in HTML, but I think from the "System.Web.Util.UrlPath.ReduceVirtualPath(String path)" method that's being used, it's causing an error in ASP.NET (hence the error page).

I think you'll find that any page that tries to show this post (Freddie-Mercury-Tribute-Night.aspx) will throw this error - you can check by editing the post and setting it to un-published, then sign out so it is hidden.  If all the pages work then we can be fairly sure it's something in that post causing the error.  The next step is to check the post for file path issues as mentioned above.  Remeber that starting a link with a slash "/" will  mean 'start at root', so if you were using the leading ../ to find your way to the root of your site, try using a path from root.

Hope that helps :)

Mar 10, 2010 at 9:00 PM

Still on the hunt to fix this one...if i click on any of my blog posts I am getting that same error or if i click on the categories etc...could it be ther version?

 

Regards,

 

Stephen

Mar 10, 2010 at 10:44 PM

If it's on every post, it could be something in your PostView.ascx file in the theme you use.  Try changing to a different theme - do you still get the error?

Mar 10, 2010 at 11:34 PM
CreepinJesus wrote:

If it's on every post, it could be something in your PostView.ascx file in the theme you use.  Try changing to a different theme - do you still get the error?

My guess would be the masterpage, on line 25....

at ASP.themes_deerpark_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in d:\vhosts\deer-park.co.uk\httpdocs\blog\themes\DeerPark\site.master:line 25

Mar 11, 2010 at 1:58 AM
fstanek wrote:
CreepinJesus wrote:

If it's on every post, it could be something in your PostView.ascx file in the theme you use.  Try changing to a different theme - do you still get the error?

My guess would be the masterpage, on line 25....

at ASP.themes_deerpark_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in d:\vhosts\deer-park.co.uk\httpdocs\blog\themes\DeerPark\site.master:line 25

 Or that, yes.... ;)

Mar 11, 2010 at 9:17 AM
Edited Mar 11, 2010 at 12:00 PM

I think that was a red herring...there is no error on that line and now I'm getting a problem with BlogBasePage.cs:line 333

at BlogEngine.Core.Web.Controls.BlogBasePage.Render(HtmlTextWriter writer) in C:\Data\Development\BlogEngine.NET\BlogEngine\DotNetSlave.BusinessLogic\Web\Controls\BlogBasePage.cs:line 333

at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)

at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)

at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

TargetSite : System.String ReduceVirtualPath(System.String)

 

I think i will try get the latest version build it an reupload...bit of a headache though...would like to know that the issue is.

 

I should add that the blog runs perfectly on my local machine....

Cheers,

 

Mar 12, 2010 at 10:35 AM

Just wanted to let everyone know that in finally found out what the issue was.  I used an .net hyperlink control at the footer of my theme which used an imageURL to display an image which ran fine on my local machine but was not liked on my live server.

 

Not sure if this is a Blog issue or a server issue but its sorted now.

 

Regards,

 

Stephen