Click here to Skip to main content
Click here to Skip to main content

TFS database backup job failed with error: TF30040

By , 17 Jul 2013
Rate this:
Please Sign up or sign in to vote.

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)

About the Author

Gordon W Beeming
Software Developer Derivco
South Africa South Africa
Developer who loves pushing the limits and playing with amazing @Microsoft Tech, #TFS, ALM Rangers.
 
http://31og.com
Follow on   Twitter

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web04 | 2.8.140421.2 | Last Updated 17 Jul 2013
Article Copyright 2013 by Gordon W Beeming
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid