TFS Back up failed : Timeout expired - sql-server

I am trying to take the tfs back up. But its getting failed .
I will add the exception details here from the log file generated .
[Error #12:41:51.187] Microsoft.SqlServer.Management.Smo.FailedOperationException: Backup failed for Server 'sampledb-tfs-ser'. ---> Microsoft.SqlServer.Management.Common.ExecutionFailureException: An exception occurred while executing a Transact-SQL statement or batch. ---> System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
at Microsoft.SqlServer.Management.Common.ConnectionManager.ExecuteTSql(ExecuteTSqlAction action, Object execObject, DataSet fillDataSet, Boolean catchException)
I know server is timing out . is der any way to increase the time out or any other way in which this problem could be solved ..?
Can any one help please ...?

Looks like you're using some sort of programming language (C#, powershell, etc) to do this. You're going to have to set the query timeout for your connection to 0 to let the program wait indefinitely for the backup to finish. How you go about doing that depends on the language, The ServerConnection class has a property called StatementTimeout. Set that to 0 and you should be good to go.

On your TFS APPTier server, in file
C:\ProgramData\Microsoft\Team Foundation\Server Configuration\ConfigPT.xml
, try changing the value of property
<SqlStatementTimeoutInSeconds>21600</SqlStatementTimeoutInSeconds>
Try 12 hours (43200) instead. That solved the problem for me.
This file is the result of executing the TFS backup plan in the "Team Foundation Administration Console". Therefore you may have to change that value everytime after re-executing the TFS backup plan.

Related

Can't get to next stage of Kentico application configuration

I'm trying to get my web application up and running. It uses Kentico. I connected to the admin page which is taking me through the initial database ans site setup. It ran through "Creating database objects". I can see the tables are now in the database. The "Next" button hasn't become active.
This error is in the Creating database objects log:
at CMS.DataEngine.SqlInstallationHelper.ImportDefaultData(IDataConnection connection, String dataFolder, LogMessage log, String defaultErrorMessage)
at CMS.DataProviderSQL.DataConnection.BulkInsert(DataTable sourceData, String targetTable, BulkInsertSettings insertSettings)
at CMS.DataEngine.AbstractDataConnection.HandleError(String queryText, Exception ex)
The statement has been terminated.
Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Caused exception:
BulkInsert to table 'BadWords_Word'
Query:
[DataConnection.HandleError]:
ERROR: An error occurred:
data\badwords_word
objects/proc_personas_reevaluateallcontacts
...
objects/cms_resource
How can I get past this?
Increase the timeout for your connection string in your web.config file to something like 600 then try again.

Azure SQL Database - Execution Timeout Expired error on several jobs

In SQL Server Management Studio, I discovered an issue while attempting to disable a trigger on one of our tables in our Azure SQL Database, which is set at one of the highest-available performance tiers (Business Critical Gen 5). I used right-click disable to accomplish this. I receive the following error after the timeout period expires:
Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. (.Net SqlClient Data Provider)
------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=12.00.0700&EvtSrc=MSSQLServer&EvtID=-2&LinkId=20476
------------------------------
Server Name: searchfoundry.database.windows.net
Error Number: -2
Severity: 11
State: 0
------------------------------
Program Location:
at Microsoft.SqlServer.Management.Common.ConnectionManager.ExecuteTSql(ExecuteTSqlAction action, Object execObject, DataSet fillDataSet, Boolean catchException)
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType, Boolean retry)
The wait operation timed out
The help link goes to a 404 - no surprise there.
EDIT #1:
#DanGuzman kindly assisted me in suggesting I run the disable trigger as T-SQL. This worked. However, in between the time I originally posted, and the time he gave his suggestion, I discovered that this timeout error is occurring within other areas of our infrastructure/services which use this database.
I have run a query to check for blocking sessions on this database. There are none listed. I have also increased the timeout period from 30 seconds to 5 minutes. Items are still timing out.
I am looking for guidance on what other queries I can run to look under the hood of this database to determine what is causing these timeouts to occur.
I'd be happy to just restart the SQL Server to resolve this, but as many of us know, there is no restarting Azure SQL Servers, unfortunately.
Increasing the DTUs works for me.
I had fixed similar timeout issues by increasing the DTU quota of the DB

