Click here to Skip to main content
13,141,576 members (52,568 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


Posted 17 Jul 2013

TFS database backup job failed with error: TF30040

, 17 Jul 2013
Rate this:
Please Sign up or sign in to vote.
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’.


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.


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.


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


About the Author

Gordon Beeming (RSA)
Software Developer Nologo Studios
South Africa South Africa
Gordon Beeming works at Nologo Studios in the sunny city of Durban, South Africa. His current focus is on Devloper Efficiencies and R&D. When he's not hacking away at a keyboard in Visual Studio he'll generally be relaxing with his family or hitting the black top getting in some mileage. He is a Visual Studio ALM Rangers, Visual Studio ALM MVP.

You may also be interested in...

Comments and Discussions

PraiseThanks for the explanation Pin
Sitary16-Jul-17 11:42
professionalSitary16-Jul-17 11:42 

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.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170915.1 | Last Updated 17 Jul 2013
Article Copyright 2013 by Gordon Beeming (RSA)
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid