change in web.config file for custom 404 error throws internal server error

Topics: Core, Customizing Orchard, General, Troubleshooting, Writing modules
Jan 19, 2012 at 7:02 PM

I changed web.config file so that I can display custom 404 error but it worked well for some time and now I am getting internal server error 500.0.

I cannot open the website.What could be the reason?

Jan 19, 2012 at 7:20 PM

Do you have any errors in App_Data\Logs?

Jan 20, 2012 at 1:58 PM

oh yes I have error in log file what does it means?

Today for sometime it run perfect but now I am getting the same error.

Jan 20, 2012 at 2:26 PM

It means there's an error. I don't know what it is if you don't post it here.

Jan 20, 2012 at 2:37 PM

Below is the error.Also sometimes I get 310 error (too many redirect to 404.html page)instead of custom 404 page and to get rid of it I have to clear browsing history,cookies,Is there any solution of it?

 

 

2012-01-20 08:52:20,216 [7] Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator - ArgumentNullException thrown from IContentPartDriver by Szmyd.Orchard.Modules.Menu.Drivers.BreadcrumbsPartDriver
System.ArgumentNullException: Value cannot be null.
Parameter name: source
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Szmyd.Orchard.Modules.Menu.Drivers.BreadcrumbsPartDriver.Display(BreadcrumbsPart part, String displayType, Object shapeHelper)
   at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
   at Orchard.ContentManagement.Drivers.ContentPartDriver`1.Orchard.ContentManagement.Drivers.IContentPartDriver.BuildDisplay(BuildDisplayContext context) in d:\Builds\OrchardFull\src\Orchard\ContentManagement\Drivers\ContentPartDriver.cs:line 20
   at Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator.<>c__DisplayClassa.<BuildDisplay>b__9(IContentPartDriver driver) in d:\Builds\OrchardFull\src\Orchard\ContentManagement\Drivers\Coordinators\ContentPartDriverCoordinator.cs:line 45
   at Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable`1 events, Action`1 dispatch, ILogger logger) in d:\Builds\OrchardFull\src\Orchard\InvokeExtensions.cs:line 19
2012-01-20 09:17:08,289 [9] Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator - ArgumentNullException thrown from IContentPartDriver by Szmyd.Orchard.Modules.Menu.Drivers.BreadcrumbsPartDriver
System.ArgumentNullException: Value cannot be null.
Parameter name: source
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Szmyd.Orchard.Modules.Menu.Drivers.BreadcrumbsPartDriver.Display(BreadcrumbsPart part, String displayType, Object shapeHelper)
   at Orchard.ContentManagement.Drivers.ContentPartDriver`1.Orchard.ContentManagement.Drivers.IContentPartDriver.BuildDisplay(BuildDisplayContext context) in d:\Builds\OrchardFull\src\Orchard\ContentManagement\Drivers\ContentPartDriver.cs:line 20
   at Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator.<>c__DisplayClassa.<BuildDisplay>b__9(IContentPartDriver driver) in d:\Builds\OrchardFull\src\Orchard\ContentManagement\Drivers\Coordinators\ContentPartDriverCoordinator.cs:line 45
   at Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable`1 events, Action`1 dispatch, ILogger logger) in d:\Builds\OrchardFull\src\Orchard\InvokeExtensions.cs:line 19
