java.io.IOException: Cannot run program "tf" (in directory "C:\Lakshmi\Jenkins-Workspace\NOVA"): CreateProcess error=2, The system cannot find the file specified

Jenkins JIRA | Lakshmi Jaganathan | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    I have added path of tf.cmd in environment vaiables and able to see tf configured in configure systems. Also I am able to execute the tf command in command prompt from path C:\XXX\Jenkins\TEE-CLC-12.0.2 (1)\TEE-CLC-12.0.2(this is the path configured in PATH environment variables). But When i trigger the build then i m getting below error while checking out the source code. Error is java.io.IOException: Cannot run program "tf" (in directory "C:\Lakshmi\Jenkins-Workspace\NOVA"): CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(Unknown Source) at hudson.Proc$LocalProc.<init>(Proc.java:244) at hudson.Proc$LocalProc.<init>(Proc.java:216) at hudson.Launcher$LocalLauncher.launch(Launcher.java:816) at hudson.Launcher$ProcStarter.start(Launcher.java:382) at hudson.plugins.tfs.TfTool.execute(TfTool.java:101) at hudson.plugins.tfs.model.Server.execute(Server.java:121) at hudson.plugins.tfs.model.Project.extractChangesetNumber(Project.java:219) at hudson.plugins.tfs.model.Project.getRemoteChangesetVersion(Project.java:212) at hudson.plugins.tfs.model.Project.getRemoteChangesetVersion(Project.java:235) at hudson.plugins.tfs.TeamFoundationServerScm.recordWorkspaceChangesetVersion(TeamFoundationServerScm.java:239) at hudson.plugins.tfs.TeamFoundationServerScm.checkout(TeamFoundationServerScm.java:205) at hudson.model.AbstractProject.checkout(AbstractProject.java:1282) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532) at hudson.model.Run.execute(Run.java:1741) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:381) Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 20 more Finished: FAILURE

    Jenkins JIRA | 2 years ago | Lakshmi Jaganathan
    java.io.IOException: Cannot run program "tf" (in directory "C:\Lakshmi\Jenkins-Workspace\NOVA"): CreateProcess error=2, The system cannot find the file specified
  2. 0

    I have added path of tf.cmd in environment vaiables and able to see tf configured in configure systems. Also I am able to execute the tf command in command prompt from path C:\XXX\Jenkins\TEE-CLC-12.0.2 (1)\TEE-CLC-12.0.2(this is the path configured in PATH environment variables). But When i trigger the build then i m getting below error while checking out the source code. Error is java.io.IOException: Cannot run program "tf" (in directory "C:\Lakshmi\Jenkins-Workspace\NOVA"): CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(Unknown Source) at hudson.Proc$LocalProc.<init>(Proc.java:244) at hudson.Proc$LocalProc.<init>(Proc.java:216) at hudson.Launcher$LocalLauncher.launch(Launcher.java:816) at hudson.Launcher$ProcStarter.start(Launcher.java:382) at hudson.plugins.tfs.TfTool.execute(TfTool.java:101) at hudson.plugins.tfs.model.Server.execute(Server.java:121) at hudson.plugins.tfs.model.Project.extractChangesetNumber(Project.java:219) at hudson.plugins.tfs.model.Project.getRemoteChangesetVersion(Project.java:212) at hudson.plugins.tfs.model.Project.getRemoteChangesetVersion(Project.java:235) at hudson.plugins.tfs.TeamFoundationServerScm.recordWorkspaceChangesetVersion(TeamFoundationServerScm.java:239) at hudson.plugins.tfs.TeamFoundationServerScm.checkout(TeamFoundationServerScm.java:205) at hudson.model.AbstractProject.checkout(AbstractProject.java:1282) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532) at hudson.model.Run.execute(Run.java:1741) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:381) Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 20 more Finished: FAILURE

    Jenkins JIRA | 2 years ago | Lakshmi Jaganathan
    java.io.IOException: Cannot run program "tf" (in directory "C:\Lakshmi\Jenkins-Workspace\NOVA"): CreateProcess error=2, The system cannot find the file specified
  3. 0

    tech.sunnyw .Net: Setup Jenkins on TFS 2008 for MSBuild project

    sunnyw.net | 12 months ago
    java.io.IOException: Cannot run program "tf" (in directory "C:\Program Files (x86)\Jenkins\jobs\XXX\workspace"): CreateProcess error=2, The system cannot find the file specified
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Jenkins got error while getting the source from Team Foundation Server

    Stack Overflow | 2 years ago | Shyamsundar Thirunavukkarasu
    java.io.IOException: Cannot run program "tf" (in directory " <WorkspacePath>\custom_workspace"): CreateProcess error=2, The system cannot find the file specified
  6. 0

    When the github webhook runs, it tries to init a repository in a location that the agent profile doesn't have access to. The agent's userprofile folder is c:\users\jenkins.domainsvr\ however the webhook tries to use c:\users\jenkins\ Started on Sep 17, 2015 12:57:39 PM Using strategy: Default [poll] Last Built Revision: Revision ded997929221f7ecce1366cb104f2b75992c7dd2 (refs/remotes/origin/dev) using .gitcredentials to set credentials > C:\Program Files\Git\bin\git.exe --version # timeout=10 [WARNING] Installed git version too old for credentials support > C:\Program Files\Git\bin\git.exe init C:\Users\Jenkins\AppData\Local\Temp\hudson6971482768098223685tmp # timeout=10 > C:\Program Files\Git\bin\git.exe config --local --remove-section credential # timeout=10 Could not remove the credential section from the git configuration FATAL: hudson.plugins.git.GitException: Could not init C:\Users\Jenkins\AppData\Local\Temp\hudson6971482768098223685tmp hudson.util.IOException2: hudson.plugins.git.GitException: Could not init C:\Users\Jenkins\AppData\Local\Temp\hudson6971482768098223685tmp at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:529) at hudson.scm.SCM.compareRemoteRevisionWith(SCM.java:381) at hudson.scm.SCM.poll(SCM.java:398) at hudson.model.AbstractProject._poll(AbstractProject.java:1454) at hudson.model.AbstractProject.poll(AbstractProject.java:1357) at com.cloudbees.jenkins.GitHubPushTrigger$1.runPolling(GitHubPushTrigger.java:73) at com.cloudbees.jenkins.GitHubPushTrigger$1.run(GitHubPushTrigger.java:99) at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118) at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) 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 java.lang.Thread.run(Unknown Source) Caused by: hudson.plugins.git.GitException: Could not init C:\Users\Jenkins\AppData\Local\Temp\hudson6971482768098223685tmp at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$4.execute(CliGitAPIImpl.java:606) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1331) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1282) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1273) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getHeadRev(CliGitAPIImpl.java:2376) at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:583) at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:527) ... 14 more Caused by: hudson.plugins.git.GitException: Error performing command: C:\Program Files\Git\bin\git.exe init C:\Users\Jenkins\AppData\Local\Temp\hudson6971482768098223685tmp at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1647) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1616) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1612) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1254) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$4.execute(CliGitAPIImpl.java:604) ... 20 more Caused by: java.io.IOException: Cannot run program "C:\Program Files\Git\bin\git.exe": CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(Unknown Source) at hudson.Proc$LocalProc.<init>(Proc.java:244) at hudson.Proc$LocalProc.<init>(Proc.java:216) at hudson.Launcher$LocalLauncher.launch(Launcher.java:816) at hudson.Launcher$ProcStarter.start(Launcher.java:382) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1636) ... 24 more Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 30 more Done. Took 22 ms No changes

    Jenkins JIRA | 2 years ago | Mark Edwards
    hudson.util.IOException2: hudson.plugins.git.GitException: Could not init C:\Users\Jenkins\AppData\Local\Temp\hudson6971482768098223685tmp

  1. rp 1 times, last 4 months ago
  2. michallos 1 times, last 5 months ago
  3. eti22 1 times, last 6 months ago
  4. asdasd 24 times, last 7 months ago
  5. rexgreenza 8 times, last 7 months ago
