# Error resetting TFS repository

**URL:** https://www.finalbuilder.com/forums/t/error-resetting-tfs-repository/5317
**Category:** Discussion
**Created:** [February 18, 2015, 6:25am UTC](https://www.finalbuilder.com/forums/t/error-resetting-tfs-repository/5317 "2015-02-18T06:25:10Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![lcoursey](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/l/d07c76/32.png) [@lcoursey](https://www.finalbuilder.com/forums/u/lcoursey)
#### Post date: [February 18, 2015, 6:25am UTC](https://www.finalbuilder.com/forums/t/error-resetting-tfs-repository/5317/1 "2015-02-18T06:25:10Z")

</div>

Hi guys,&nbsp;  
  
Having trouble getting my TFS repository to reset, it seems to fail at “getting changesets” and just disables itself. I get this in the error log:  
  
_Error resetting repository could not execute query&nbsp;  
[SELECT this\_.Id as Id43\_0\_, this\_.Revision as Revision43\_0\_, this\_.Branch as Branch43\_0\_, this\_.branchdisplayname as branchdi4\_43\_0\_, this\_.Username as Username43\_0\_, this\_.Created as Created43\_0\_, this\_.Comment as Comment43\_0\_, this\_.ErrorMessage as ErrorMes8\_43\_0\_, this\_.CacheRevision as CacheRev9\_43\_0\_, this\_.Parents as Parents43\_0\_, this\_.changesetstate as changes11\_43\_0\_, this\_.tagchangeinfo as tagchan12\_43\_0\_, this\_.HasFileCommits as HasFile13\_43\_0\_, this\_.IsBranchDeletion as IsBranc14\_43\_0\_, this\_.UserId as UserId43\_0\_, this\_.RepositoryId as Reposit16\_43\_0\_, this\_.IssueConnectorId as IssueCo17\_43\_0\_ FROM builds\_changeset this\_ WHERE this\_.Id not in (SELECT this\_0\_.ChangesetId as y0\_ FROM builds\_buildchangeset this\_0\_) and this\_.RepositoryId = :p0]&nbsp;  
Name:cp0 - Value:Continua.Modules.Builds.Repositories.Repository&nbsp;  
[SQL: SELECT this\_.Id as Id43\_0\_, this\_.Revision as Revision43\_0\_, this\_.Branch as Branch43\_0\_, this\_.branchdisplayname as branchdi4\_43\_0\_, this\_.Username as Username43\_0\_, this\_.Created as Created43\_0\_, this\_.Comment as Comment43\_0\_, this\_.ErrorMessage as ErrorMes8\_43\_0\_, this\_.CacheRevision as CacheRev9\_43\_0\_, this\_.Parents as Parents43\_0\_, this\_.changesetstate as changes11\_43\_0\_, this\_.tagchangeinfo as tagchan12\_43\_0\_, this\_.HasFileCommits as HasFile13\_43\_0\_, this\_.IsBranchDeletion as IsBranc14\_43\_0\_, this\_.UserId as UserId43\_0\_, this\_.RepositoryId as Reposit16\_43\_0\_, this\_.IssueConnectorId as IssueCo17\_43\_0\_ FROM builds\_changeset this\_ WHERE this\_.Id not in (SELECT this\_0\_.ChangesetId as y0\_ FROM builds\_buildchangeset this\_0\_) and this\_.RepositoryId = :p0]_  
  
We have no TFS branches (just the master branch), so the repo is set to ‘ignore branches’. It validates correctly, and enables correctly when I check ‘enable’, but then trying to reset or run a build just disables it again. I don’t think anything has changed recently so I’m a bit confused. Any ideas? This is on the latest released build (not the beta).  
  
The new LDAP stuff on the beta is great by the way - worked well on our test server

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [February 19, 2015, 12:05pm UTC](https://www.finalbuilder.com/forums/t/error-resetting-tfs-repository/5317/2 "2015-02-19T12:05:14Z")

</div>

Hi Luke,  
  
Is your version 1.6 install pointing to the same database as the version 1.5 install? The 1.6 installer makes some changes to the database which are not compatible with earlier versions. If so then your only options are to restore the version 1.5 database from backup or to start using version 1.6. If you're using the bundled PostgreSQL database, then a backup will have been created under c:\ProgramData\VSoft\ContinuaCI.  
  
If the database has not changed then I can't see any obvious reason why this error would occur. I have uploaded an updated version 1.5 build which will output additional details for the exception. If you can install this using the following links, reset the repository again and send us the new exception details this may help us to figure out what is going on.

[links removed]  
 Also try running the SQL directly against the database

`SELECT` `this_.Id ``as` `Id43_0_, this_.Revision ``as` `Revision43_0_, `

`this_.Branch ``as` `Branch43_0_, this_.branchdisplayname ``as` `branchdi4_43_0_,`

` ``this_.Username ``as` `Username43_0_, this_.Created ``as` `Created43_0_, this_.Comment ``as` `Comment43_0_, `

` ``this_.ErrorMessage ``as` `ErrorMes8_43_0_, this_.CacheRevision ``as` `CacheRev9_43_0_, this_.Parents ``as` `Parents43_0_, `

` ``this_.changesetstate ``as` `changes11_43_0_, this_.tagchangeinfo ``as` `tagchan12_43_0_, this_.HasFileCommits ``as` `HasFile13_43_0_, `

` ``this_.IsBranchDeletion ``as` `IsBranc14_43_0_, this_.UserId ``as` `UserId43_0_, this_.RepositoryId ``as` `Reposit16_43_0_, this_.IssueConnectorId ``as` `IssueCo17_43_0_ `

`FROM` `builds_changeset this_ `

`WHERE` `this_.Id ``not` `in` `(``SELECT` `this_0_.ChangesetId ``as` `y0_ ``FROM` `builds_buildchangeset this_0_) ``and` `this_.RepositoryId ``IS` `NOT` `null`

---

<div class="post-metadata">

### Author: ![lcoursey](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/l/d07c76/32.png) [@lcoursey](https://www.finalbuilder.com/forums/u/lcoursey)
#### Post date: [February 19, 2015, 10:45am UTC](https://www.finalbuilder.com/forums/t/error-resetting-tfs-repository/5317/3 "2015-02-19T10:45:25Z")

</div>

Ah I guess that was the issue - I hadn’t released it wouldn’t be backwards compatible. But that makes sense now that I think about it. We’ve decided to just start using the beta so we don’t have to mess around restoring backups, I think the team are happy with it anyway. Repository is working again as normal, thanks Dave, we appreciate the support.   
  
 Regards,