2012-01-20 09:18:30,704 [11] Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator - ArgumentNullException thrown from IContentPartDriver by Szmyd.Orchard.Modules.Menu.Drivers.BreadcrumbsPartDriver
System.ArgumentNullException: Value cannot be null.
Parameter name: source
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Szmyd.Orchard.Modules.Menu.Drivers.BreadcrumbsPartDriver.Display(BreadcrumbsPart part, String displayType, Object shapeHelper)
   at Orchard.ContentManagement.Drivers.ContentPartDriver`1.Orchard.ContentManagement.Drivers.IContentPartDriver.BuildDisplay(BuildDisplayContext context) in d:\Builds\OrchardFull\src\Orchard\ContentManagement\Drivers\ContentPartDriver.cs:line 20
   at Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator.<>c__DisplayClassa.<BuildDisplay>b__9(IContentPartDriver driver) in d:\Builds\OrchardFull\src\Orchard\ContentManagement\Drivers\Coordinators\ContentPartDriverCoordinator.cs:line 45
   at Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable`1 events, Action`1 dispatch, ILogger logger) in d:\Builds\OrchardFull\src\Orchard\InvokeExtensions.cs:line 19
2012-01-20 09:30:30,162 [8] Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator - ArgumentNullException thrown from IContentPartDriver by Szmyd.Orchard.Modules.Menu.Drivers.BreadcrumbsPartDriver
System.ArgumentNullException: Value cannot be null.
Parameter name: source
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Szmyd.Orchard.Modules.Menu.Drivers.BreadcrumbsPartDriver.Display(BreadcrumbsPart part, String displayType, Object shapeHelper)
   at Orchard.ContentManagement.Drivers.ContentPartDriver`1.Orchard.ContentManagement.Drivers.IContentPartDriver.BuildDisplay(BuildDisplayContext context) in d:\Builds\OrchardFull\src\Orchard\ContentManagement\Drivers\ContentPartDriver.cs:line 20
   at Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator.<>c__DisplayClassa.<BuildDisplay>b__9(IContentPartDriver driver) in d:\Builds\OrchardFull\src\Orchard\ContentManagement\Drivers\Coordinators\ContentPartDriverCoordinator.cs:line 45
   at Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable`1 events, Action`1 dispatch, ILogger logger) in d:\Builds\OrchardFull\src\Orchard\InvokeExtensions.cs:line 19
2012-01-20 09:30:33,443 [7] NHibernate.AdoNet.AbstractBatcher - Could not execute command: UPDATE Szmyd_Orchard_Modules_Menu_CounterRecord SET ForItemId = @p0, InContextOfItemId = @p1, Count = @p2, Type = @p3, LastModified = @p4 WHERE Id = @p5
System.Data.SqlServerCe.SqlCeLockTimeoutException (0x80004005): SQL Server Compact timed out waiting for a lock. The default lock time is 2000ms for devices and 5000ms for desktops. The default lock timeout can be increased in the connection string using the ssce: default lock timeout property. [ Session id = 2,Thread id = 5564,Process id = 4492,Table name = Szmyd_Orchard_Modules_Menu_CounterRecord,Conflict type = u lock (x blocks),Resource = RID: 1059:25 ]
   at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommandText(IntPtr& pCursor, Boolean& isBaseTableCursor)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()
   at NHibernate.AdoNet.AbstractBatcher.ExecuteNonQuery(IDbCommand cmd)
2012-01-20 09:30:34,287 [7] NHibernate.Util.ADOExceptionReporter - SQL Server Compact timed out waiting for a lock. The default lock time is 2000ms for devices and 5000ms for desktops. The default lock timeout can be increased in the connection string using the ssce: default lock timeout property. [ Session id = 2,Thread id = 5564,Process id = 4492,Table name = Szmyd_Orchard_Modules_Menu_CounterRecord,Conflict type = u lock (x blocks),Resource = RID: 1059:25 ]
2012-01-20 09:30:34,350 [7] NHibernate.Event.Default.AbstractFlushingEventListener - Could not synchronize database state with session
NHibernate.Exceptions.GenericADOException: could not update: [Szmyd.Orchard.Modules.Menu.Models.CounterRecord#606][SQL: UPDATE Szmyd_Orchard_Modules_Menu_CounterRecord SET ForItemId = ?, InContextOfItemId = ?, Count = ?, Type = ?, LastModified = ? WHERE Id = ?] ---> System.Data.SqlServerCe.SqlCeLockTimeoutException: SQL Server Compact timed out waiting for a lock. The default lock time is 2000ms for devices and 5000ms for desktops. The default lock timeout can be increased in the connection string using the ssce: default lock timeout property. [ Session id = 2,Thread id = 5564,Process id = 4492,Table name = Szmyd_Orchard_Modules_Menu_CounterRecord,Conflict type = u lock (x blocks),Resource = RID: 1059:25 ]
   at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommandText(IntPtr& pCursor, Boolean& isBaseTableCursor)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()
   at NHibernate.AdoNet.AbstractBatcher.ExecuteNonQuery(IDbCommand cmd)
   at NHibernate.AdoNet.NonBatchingBatcher.AddToBatch(IExpectation expectation)
   at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Object[] oldFields, Object rowId, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session)
   --- End of inner exception stack trace ---
   at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Object[] oldFields, Object rowId, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session)
   at NHibernate.Persister.Entity.AbstractEntityPersister.UpdateOrInsert(Object id, Object[] fields, Object[] oldFields, Object rowId, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session)
   at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Int32[] dirtyFields, Boolean hasDirtyCollection, Object[] oldFields, Object oldVersion, Object obj, Object rowId, ISessionImplementor session)
   at NHibernate.Action.EntityUpdateAction.Execute()
   at NHibernate.Engine.ActionQueue.Execute(IExecutable executable)
   at NHibernate.Engine.ActionQueue.ExecuteActions(IList list)
   at NHibernate.Engine.ActionQueue.ExecuteActions()
   at NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session)
