unexpected error.htm showing - (cache / viewstate ?)

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
12/20/2006 6:33:23 AM
Gravatar
Total Posts 5

unexpected error.htm showing - (cache / viewstate ?)

Hi all !

I'm a newbie in mojoportal.  I get the following errors so many times a day in my site (say  10 % of requests). I had some little experience with asp.net so I suspect it is about viewstate or maybe caching. I pasted corresponding lines below. (sorry if they are useless) Can anybody direct me (at least) about changing the caching / viewstate of pages and controls ?

thanks in advance

error lines from currentlog.config:

2006-12-20 11:13:52,623 [110560] ERROR mojoPortal.Web.Global [(null)] - /Default.aspx
System.NullReferenceException: Object reference not set to an instance of an object.
   at mojoPortal.Web.UI.Pages.SiteHome.LoadPage()
   at mojoPortal.Web.UI.Pages.SiteHome.Page_Load(Object sender, EventArgs e)
   at System.Web.UI.Control.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
2006-12-20 11:13:52,623 [110560] ERROR mojoPortal.Web.Global [(null)] - /Default.aspx
System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at mojoPortal.Web.UI.Pages.SiteHome.LoadPage()
   at mojoPortal.Web.UI.Pages.SiteHome.Page_Load(Object sender, EventArgs e)
   at System.Web.UI.Control.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   --- End of inner exception stack trace ---
   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)
12/20/2006 7:21:09 AM
Gravatar
Total Posts 18439

Re: unexpected error.htm showing - (cache / viewstate ?)

Hi Cemo,

I'm not sure what is causing that error. Can you tell me:
1. are you using the 2.1.8 release without any modifications? if not what modifications have you done?
2. which db are you using?
3. are you using something other than en-US for the default culture
4. can I see your site? maybe I can try different browser language settings and see if I can consistently produce the problem
5. Does it seem to be a random 10% of requests or can you identify anything else specific about the requests that cause the error?

Joe
12/20/2006 7:36:14 AM
Gravatar
Total Posts 5

Re: unexpected error.htm showing - (cache / viewstate ?)

Hi Joe,

I'm using IIS-6 with MS-SQL Server 2005 Express
The problem is random which makes things difficult :(
My locale is Turkey but I didn't change anything about that in the installation - that is auto:en-US
I'm sending my site address to your mail.

By the way is there a quick setting for viewstate ? Because very similar problem happened  to me in the past and it was about the viewstate of the controls in aspx pages.

The problem may be about my installation also. I just changed the db connection settings in web.config file after installation. I am not good at reading "readme.txt"s :)

Thanks in advance

cemo
12/20/2006 8:18:45 AM
Gravatar
Total Posts 18439

Re: unexpected error.htm showing - (cache / viewstate ?)

Hi Cemo,

There is nothing in your error that particularly makes me think it has anything to with viewstate (it still could but nothing jumps out at me and says viewstate is involved)
Its a null reference exception so some object is null during some requests which seems odd. I would expect that error would happen consistently if there is a problem. The only thing I can think of is if there were a missing key in the default resource file it might cause a null reference exception, though again I would expect that to happen for every request of whatever page it happened on.

I viewed the source of your page and posted it to the w3c xhtml validator page at http://validator.w3.org/check and it was invalid xhtml
The embed tag is not valid for xhtml, there may be some new alternative tag I'm not really sure. Itso looks like some of the markup in your content was pasted from ms word which makes notoriously bad html. Seeing things like class="MsoNormal" tells me this content came from MS Word.

If you don't care about xhtml compliance you can change the DOCTYPE in your layout.Master file to html instead of xhtml, and comment out the setting for xhtmlConformance in web.config

I'm not able to produce any errors in the browser when viewing your site either using english or turkish as the language preference. Are you seeing errors in the browser or only in the logs? I was testing with Firefox. Maybe I will try IE next.

Joe
12/20/2006 8:28:00 AM
Gravatar
Total Posts 18439

Re: unexpected error.htm showing - (cache / viewstate ?)

I can't produce any error in the browser with IE7 either.
The next thing I would do is look in your web logs (IIS logs not mojoportal logs) and look for requests that resulted in 500 error and see whether you can see a pattern. Is it s particular browser or anything else notable in the data logged for the requests that raised errors.

I still think the badly formed markup can be part of the problem so I would try to resolve that as well.

Hope it helps,

Joe
12/20/2006 8:51:20 AM
Gravatar
Total Posts 5

Re: unexpected error.htm showing - (cache / viewstate ?)

Thanks Joe,

I think you are right about that there is something wrong with my page contents. Because I did not see a single error until I added contents to my pages last night. (I mean when my site was empty)

I'll try to clean the invalid tags (dou you know a quick way ?)

I didn't understand the "xhtml compliance" issue. Is it the way I may try whether it helps about my problem or is it something different that you suggest me ? What do I loose if I ignore it ? (sorry for my terrible English)

And I suspect about the flash control on the home page. Can it be the problem ?

About reproducing the error, I really did not understand when it happens. But it happens in the browser, directing me to your generic error.htm page. Believe me it happens so much. I told my friends to test it and they tell me the same things as me. It is not about the browser itself. It happens with both IE and firefox.

best regards

cemo
12/20/2006 9:19:05 AM
Gravatar
Total Posts 18439

Re: unexpected error.htm showing - (cache / viewstate ?)

Sorry I don't know a quick way to clean it up.

XHTML is a newer (and stricter version) of markup that is meant to be a replacement for Html. It is better for accessibility and future preparedness of your site but there are still plenty of sites on the internet using some flavor of html so there is nothing especially wrong with using html but it is better in my opinion to get on board with the newer standard and try to achieve compliance

A couple of links:
http://www.webstartcenter.com/howto/xhtmVhtm.php
http://www.webstartcenter.com/howto/dtd.php

mojoPortal is designed to be Xhtml compliant but there is nothing preventing you from entering non-compliant markup into the content system such as through copy paste. Also nothing in mojoPortal prevents you from deciding to use html instead. The DOCTYPE is specified near the top of the layout.Master file in the skin and you can use any DOCTYPE you choose, see the link above about DOCTYPES or DTDs.

The xhtmlConformance tag in the web.config is for configuring the rendering of ASP.NET server controls. Setting it to strict as it is by default in the mojoPortal web.config tells the server controls to render themselves using xhtml compliant markup.

The only problem with the flash control is that it is added to the page with an embed tag which is not a valid tag in Xhtml. It has been deprecated according to this page (http://webdesign.about.com/od/htmltags/p/bltags_embed.htm), so things like flash should be added to the page with object tag instead: http://webdesign.about.com/od/htmltags/p/bltags_object.htm

When you are able to produce this error in the browser and it goes to the error page, does it only happen if using turkish language or does it happen also when using english?

Still I think the problem might go away after you clean up the markup.

Hope it helps,

Joe
12/20/2006 9:33:45 AM
Gravatar
Total Posts 5

Re: unexpected error.htm showing - (cache / viewstate ?)


I prepared the log files to send you - narrowing it to the one of the error times.

I am sending it now to your mail.

I will copy and paste the contents to vis.web dev. for compliance and invalid tag issues. Just one more question about this. If this invalid tag(s) occur on other pages, does it effect my home page ?

thank you very much

cemo
12/20/2006 10:29:04 AM
Gravatar
Total Posts 18439

Re: unexpected error.htm showing - (cache / viewstate ?)

Hi cemo,

Thanks for sending me your logs. In reviewing the mojoPortal log I see that some of the errors were coming from ForumPostEdit.aspx, then I noticed on your site that if I click the reply link without being logged in it causes an error every time. This appears to be a bug in mojoPortal as I am able to reproduce it here by configuring a forum to allow anonymous posts. I will look into fixing this for the next release, I have never allowed anonymous posts on my site so this bug must have crept in there somewhere along the way. For now I would recommend that you configure your forum to not allow anonymous posts and that will at least reduce the errors being logged.

I'm also looking into some of the other errors in your log and will email you about those.

Thanks,

Joe
12/20/2006 10:40:48 AM
Gravatar
Total Posts 5

Re: unexpected error.htm showing - (cache / viewstate ?)

thanks Joe

actually I was aware about that forum problem but it is consistent at least. I can reproduce it as well. But the other problem is really random that makes things difficult

regards

cemo
You must sign in to post in the forums. This thread is closed to new posts.