custom error ? help

Topics: General, Troubleshooting
Nov 12, 2011 at 10:03 AM

Everything was working fine on my website. This morning when I visited my website I got this error:

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>

then I added this to webconfig:

 

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>

By adding this I got :File directory error

Then I removed this from webconfig and website started working fine.

What could be the reason of this problem ? any comments ?

 

Nov 12, 2011 at 10:35 AM

Could have been some kind of locking issue which cleared when the website restarted due to configuration change.

Nov 12, 2011 at 12:51 PM

How to make sure that it doesn't happen again ?

Nov 14, 2011 at 2:56 PM

anyone ?

Nov 14, 2011 at 3:17 PM

Look in your logs (App_Data/Logs) for that day and see what's there. Until you know what the exact error was, preventing it is impossible.

Nov 14, 2011 at 4:57 PM
Edited Nov 14, 2011 at 4:58 PM

I had this problem on 12th Nov (Saturday) - so I found this log file for Nov 12 with following error - orchard-error-2011.11.12

 

2011-11-12 08:05:21,208 [79] NHibernate.Util.ADOExceptionReporter - Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
2011-11-12 08:05:21,411 [79] NHibernate.Util.ADOExceptionReporter - Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
2011-11-12 08:05:21,411 [79] Orchard.Tasks.BackgroundService - Error while processing background task
NHibernate.ADOException: could not execute query
[ SELECT this_.Id as Id2097_0_, this_.TaskType as TaskType2097_0_, this_.ScheduledUtc as Schedule3_2097_0_, this_.ContentItemVersionRecord_id as ContentI4_2097_0_ FROM Scheduling_ScheduledTaskRecord this_ WHERE this_.ScheduledUtc <= ? ]
Positional parameters:  #0>11/12/2011 2:04:43 PM
[SQL: SELECT this_.Id as Id2097_0_, this_.TaskType as TaskType2097_0_, this_.ScheduledUtc as Schedule3_2097_0_, this_.ContentItemVersionRecord_id as ContentI4_2097_0_ FROM Scheduling_ScheduledTaskRecord this_ WHERE this_.ScheduledUtc <= ?] ---> System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
   at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
   at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()
   at System.Data.SqlClient.TdsParserStateObject.ReadBuffer()
   at System.Data.SqlClient.TdsParserStateObject.ReadByte()
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.TdsExecuteTransactionManagerRequest(Byte[] buffer, TransactionManagerRequestType request, String transactionName, TransactionManagerIsolationLevel isoLevel, Int32 timeout, SqlInternalTransaction transaction, TdsParserStateObject stateObj, Boolean isDelegateControlRequest)
   at System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransactionYukon(TransactionRequest transactionRequest, String transactionName, IsolationLevel iso, SqlInternalTransaction internalTransaction, Boolean isDelegateControlRequest)
   at System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransaction(TransactionRequest transactionRequest, String name, IsolationLevel iso, SqlInternalTransaction internalTransaction, Boolean isDelegateControlRequest)
   at System.Data.SqlClient.SqlDelegatedTransaction.Initialize()
   at System.Transactions.TransactionStatePSPEOperation.PSPEInitialize(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification)
   at System.Transactions.TransactionStateActive.EnlistPromotableSinglePhase(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Transaction atomicTransaction)
   at System.Transactions.Transaction.EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification promotableSinglePhaseNotification)
   at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx)
   at System.Data.SqlClient.SqlInternalConnection.Enlist(Transaction tx)
   at System.Data.SqlClient.SqlInternalConnectionTds.Activate(Transaction transaction)
   at System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction transaction)
   at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.SqlClient.SqlConnection.Open()
   at NHibernate.Connection.DriverConnectionProvider.GetConnection()
   at NHibernate.AdoNet.ConnectionManager.GetConnection()
   at NHibernate.AdoNet.AbstractBatcher.Prepare(IDbCommand cmd)
   at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd)
   at NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean autoDiscoverTypes, Boolean callable, RowSelection selection, ISessionImplementor session)
   at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
   at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
   at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters)
   --- End of inner exception stack trace ---
   at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters)
   at NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor session, QueryParameters queryParameters)
   at NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet`1 querySpaces, IType[] resultTypes)
   at NHibernate.Impl.SessionImpl.List(CriteriaImpl criteria, IList results)
   at NHibernate.Impl.CriteriaImpl.List(IList results)
   at NHibernate.Impl.CriteriaImpl.List()
   at NHibernate.Linq.CriteriaResultReader`1.<GetEnumerator>d__0.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Orchard.Utility.Extensions.ReadOnlyCollectionExtensions.ToReadOnlyCollection[T](IEnumerable`1 enumerable) in C:\Documents and Settings\PC\Desktop\Orchard1.3\src\Orchard\Utility\Extensions\ReadOnlyCollectionExtensions.cs:line 8
   at Orchard.Data.Repository`1.Orchard.Data.IRepository<T>.Fetch(Expression`1 predicate) in C:\Documents and Settings\PC\Desktop\Orchard1.3\src\Orchard\Data\Repository.cs:line 72
   at Orchard.Core.Scheduling.Services.ScheduledTaskExecutor.Sweep() in C:\Documents and Settings\PC\Desktop\Orchard1.3\src\Orchard.Web\Core\Scheduling\Services\ScheduledTaskExecutor.cs:line 36
   at Orchard.Tasks.BackgroundService.Sweep() in C:\Documents and Settings\PC\Desktop\Orchard1.3\src\Orchard\Tasks\BackgroundService.cs:line 31

Nov 14, 2011 at 6:10 PM

Is your database located on a separate server? It could be there was a problem either with the SQL Server instance or your connection to it. Just by coincidence it resolved while you were making configuration changes. Check with your host to see if there were any outages around that time.

Nov 14, 2011 at 6:14 PM

I mean nothing has been changed since last morning when I uploaded my website on server. Everything is working since so I am assuming database connection is correct that's why it was working fine.

I am guessing since you mentioned that hosting server might be down at that time.

Nov 14, 2011 at 6:28 PM

I mean that the SQL server might have experienced a temporary outage (unless your're using SQL Server Compact - in which case maybe you could consider switching to full SQL Server which I find faster and more reliable)

Nov 14, 2011 at 7:14 PM

I am using SQL Server, database lies on the hosting server.

Nov 14, 2011 at 7:55 PM

Ok; so check with your host if the SQL Server had an outage (of course, it could have been a temporary network glitch they were unaware of, or even SQL Server just being screwy... no real way to prevent that, and your host's SLA will cover temporary outages of that nature)

Nov 15, 2011 at 1:38 PM

thank you so much "randompete" you answered all my questions here.

thanks for your time and help !!!