2 more registered users
93 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.io.IOException

    CreateProcess error=2, The system cannot find the file specified

    at java.lang.ProcessImpl.create()
  2. Java RT
    ProcessBuilder.start
    1. java.lang.ProcessImpl.create(Native Method)
    2. java.lang.ProcessImpl.<init>(Unknown Source)
    3. java.lang.ProcessImpl.start(Unknown Source)
    4. java.lang.ProcessBuilder.start(Unknown Source)
    4 frames
  3. Hudson
    Launcher$ProcStarter.start
    1. hudson.Proc$LocalProc.<init>(Proc.java:244)
    2. hudson.Proc$LocalProc.<init>(Proc.java:216)
    3. hudson.Launcher$LocalLauncher.launch(Launcher.java:816)
    4. hudson.Launcher$ProcStarter.start(Launcher.java:382)
    4 frames
  4. hudson.plugins.tfs
    TeamFoundationServerScm.checkout
    1. hudson.plugins.tfs.TfTool.execute(TfTool.java:101)
    2. hudson.plugins.tfs.model.Server.execute(Server.java:121)
    3. hudson.plugins.tfs.model.Project.extractChangesetNumber(Project.java:219)
    4. hudson.plugins.tfs.model.Project.getRemoteChangesetVersion(Project.java:212)
    5. hudson.plugins.tfs.model.Project.getRemoteChangesetVersion(Project.java:235)
    6. hudson.plugins.tfs.TeamFoundationServerScm.recordWorkspaceChangesetVersion(TeamFoundationServerScm.java:239)
    7. hudson.plugins.tfs.TeamFoundationServerScm.checkout(TeamFoundationServerScm.java:205)
    7 frames
  5. Hudson
    AbstractBuild$AbstractBuildExecution.defaultCheckout
    1. hudson.model.AbstractProject.checkout(AbstractProject.java:1282)
    2. hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610)
    2 frames
  6. jenkins.scm
    SCMCheckoutStrategy.checkout
    1. jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    1 frame
  7. Hudson
    Executor.run
    1. hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
    2. hudson.model.Run.execute(Run.java:1741)
    3. hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    4. hudson.model.ResourceController.execute(ResourceController.java:98)
    5. hudson.model.Executor.run(Executor.java:381)
    5 frames