title: Jenkins TFS Exception: Why is it happening & how do I fix or workaround?
body: <p>I am sometimes getting the following error from TFS plugin in Jenkins:</p>
  
  <blockquote>
    <p>FATAL: hudson.remoting.ProxyException: com.microsoft.tfs.core.exceptions.TECoreException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM. </p>
  </blockquote>
  
  <p>This error is inconsistent and might go away next time I try to run the same job.  </p>
  
  <ul>
  <li>Is there a fix for this issue?</li>
  <li>Is it possible to force a retry on Jenkins TFS?</li>
  </ul>
  
  <p><strong>Environment</strong></p>
  
  <ul>
  <li>Jenkins v2.60.3</li>
  <li>TFS plugin 5.121.0 </li>
  <li>Windows 10 64-bit </li>
  <li>Java 1.8</li>
  </ul>
  
  <p><strong>Console with Stack Traceback From Jenkins</strong></p>
  
  <pre><code>Querying for remote changeset at '$/XXX/YYY' as of 'D0039-09-22T18:26:39Z'...
  FATAL: hudson.remoting.ProxyException: com.microsoft.tfs.core.exceptions.TECoreException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
  hudson.remoting.ProxyException: com.microsoft.tfs.core.ws.runtime.exceptions.SOAPFault: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
      at com.microsoft.tfs.core.ws.runtime.client.SOAP12Service.examineResponseDOMForFault(SOAP12Service.java:117)
      at com.microsoft.tfs.core.ws.runtime.client.SOAPService.examineBodyForFault(SOAPService.java:987)
      at com.microsoft.tfs.core.ws.runtime.client.SOAPService.executeSOAPRequestInternal(SOAPService.java:665)
      at com.microsoft.tfs.core.ws.runtime.client.SOAPService.executeSOAPRequest(SOAPService.java:444)
      at ms.tfs.versioncontrol.clientservices._03._RepositorySoap12Service.queryHistory(_RepositorySoap12Service.java:1503)
      at com.microsoft.tfs.core.clients.versioncontrol.internal.WebServiceLayer.queryHistory(WebServiceLayer.java:1573)
      at com.microsoft.tfs.core.clients.versioncontrol.internal.WebServiceLayerLocalWorkspaces.queryHistory(WebServiceLayerLocalWorkspaces.java:1254)
      at com.microsoft.tfs.core.clients.versioncontrol.VersionControlClient.queryHistory(VersionControlClient.java:4264)
      at hudson.plugins.tfs.model.MockableVersionControlClient.queryHistory(MockableVersionControlClient.java:255)
      at hudson.plugins.tfs.commands.RemoteChangesetVersionCommand.call(RemoteChangesetVersionCommand.java:66)
      at hudson.plugins.tfs.commands.RemoteChangesetVersionCommand.call(RemoteChangesetVersionCommand.java:34)
      at hudson.remoting.UserRequest.perform(UserRequest.java:153)
      at hudson.remoting.UserRequest.perform(UserRequest.java:50)
      at hudson.remoting.Request$2.run(Request.java:336)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at hudson.remoting.Engine$1$1.run(Engine.java:94)
      at java.lang.Thread.run(Unknown Source)
  Caused: hudson.remoting.ProxyException: com.microsoft.tfs.core.exceptions.TECoreException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
      at com.microsoft.tfs.core.exceptions.mappers.TECoreExceptionMapper.map(TECoreExceptionMapper.java:92)
      at com.microsoft.tfs.core.exceptions.mappers.VersionControlExceptionMapper.map(VersionControlExceptionMapper.java:43)
      at com.microsoft.tfs.core.clients.versioncontrol.internal.WebServiceLayer.queryHistory(WebServiceLayer.java:1589)
      at com.microsoft.tfs.core.clients.versioncontrol.internal.WebServiceLayerLocalWorkspaces.queryHistory(WebServiceLayerLocalWorkspaces.java:1254)
      at com.microsoft.tfs.core.clients.versioncontrol.VersionControlClient.queryHistory(VersionControlClient.java:4264)
      at hudson.plugins.tfs.model.MockableVersionControlClient.queryHistory(MockableVersionControlClient.java:255)
      at hudson.plugins.tfs.commands.RemoteChangesetVersionCommand.call(RemoteChangesetVersionCommand.java:66)
      at hudson.plugins.tfs.commands.RemoteChangesetVersionCommand.call(RemoteChangesetVersionCommand.java:34)
      at hudson.remoting.UserRequest.perform(UserRequest.java:153)
      at hudson.remoting.UserRequest.perform(UserRequest.java:50)
      at hudson.remoting.Request$2.run(Request.java:336)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at hudson.remoting.Engine$1$1.run(Engine.java:94)
      at java.lang.Thread.run(Unknown Source)
      at ......remote call to JNLP4-connect connection from JENKINS-NODE/10.0.0.226:13135(Native Method)
      at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1554)
      at hudson.remoting.UserResponse.retrieve(UserRequest.java:281)
      at hudson.remoting.Channel.call(Channel.java:839)
      at hudson.plugins.tfs.model.Server.execute(Server.java:233)
  Caused: java.lang.RuntimeException
      at hudson.plugins.tfs.model.Server.execute(Server.java:237)
      at hudson.plugins.tfs.model.Project.extractChangesetNumber(Project.java:280)
      at hudson.plugins.tfs.model.Project.getRemoteChangesetVersion(Project.java:276)
      at hudson.plugins.tfs.model.Project.getRemoteChangesetVersion(Project.java:292)
      at hudson.plugins.tfs.TeamFoundationServerScm.recordWorkspaceChangesetVersion(TeamFoundationServerScm.java:370)
      at hudson.plugins.tfs.TeamFoundationServerScm.checkout(TeamFoundationServerScm.java:319)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1212)
      at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:566)
      at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:491)
      at hudson.model.Run.execute(Run.java:1737)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:419)
  </code></pre>