2012-01-20 09:30:34,506 [7] Orchard.ContentManagement.DefaultContentDisplay - GenericADOException thrown from IContentHandler by Szmyd.Orchard.Modules.Menu.Handlers.CountersHandler
NHibernate.Exceptions.GenericADOException: could not update: [Szmyd.Orchard.Modules.Menu.Models.CounterRecord#606][SQL: UPDATE Szmyd_Orchard_Modules_Menu_CounterRecord SET ForItemId = ?, InContextOfItemId = ?, Count = ?, Type = ?, LastModified = ? WHERE Id = ?] ---> System.Data.SqlServerCe.SqlCeLockTimeoutException: SQL Server Compact timed out waiting for a lock. The default lock time is 2000ms for devices and 5000ms for desktops. The default lock timeout can be increased in the connection string using the ssce: default lock timeout property. [ Session id = 2,Thread id = 5564,Process id = 4492,Table name = Szmyd_Orchard_Modules_Menu_CounterRecord,Conflict type = u lock (x blocks),Resource = RID: 1059:25 ]
   at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommandText(IntPtr& pCursor, Boolean& isBaseTableCursor)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()
   at NHibernate.AdoNet.AbstractBatcher.ExecuteNonQuery(IDbCommand cmd)
   at NHibernate.AdoNet.NonBatchingBatcher.AddToBatch(IExpectation expectation)
   at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Object[] oldFields, Object rowId, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session)
   --- End of inner exception stack trace ---
   at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Object[] oldFields, Object rowId, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session)
   at NHibernate.Persister.Entity.AbstractEntityPersister.UpdateOrInsert(Object id, Object[] fields, Object[] oldFields, Object rowId, Boolean[] includeProperty, Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql, ISessionImplementor session)
   at NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object id, Object[] fields, Int32[] dirtyFields, Boolean hasDirtyCollection, Object[] oldFields, Object oldVersion, Object obj, Object rowId, ISessionImplementor session)
   at NHibernate.Action.EntityUpdateAction.Execute()
   at NHibernate.Engine.ActionQueue.Execute(IExecutable executable)
   at NHibernate.Engine.ActionQueue.ExecuteActions(IList list)
   at NHibernate.Engine.ActionQueue.ExecuteActions()
   at NHibernate.Event.Default.AbstractFlushingEventListener.PerformExecutions(IEventSource session)
   at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event)
   at NHibernate.Impl.SessionImpl.Flush()
   at Orchard.Data.Repository`1.Flush() in d:\Builds\OrchardFull\src\Orchard\Data\Repository.cs:line 118
   at Orchard.Data.Repository`1.Orchard.Data.IRepository<T>.Flush() i

Jan 20, 2012 at 2:52 PM

Looks like a problem with Advanced Menu Module, you'll need to contact the author of that module (Piotr, or pszmyd on these forums), and show him this error report. Specifically it looks like SQL is encountering locks whilst trying to update the view count.

"Too many redirects" can get caused by a number of things, but I wondering if you're using Piotr's module to apply view permissions? If restricted content appears on your login page it could cause an infinite redirect.

Jan 29, 2012 at 12:28 AM

I also have a similar problem with this module, any update?

Jan 31, 2012 at 7:03 PM

I made a patch for BreadcrumbsPartDriver

                // Searching directly for an item

                // maxwebster jan 22.2012
                //path = MenuItemsUtility.SetSelectedPath(menu, request.RequestContext.RouteData, request.Path, _httpContextAccessor.Current()).ToList();
                var currentPath = MenuItemsUtility.SetSelectedPath(menu, request.RequestContext.RouteData, request.Path, _httpContextAccessor.Current());
                if (currentPath==null)
                    currentPath = new Stack();
                path = currentPath.ToList();