Unable to detect changes
Asked by Theo_Tsatsos:

Hi,

We are getting a lot of "unable to detect changes error".

We can succesfully connect to TFS as our checkouts have no issues but we are getting errors li9ke the above all the time.

com.stellarity.bamboo.repository.TfsRepository.collectChanges(TfsRepository.java:404)  
at com.stellarity.bamboo.repository.TfsRepository.collectChangesSinceLastBuild(TfsRepository.java:289)  
at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesWithRetry(DefaultChangeDetectionManager.java:556)  
at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.lambda$createBuildRepositoryChanges$159(DefaultChangeDetectionManager.java:427)  
at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:221)  
at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceLastBuildInternal(DefaultChangeDetectionManager.java:362)  
at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceRevisions(DefaultChangeDetectionManager.java:310)  
at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceRevisions(DefaultChangeDetectionManager.java:195)  
at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceLastBuildIfTriggered(DefaultChangeDetectionManager.java:133)  
at com.atlassian.bamboo.v2.trigger.ChangeDetectionListenerAction.testIfBuildShouldStart(ChangeDetectionListenerAction.java:114)  
at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$3.call(PlanExecutionManagerImpl.java:510)  
at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$3.call(PlanExecutionManagerImpl.java:493)  
at io.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(ManagedLocks.java:293)  
at com.atlassian.bamboo.plan.PlanExecutionLockServiceImpl.lock(PlanExecutionLockServiceImpl.java:85)  
at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.doWithProcessLock(PlanExecutionManagerImpl.java:784)  
at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.startConditionalBuild(PlanExecutionManagerImpl.java:492)  
at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.start(PlanExecutionManagerImpl.java:566)  
at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.start(PlanExecutionManagerImpl.java:583)  
at com.atlassian.bamboo.plan.DelegatingPlanExecutionManager.start(DelegatingPlanExecutionManager.java:95)  
at com.atlassian.bamboo.plan.NonBlockingPlanExecutionServiceImpl$4.startPlanExecution(NonBlockingPlanExecutionServiceImpl.java:234)  
at com.atlassian.bamboo.plan.NonBlockingPlanExecutionServiceImpl$4.lambda$call$253(NonBlockingPlanExecutionServiceImpl.java:220)  
at com.atlassian.bamboo.util.CacheAwareness$3.call(CacheAwareness.java:159)  
at com.atlassian.bamboo.util.CacheAwareness$3.call(CacheAwareness.java:155)  
at com.atlassian.bamboo.util.CacheAwareness.withValuesOlderThanTimestampReloaded(CacheAwareness.java:188)  
at com.atlassian.bamboo.util.CacheAwareness.withValuesOlderThanTimestampReloaded(CacheAwareness.java:154)  
at com.atlassian.bamboo.util.CacheAwareness.withValuesOlderThanTimestampReloaded(CacheAwareness.java:219)  
at com.atlassian.bamboo.plan.NonBlockingPlanExecutionServiceImpl$4.call(NonBlockingPlanExecutionServiceImpl.java:219)  
at com.atlassian.bamboo.plan.NonBlockingPlanExecutionServiceImpl$4.call(NonBlockingPlanExecutionServiceImpl.java:202)  
at java.util.concurrent.FutureTask.run(FutureTask.java:266)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)  
at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:51)  
at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:31)  
at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:20)  
at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:52)  
at java.lang.Thread.run(Thread.java:745)  
Caused by: [java.net](http://java.net).SocketTimeoutException: connect timed out  
at [java.net](http://java.net).DualStackPlainSocketImpl.waitForConnect(Native Method)  
at [java.net](http://java.net).DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)  
at [java.net](http://java.net).AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)  
at [java.net](http://java.net).AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)  
at [java.net](http://java.net).AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)  
at [java.net](http://java.net).PlainSocketImpl.connect(PlainSocketImpl.java:172)  
at [java.net](http://java.net).SocksSocketImpl.connect(SocksSocketImpl.java:392)  
at [java.net](http://java.net).Socket.connect(Socket.java:589)  
at com.stellarity.bamboo.repository.TfsRepository.validateUrl(TfsRepository.java:627)  
at com.stellarity.bamboo.repository.TfsRepository.getTeamProjectCollection(TfsRepository.java:633)  
at com.stellarity.bamboo.repository.TfsRepository.collectChanges(TfsRepository.java:322)


Answers:
author: Sergey Podobry _Stellarity Software_
body: Actually there is only one reason to get the exception - when the TFS server is not accessible (or not responding for 3 seconds).

### If you want to confirm network issues {#toc-hId-1159057619}

I'm thinking about a script that will ping your TFS server and write a log. Also special monitoring tools can be used. I can help you with that if you require any assistance.

### If you want to suppress the errors {#toc-hId-2046561300}

It can be done. I can introduce an error counter and trigger the exception only when the counter exceeds its limit.

The issue is discussed [here](https://bitbucket.org/stellaritysoftware/tfs-repository-plugin/issues/66/how-to-fix).


Tags: bamboo-administration

change

repository-hook

team-foundation-studio