• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • tfs-plugin
    • None
    • Windows 2012 R2
      jre1.8.0_161 x64
      Jenkins 2.104
      TFS plugin 5.126

      The master is running 8 executors which are running jobs in parallel. Whenever multiple jobs are started in parallel the TFS workspace mapping sometimes fails. The more jobs, the higher the chance of failure.

       

      Started by upstream project "<version>/build work" build number 63
      originally caused by:
       Started by an SCM change
      [EnvInject] - Loading node environment variables.
      Building on master in workspace d:\jenkins\workspace\<version>\work\edis_11.7-ora12
      Querying for remote changeset at '$/<project>/<version>/work' as of 'D2018-02-01T21:21:03Z'...
      Query result is: Changeset #233334 by '<domain>\<user>' on '2018-02-01T21:09:12Z'.
      Checking if there exists a mapping for d:\jenkins\workspace\<version>\work\edis_11.7-ora12...no.
      Downloading list of workspaces from https://<tfs>:8088/tfs/<collection>...
      Warning: Although the server thinks the workspace exists, no mapping was found.
      Deleting workspaces named 'Jenkins-<version>-work-edis_11.7-ora12-MASTER' from computer 'NLC1DEVEFEJEN01'...
      Deleted 1 workspace(s) named 'Jenkins-<version>-work-edis_11.7-ora12-MASTER'.
      Creating workspace 'Jenkins-<version>-work-edis_11.7-ora12-MASTER' owned by '<domain>\<user>'...
      Mapping '$/<project>/<version>/work' to local folder 'd:\jenkins\workspace\<version>\work\edis_11.7-ora12' in workspace 'Jenkins-<version>-work-edis_11.7-ora12-MASTER'...
      Cloaking '$/<project>/<version>/work/bl' in workspace 'Jenkins-<version>-work-edis_11.7-ora12-MASTER'...
      Cloaking '$/<project>/<version>/work/bp' in workspace 'Jenkins-<version>-work-edis_11.7-ora12-MASTER'...
      Cloaking '$/<project>/<version>/work/i' in workspace 'Jenkins-<version>-work-edis_11.7-ora12-MASTER'...
      Cloaking '$/<project>/<version>/work/other/db' in workspace 'Jenkins-<version>-work-edis_11.7-ora12-MASTER'...
      Cloaking '$/<project>/<version>/work/other/general' in workspace 'Jenkins-<version>-work-edis_11.7-ora12-MASTER'...
      Cloaking '$/<project>/<version>/work/other/internal' in workspace 'Jenkins-<version>-work-edis_11.7-ora12-MASTER'...
      Cloaking '$/<project>/<version>/work/other/jenkins' in workspace 'Jenkins-<version>-work-edis_11.7-ora12-MASTER'...
      Cloaking '$/<project>/<version>/work/other/translat' in workspace 'Jenkins-<version>-work-edis_11.7-ora12-MASTER'...
      Cloaking '$/<project>/<version>/work/other/tools' in workspace 'Jenkins-<version>-work-edis_11.7-ora12-MASTER'...
      Cloaking '$/<project>/<version>/work/other/windows' in workspace 'Jenkins-<version>-work-edis_11.7-ora12-MASTER'...
      Cloaking '$/<project>/<version>/work/qa/api' in workspace 'Jenkins-<version>-work-edis_11.7-ora12-MASTER'...
      Cloaking '$/<project>/<version>/work/qa/codedui' in workspace 'Jenkins-<version>-work-edis_11.7-ora12-MASTER'...
      Cloaking '$/<project>/<version>/work/qa/exceladdin' in workspace 'Jenkins-<version>-work-edis_11.7-ora12-MASTER'...
      Cloaking '$/<project>/<version>/work/qa/report' in workspace 'Jenkins-<version>-work-edis_11.7-ora12-MASTER'...
      Cloaking '$/<project>/<version>/work/qa/ui' in workspace 'Jenkins-<version>-work-edis_11.7-ora12-MASTER'...
      Cloaking '$/<project>/<version>/work/qa/upgrade' in workspace 'Jenkins-<version>-work-edis_11.7-ora12-MASTER'...
      Cloaking '$/<project>/<version>/work/ui' in workspace 'Jenkins-<version>-work-edis_11.7-ora12-MASTER'...
      Cloaking '$/<project>/<version>/work/ws' in workspace 'Jenkins-<version>-work-edis_11.7-ora12-MASTER'...
      Created workspace 'Jenkins-<version>-work-edis_11.7-ora12-MASTER'.
      Getting version 'C233334' to 'd:\jenkins\workspace\<version>\work\edis_11.7-ora12'...
      FATAL: com.microsoft.tfs.core.clients.versioncontrol.exceptions.ItemNotMappedException: There is no working folder mapping for D:\jenkins\workspace\<version>\work\edis_11.7-ora12.
      com.microsoft.tfs.core.clients.versioncontrol.exceptions.ItemNotMappedException: There is no working folder mapping for D:\jenkins\workspace\<version>\work\edis_11.7-ora12.
       at com.microsoft.tfs.core.clients.versioncontrol.VersionControlClient.getLocalWorkspace(VersionControlClient.java:699)
       at com.microsoft.tfs.core.clients.versioncontrol.VersionControlClient.getWorkspace(VersionControlClient.java:1964)
       at hudson.plugins.tfs.model.MockableVersionControlClient.getWorkspace(MockableVersionControlClient.java:197)
       at hudson.plugins.tfs.commands.GetFilesToWorkFolderCommand.call(GetFilesToWorkFolderCommand.java:69)
       at hudson.plugins.tfs.commands.GetFilesToWorkFolderCommand.call(GetFilesToWorkFolderCommand.java:18)
       at hudson.remoting.LocalChannel.call(LocalChannel.java:45)
       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.getFiles(Project.java:264)
       at hudson.plugins.tfs.actions.CheckoutAction.checkout(CheckoutAction.java:63)
       at hudson.plugins.tfs.TeamFoundationServerScm.checkout(TeamFoundationServerScm.java:352)
       at hudson.scm.SCM.checkout(SCM.java:504)
       at hudson.model.AbstractProject.checkout(AbstractProject.java:1203)
       at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
       at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
       at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
       at hudson.model.Run.execute(Run.java:1727)
       at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
       at hudson.model.ResourceController.execute(ResourceController.java:97)
       at hudson.model.Executor.run(Executor.java:429)

       

      Notice how the mapping is created and then subsequently considered missing. The failures also seem to occur in pairs.

      If I manually restart the job, there are no problems:

      Started by user Stefan Drissen
      [EnvInject] - Loading node environment variables.
      Building on master in workspace d:\jenkins\workspace\<version>\work\edis_11.7-ora12
      Querying for remote changeset at '$/<project>/<version>/work' as of 'D2018-02-01T21:57:54Z'...
      Query result is: Changeset #233334 by '<domain>\<user>' on '2018-02-01T21:09:12Z'.
      Checking if there exists a mapping for d:\jenkins\workspace\<version>\work\edis_11.7-ora12...yes, in workspace 'Jenkins-<version>-work-edis_11.7-ora12-MASTER'.
      Downloading list of workspaces from https://<tfs>:8088/tfs/<collection>...
      Getting version 'C233334' to 'd:\jenkins\workspace\<version>\work\edis_11.7-ora12'...
      Finished getting version 'C233334'. Retrieved 1852 resources.

       

      Prior to upgrading the TFS plug-in to 5.x (from 3.2) I had similar issues with the tf.exe client (see https://social.msdn.microsoft.com/Forums/vstudio/en-US/0f9a3368-de75-47b7-925b-3cfbe9ac810c/tf-get-intermittently-reports-unable-to-determine-workspace?forum=tee)  - I had hoped that this would be solved by the Java implementation. 

          [JENKINS-49324] Intermittent ItemNotMappedException

          Hi all,

          I can confirm this issue and the exception described above! The problem increases the more executors are defined in Jenkins and the faster the Jenkins Server hardware is.
          A reasonable workaround is not available beside setting the Jenkins Checkout retry option (I just configured it and hope that it helps to solve the problem).

          As this problem is pending for a long period and various Jenkins versions I would appreaciate if someone could analyze the root cause of the problem and fix this issue. It seems to be some kind of race condition in parallel checkout of several projects.

          If some further input or traces are required please let me know. I'll try to provide them as far as possible.

          Thanks and best regards
          Flocki

          Florian Pepping added a comment - Hi all, I can confirm this issue and the exception described above! The problem increases the more executors are defined in Jenkins and the faster the Jenkins Server hardware is. A reasonable workaround is not available beside setting the Jenkins Checkout retry option (I just configured it and hope that it helps to solve the problem). As this problem is pending for a long period and various Jenkins versions I would appreaciate if someone could analyze the root cause of the problem and fix this issue. It seems to be some kind of race condition in parallel checkout of several projects. If some further input or traces are required please let me know. I'll try to provide them as far as possible. Thanks and best regards Flocki

          Chris Page added a comment -

          Hi All,

          I too am seeing this issue.  Is this still being worked on, or has a solution been found?  Thanks!

          Chris

          Chris Page added a comment - Hi All, I too am seeing this issue.  Is this still being worked on, or has a solution been found?  Thanks! Chris

          Ian Williams added a comment -

          redsolo is no longer maintaining plugin; unassigned issues

          Ian Williams added a comment - redsolo is no longer maintaining plugin; unassigned issues

            Unassigned Unassigned
            smd Stefan Drissen
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: