Click here to Skip to main content
15,883,889 members
Articles
Technical Blog
(untagged)

TFS database backup job failed with error: TF30040

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
17 Jul 2013CPOL 13.5K   1
TFS database backup job failed with error.

Full Error

TFS database backup job failed with error: TF30040: The database is not correctly configured. Contact your Team Foundation Server administrator.System.Data.SqlClient.SqlException (0×80131904): Could not find stored procedure ‘prc_TfsSetTransactionLogMark’.

Problem

We started getting an error in the event log every time our backups ran that had the below details in it.

Exception Message: TF30040: The database is not correctly configured. 
Contact your Team Foundation Server administrator. (type DatabaseConfigurationException)
Exception Stack Trace:    at Microsoft.TeamFoundation.Framework.Server.TeamFoundationSqlResourceComponent.
          TranslateException(Int32 errorNumber, SqlException sqlException, SqlError sqlError)
   at Microsoft.TeamFoundation.Framework.Server.
      TeamFoundationSqlResourceComponent.TranslateException(SqlException sqlException)
   at Microsoft.TeamFoundation.Framework.Server.TeamFoundationSqlResourceComponent.MapException(
      SqlException ex, QueryExecutionState queryState)
   at Microsoft.TeamFoundation.Framework.Server.TeamFoundationSqlResourceComponent.HandleException(Exception exception)
   at Microsoft.TeamFoundation.Framework.Server.TeamFoundationSqlResourceComponent.Execute(
      ExecuteType executeType, CommandBehavior behavior)
   at Microsoft.TeamFoundation.Framework.Server.TeamFoundationSqlResourceComponent.ExecuteNonQuery(Boolean bindReturnValue)
   at Microsoft.TeamFoundation.Admin.AdminSqlResourceComponent.ExecuteNonQuery(
                SqlQuery sqlQuery, SqlInfoMessageEventHandler infoMessageHandler)
   at Microsoft.TeamFoundation.Admin.SqlHandler.ExecuteNonQuery(String connectionString, SqlQuery sqlQuery)
   at Microsoft.TeamFoundation.Admin.SqlHandler.ExecuteNonQuery(String connectionString, String sqlStatement)
   at Microsoft.TeamFoundation.Admin.Jobs.DatabaseBackupJob.TakeTransactionalBackups(
       TeamFoundationRequestContext requestContext, BackupSettings settings, ITFLogger logger)

Inner Exception Details:

Exception Message: Could not find stored procedure ‘prc_TfsSetTransactionLogMark’. (type SqlException)
SQL Exception Class: 16
SQL Exception Number: 2812
SQL Exception Procedure: 
SQL Exception Line Number: 1
SQL Exception Server: <server>
SQL Exception State: 62
SQL Error(s):</server>

The problem started occurring after we started restoring backups from our production instance into our test/dev TFS environment.

Solution

After attaching/restoring a new collection you must reconfigure your TFS scheduled backups.

Reason for error

When you configure your scheduled backups the application creates the stored procedure ‘prc_TfsSetTransactionLogMark’ in all the databases that would be backed up. Because we detached our collection on one server and then reattached it on another (that was originally configured to backup) and didn’t reconfigure the backups, the scheduled would assume that the collection database has this procedure and tries to execute using it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect SSW
South Africa South Africa

Comments and Discussions

 
PraiseThanks for the explanation Pin
Sitary16-Jul-17 11:42
professionalSitary16-Jul-17 11:42 
This solved a similar situation for me.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.