Custom 404

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
3/1/2009 7:04:00 AM
Gravatar
Total Posts 118

Custom 404

Is there something I need to do to get the custom 404 handler working - or have I broken something. I am just moving the site to its real address www.bhpc.org.uk and wonder if I have confused something.

 

Neil

3/1/2009 7:29:09 AM
Gravatar
Total Posts 18439

Re: Custom 404

Hi Neil,

Is this on Win 2008/IIS 7?

Are you sure you have the newest version of Web.config shipped with mojoPortal? It sounds like you are probably missing this:

<system.webServer>
<modules>...
<add name="PageNotFoundHandler" type="mojoPortal.Web.PageNotFoundHttpModule, mojoPortal.Web" /> 

Also make sure the file /PageNotFound.aspx exists.

Hope it helps,

Joe

3/1/2009 7:36:31 AM
Gravatar
Total Posts 118

Re: Custom 404

Yep - running on win2008, its the latest web.config, the entry is there - and the file exists.

Since moving it to the correct subdomain and making it live - it also has also started to recycle the application on a frequent basis. I have cleared the event log to try and get closer to whats happening.

 

Neil

3/1/2009 7:42:36 AM
Gravatar
Total Posts 18439

Re: Custom 404

Do you know if its running in Integrated Pipeline Mode or Classic? Integrated uses the system.Webserver section but Classic uses the  settings from system.web httpHandlers section.

Best,

Joe

3/1/2009 7:46:16 AM
Gravatar
Total Posts 118

Re: Custom 404

its running in integrated

3/1/2009 7:56:26 AM
Gravatar
Total Posts 118

Re: Custom 404

This is the error I am getting :-

An unhandled exception occurred and the process was terminated.

Application ID: /LM/W3SVC/2/ROOT

Process ID: 8068

Exception: System.SystemException

Message: docs out of order (0 < 3 )

StackTrace: at Lucene.Net.Index.SegmentMerger.AppendPostings(SegmentMergeInfo[] smis, Int32 n)
at Lucene.Net.Index.SegmentMerger.MergeTermInfo(SegmentMergeInfo[] smis, Int32 n)
at Lucene.Net.Index.SegmentMerger.MergeTermInfos()
at Lucene.Net.Index.SegmentMerger.MergeTerms()
at Lucene.Net.Index.SegmentMerger.Merge()
at Lucene.Net.Index.IndexWriter.MergeSegments(Int32 minSegment, Int32 end)
at Lucene.Net.Index.IndexWriter.Optimize()
at mojoPortal.Business.WebHelpers.IndexWriterTask.ProcessQueue(DataTable q, String indexPath)
at mojoPortal.Business.WebHelpers.IndexWriterTask.ProcessIndexingQueue()
at mojoPortal.Business.WebHelpers.IndexWriterTask.RunTask()
at mojoPortal.Business.WebHelpers.IndexWriterTask.RunTaskOnNewThread(Object oTask)
at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)

 

Any ideas ?

3/1/2009 7:59:35 AM
Gravatar
Total Posts 18439

Re: Custom 404

IIS will recycle whenever it reaches the memory limit specified for the app pool, maybe there is a low limit and it causes frequent recycling. There are other configuration settings in IIS that can also affect recycling, it can be configured to recycle after x requests, and/or x amount of time, and/or when memory usage reaches x amount.

Hope it helps,

Joe

3/1/2009 8:01:23 AM
Gravatar
Total Posts 18439

Re: Custom 404

I would rebuild the search index, first delete all rows from mp_IndexingQueue, then from mp_TaskQueue, then delete all index files and then do a search to rebuild it.

Hope it helps,

Joe 

3/1/2009 8:03:17 AM
Gravatar
Total Posts 118

Re: Custom 404

Where do I find theindex files

3/1/2009 8:04:22 AM
Gravatar
Total Posts 118

Re: Custom 404

found them

3/1/2009 8:08:19 AM
Gravatar
Total Posts 18439

Re: Custom 404

There is also a secret button you can make visible for rebuilding the index if you put this in user.config:

<add key="ShowRebuildSearchIndexButtonToAdmins" value="true" />

I hide it by default because its not something that people should click often and I'm afraid making it visible will make people think its no big deal to click it. Uses it when you have a good reason like fixing a problem but leave it alone in general.

Best,

Joe

3/1/2009 8:12:16 AM
Gravatar
Total Posts 118

Re: Custom 404

how long should it take - appears to have been stuck on the following for a few minutes

Task Name Queued Started Last Update Progress Status
Loading...
mojoPortal.Business.WebHelpers.IndexWriterTask, mojoPortal.Business.WebHelpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 01/03/2009 14:07:53 01/03/2009 14:07:53 01/03/2009 14:08:53 0% Running. Indexed item 0 of 709
WebTaskManager 01/03/2009 14:08:57 01/03/2009 14:08:57 01/03/2009 14:10:57 50% Running

 

3/1/2009 8:22:50 AM
Gravatar
Total Posts 18439

Re: Custom 404

It can take a while and its possible things can go wrong. If no index files exist when you doa search it will kick off a task to rebuild it, it first writes to the database in the mp_IndexingQueue, after that it starts a task on a background thread to process that queue in sequence creating/writing to the index.

So if timing is not just right, and another search is made before the first indexed files appear it can get out of sync and out of step because it may start another round to try and build it whhile it was just getting ready to write the files.

It will always log at least one index error when you rewbuild because at first the index doesn't exist so it traps that error and logs it then creates the index.

If things get out of wack you need to:

1. recycle the app

2. clean out the mp_IndexingQueue and mp_TaskQueue tables again and retry with the rebuild button or by delete/search

Once it is running leave it alone and give it 10-15 minutes. You can watch the log while it runs but don't do searches until its done.

if the app pool is already recycling frequently it could also cause some problems with writing to the search index. It should be able to resume but its dodgy because recycling the app kills tha background thread that is doing the work.

Its also possible to rebuild an index on a different machine with a copy of the site and db that is up to date and then upload the index files removing any that are already there. I've done it before but its best if it can be built right on the site.

Hope it helps,

Joe

 

3/1/2009 10:31:27 AM
Gravatar
Total Posts 118

Re: Custom 404

Well - it appears to have sorted itself out now - had to delete the blog posts though as I was getting allsorts of errors when trying to edit them. Not really sure why it would be

 

Neil

ps - Joe - you can add it to the list of live Mojoportal sites now

3/1/2009 10:50:28 AM
Gravatar
Total Posts 18439

Re: Custom 404

Glad its working! I've added it to the list.

Best,

Joe 

3/1/2009 10:52:10 AM
Gravatar
Total Posts 18439

Re: Custom 404

Looks really nice! A very interesting club!

Cheers,

Joe 

10/13/2009 1:33:43 PM
Gravatar
Total Posts 43
Partner

Re: Custom 404

I give up... where can this secret "ShowRebuildSearchIndexButtonToAdmins" button be found once I set the value to true?

10/13/2009 1:43:55 PM
Gravatar
Total Posts 18439

Re: Custom 404

On the /SearchResults.aspx page

Best,

Joe

10/13/2009 1:51:08 PM
Gravatar
Total Posts 43
Partner

Re: Custom 404

Found it thanks.  I turned that feature off.  I was expecting to see it in the administrative section.  We have to clear the index folder every couple months.  Usually as a result of a file lock or R/W access.

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