SchemaModel.SqlSpatialIndex: Timeout expired

I am receiving a timeout error when trying to reverse engineer a SQL Server database into a Database project. We don't have any spatial indexes on the that database (I checked using this).
I don't have a timeout setting on the connection (
3/8/2016 9:46:00 AM An error was received from SQL Server while attempting to reverse engineer elements of type Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlSpatialIndex: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
3/8/2016 9:46:00 AM An exception was generated.
Unable to reconnect to database: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
3/8/2016 9:46:00 AM An error was received from SQL Server while attempting to reverse engineer elements of type Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlSpatialIndex: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
3/8/2016 9:46:00 AM Finished importing database.
3/8/2016 9:46:00 AM A summary of the import was saved to the following location: C:\Temp\Import From Prod 2\Import Schema Logs\Import From Prod 2_20160308024125.log
3/8/2016 9:46:00 AM Click Finish to continue...
Steps to reproduce the issue:
Open Visual Studio 2013
From the menu, click on "View" / "Sql Server Object Explorer"
Connect to a SQL Server (in our case, the UAT server) and choose a database
From the context menu of the database, choose "Create New Project"
Press "Start"
How do I figure out what is actually timing out? How do I fix this?
Can you increase the amount of available RAM? This exact error started showing up for me with schema comparisons between an existing db project and a local database. The problem was resolved when I shut down all of my applications except Visual Studio. This makes me think that my pc did not have enough resources to complete the task in the desired time when I have several apps open.
One option that worked for me was to increase the value of HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\NN.N\SQLDB\Database\QueryTimeoutSeconds and restart Visual Studio based on this. But, although successful, it was taking nearly 5 minutes to compare.
Later I discovered that we recently changed our build target to Sql Server 2016, but were still referencing a 2012 master.dacpac. I updated the reference to a 2016 master.dacpac and the compare now completes in less than a minute.

"Timeout expired" exception happens before the defined timeout

Using ADO.NET and SQL Server 2008.
The SqlCommand's CommandTimeout property was not changed, so it has the default value of 30.
The application runs some dozens command and logs the result (or exception) to an SQL table, so i know the start time of each execution. The start time of the next log record gives me an estimate of the duration.
I got two exception that don't make sense, because their duration is much smaller than the defined CommandTimeout.
This happend randomly. It's not reproducible.
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
My question is: can this exception be raised by other causes than and actual timeout?
It was probably related with some lock in participating tables.

Handling a SQL Server Login error msg with VBA?

I'm working in a VBA module for Access that queries linked tables, generates reports based off the data, and then uses a PDF printer to save the reports to disk. There's a timer in the primary form that will, every N seconds, run an Access query against a "JOBQUEUE" table to see if there are new jobs.
If the database server becomes unavailable, this operation will of course time out. The run-time error of 3051 is being logged, and the loop will try to continue. The loop can't finish, however, because the following error comes right after the VB Run-Time error;
Title is "Microsoft SQL Server Login", so it's not within VB as far as I can tell.
Connection Failed:
SQLState: '01000'
SQL Server Error: 53
[Microsoft][ODBC SQL Server Driver][DBNETLIB][ConnectionOpen(Connect()).
Connection Failed:
SQLState: '08001'
SQL Server Error: 17
[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not
exist or access is denied.
In every forum & discussion I've found that mentions this error, the asker is concerned with the cause of the error. In this case, I can assume that the error is temporary, and that it needs to continue trying to connect because the installation is unattended. Access goes into a "Not Responding..." state when it's timing out against the DB, and that's OK too, if connection is restored before it goes into the MsgBox described above, it will pick up where it left off and soldier on.
Does anyone know of a way that I can either mute that msgbox, preferably programatically, but I'd take anything at this point that can be done remotely that isn't an RDP session.
Edit: Link to image
The error I was getting was indeed not a run-time error that could be caught from code. Rather, it was SQL timing out after I already swallowed & dismissed time-outs in run-time in my VBA module.
The error does not seem to ever appear now that I have introduced a new timer that resets the loop that runs a query against my linked tables. It can't be logged & swallowed, but it can be prevented by being smarter about how I handle timeouts in run-time.

Resources