YAFLogo

rovyjh
  • rovyjh
  • 54.8% (Neutral)
  • YAF Forumling Topic Starter
14 years ago
Upgrading to the latest version (1.9.4.1) of YAF, when reaching the Initialize/Upgrade Database step, the page returns the error below. I have tried executing the scripts one at a time with similar results.

Server Error in '/' Application.

FILE:
mssql/constraints.sql

ERROR:
Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

STATEMENT:
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[yaf_vaccess_group]') AND name = N'yaf_vaccess_group_UserForum_PK')
SET ARITHABORT ON
CREATE UNIQUE CLUSTERED INDEX [yaf_vaccess_group_UserForum_PK] ON [dbo].[yaf_vaccess_group] 
(
[UserID] ASC,
[ForumID] ASC,
[AccessMaskID] ASC,
[GroupID] ASC
) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Exception: FILE:
mssql/constraints.sql

ERROR:
Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

STATEMENT:
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[yaf_vaccess_group]') AND name = N'yaf_vaccess_group_UserForum_PK')
SET ARITHABORT ON
CREATE UNIQUE CLUSTERED INDEX [yaf_vaccess_group_UserForum_PK] ON [dbo].[yaf_vaccess_group] 
(
[UserID] ASC,
[ForumID] ASC,
[AccessMaskID] ASC,
[GroupID] ASC
) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 


[Exception: FILE:
mssql/constraints.sql

ERROR:
Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

STATEMENT:
IF NOT EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[yaf_vaccess_group]') AND name = N'yaf_vaccess_group_UserForum_PK')
SET ARITHABORT ON
CREATE UNIQUE CLUSTERED INDEX [yaf_vaccess_group_UserForum_PK] ON [dbo].[yaf_vaccess_group] 
(
	[UserID] ASC,
	[ForumID] ASC,
	[AccessMaskID] ASC,
	[GroupID] ASC
) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]]
   YAF.Classes.Data.DB.system_initialize_executescripts(String script, String scriptFile, Boolean useTransactions) +600
   YAF.Install._default.ExecuteScript(String scriptFile, Boolean useTransactions) +240
   YAF.Install._default.UpgradeDatabase(Boolean fullText) +74
   YAF.Install._default.Wizard_NextButtonClick(Object sender, WizardNavigationEventArgs e) +976
   System.Web.UI.WebControls.Wizard.OnNextButtonClick(WizardNavigationEventArgs e) +108
   System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) +418
   System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) +19
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3614
Sponsor
bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
14 years ago
Do use SQL Server 2000?
rovyjh
  • rovyjh
  • 54.8% (Neutral)
  • YAF Forumling Topic Starter
14 years ago
Thanks for the reply.

We are using SQL Server 2008.

bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
14 years ago
Try to launch upgrade again and increase timeout.
rovyjh
  • rovyjh
  • 54.8% (Neutral)
  • YAF Forumling Topic Starter
14 years ago
I have modified and even removed the connection timeout, but it returned the same error.
bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
14 years ago
I'm running the same version as you and I'm not getting the error.

Jaben
  • Jaben
  • 100% (Exalted)
  • YAF Developer
14 years ago
The code might need to be modified to set the command CommandTimeout to a higher value.

In the YafDBAccess.cs GetCommand section you could add this:


    public static SqlCommand GetCommand(string storedProcedure, SqlConnection connection)
    {
      var cmd = new SqlCommand();

      cmd.CommandType = CommandType.StoredProcedure;
      cmd.CommandText = GetObjectName(storedProcedure);
      cmd.Connection = connection;
      cmd.CommandTimeout = 99999;

      return cmd;
    }

Also committed that to the latest SVN -- so that might help.

Jaben
  • Jaben
  • 100% (Exalted)
  • YAF Developer
14 years ago
Oh, I recommend running some maintenance on your database first... sounds like it's a bit slow.
DJBROOK
  • DJBROOK
  • 54.8% (Neutral)
  • YAF Forumling
14 years ago
Hi there,

We have done as asked, but are now getting the following time out once logged in:

Server Error in '/' Application.

Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 


[SqlException (0x80131904): Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1950890
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846875
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
   System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +33
   System.Data.SqlClient.SqlDataReader.get_MetaData() +83
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +954
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +141
   System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +12
   System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) +10
   System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +130
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +287
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +94
   YAF.Classes.Data.YafDBAccess.GetDatasetBasic(SqlCommand cmd, Boolean transaction) +371
   YAF.Classes.Data.YafDBAccess.GetData(SqlCommand cmd, Boolean transaction) +70
   YAF.Classes.Data.DB.forum_listread(Object boardID, Object userID, Object categoryID, Object parentID) +186
   YAF.Classes.Core.YafDBBroker.BoardLayout(Object boardID, Object userID, Object categoryID, Object parentID) +718
   YAF.Controls.ForumCategoryList.Page_Load(Object sender, EventArgs e) +134
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
14 years ago
The error source can be different.

i.e. your database server is busy

You can try and restart your aplication, clear pool if the timeout solution doesn't help.

grep
  • grep
  • 54.8% (Neutral)
  • YAF Forumling
14 years ago

The code might need to be modified to set the command CommandTimeout to a higher value.

In the YafDBAccess.cs GetCommand section you could add this:


    public static SqlCommand GetCommand(string storedProcedure, SqlConnection connection)
    {
      var cmd = new SqlCommand();

      cmd.CommandType = CommandType.StoredProcedure;
      cmd.CommandText = GetObjectName(storedProcedure);
      cmd.Connection = connection;
      cmd.CommandTimeout = 99999;

      return cmd;
    }

Also committed that to the latest SVN -- so that might help.

Jaben wrote:

I have a similar issue with search at the moment. My understanding is that the other version of GetCommand will need to be updated to fix this issue. This is my code

    
public static SqlCommand GetCommand(string commandText, bool isText, SqlConnection connection)
    {
        if (isText)
        {
            SqlCommand cmd = new SqlCommand
            {
                CommandType = CommandType.Text,
                CommandText = GetCommandTextReplaced(commandText),
                Connection = connection
            };
            cmd.CommandTimeout = 99999;
            return cmd;
        }
        else
        {
            return GetCommand(commandText);
        }
    }