java.io.IOException: Cannot run program "cmd.exe" (in directory "C:\jenkins\workspace\12_Common_Restore\build\Common_Restore"): CreateProcess error=206, The filename or extension is too long

Jenkins JIRA | Andrew Kujtan | 2 years ago
  1. 0

    After updating from 1.599 to 1.600 no ant build works anymore with the following stack, Let me know if any additional information is required. Reverting to 1.599 resolves the issue. {code} [Common_Restore] $ cmd.exe /C '"ant.bat -file build.xml -Djenkins.managed=true -DjarOutputDir=C:\jenkins\workspace\12_Common_Restore/workspace -DarchiveDir=C:\jenkins\workspace\12_Common_Restore/archive -DPROJECTS_SRC=C:\jenkins\workspace\12_Common_Restore -DPROJECTS_LIB=C:\jenkins\workspace\Common_Libs\lib && exit %%ERRORLEVEL%%"' The filename or extension is too long FATAL: command execution failed.Maybe you need to configure the job to choose one of your Ant installations? java.io.IOException: Cannot run program "cmd.exe" (in directory "C:\jenkins\workspace\12_Common_Restore\build\Common_Restore"): CreateProcess error=206, The filename or extension is too long 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:803) at hudson.Launcher$ProcStarter.start(Launcher.java:381) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1136) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1101) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:328) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) 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:63) at java.lang.Thread.run(Unknown Source) at ......remote call to WINDOWS-AQGP48S-87.244(Native Method) at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1356) at hudson.remoting.UserResponse.retrieve(UserRequest.java:221) at hudson.remoting.Channel.call(Channel.java:752) at hudson.Launcher$RemoteLauncher.launch(Launcher.java:916) at hudson.Launcher$ProcStarter.start(Launcher.java:381) at hudson.Launcher$ProcStarter.join(Launcher.java:388) at hudson.tasks.Ant.perform(Ant.java:217) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761) at hudson.model.Build$BuildExecution.build(Build.java:203) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:536) at hudson.model.Run.execute(Run.java:1717) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is too long at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) 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:803) at hudson.Launcher$ProcStarter.start(Launcher.java:381) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1136) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1101) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:328) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) 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:63) at java.lang.Thread.run(Unknown Source) Build step 'Invoke Ant' marked build as failure {code}

    Jenkins JIRA | 2 years ago | Andrew Kujtan
    java.io.IOException: Cannot run program "cmd.exe" (in directory "C:\jenkins\workspace\12_Common_Restore\build\Common_Restore"): CreateProcess error=206, The filename or extension is too long
  2. 0

    After updating from 1.599 to 1.600 no ant build works anymore with the following stack, Let me know if any additional information is required. Reverting to 1.599 resolves the issue. {code} [Common_Restore] $ cmd.exe /C '"ant.bat -file build.xml -Djenkins.managed=true -DjarOutputDir=C:\jenkins\workspace\12_Common_Restore/workspace -DarchiveDir=C:\jenkins\workspace\12_Common_Restore/archive -DPROJECTS_SRC=C:\jenkins\workspace\12_Common_Restore -DPROJECTS_LIB=C:\jenkins\workspace\Common_Libs\lib && exit %%ERRORLEVEL%%"' The filename or extension is too long FATAL: command execution failed.Maybe you need to configure the job to choose one of your Ant installations? java.io.IOException: Cannot run program "cmd.exe" (in directory "C:\jenkins\workspace\12_Common_Restore\build\Common_Restore"): CreateProcess error=206, The filename or extension is too long 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:803) at hudson.Launcher$ProcStarter.start(Launcher.java:381) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1136) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1101) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:328) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) 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:63) at java.lang.Thread.run(Unknown Source) at ......remote call to WINDOWS-AQGP48S-87.244(Native Method) at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1356) at hudson.remoting.UserResponse.retrieve(UserRequest.java:221) at hudson.remoting.Channel.call(Channel.java:752) at hudson.Launcher$RemoteLauncher.launch(Launcher.java:916) at hudson.Launcher$ProcStarter.start(Launcher.java:381) at hudson.Launcher$ProcStarter.join(Launcher.java:388) at hudson.tasks.Ant.perform(Ant.java:217) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761) at hudson.model.Build$BuildExecution.build(Build.java:203) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:536) at hudson.model.Run.execute(Run.java:1717) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is too long at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) 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:803) at hudson.Launcher$ProcStarter.start(Launcher.java:381) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1136) at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1101) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:328) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) 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:63) at java.lang.Thread.run(Unknown Source) Build step 'Invoke Ant' marked build as failure {code}

    Jenkins JIRA | 2 years ago | Andrew Kujtan
    java.io.IOException: Cannot run program "cmd.exe" (in directory "C:\jenkins\workspace\12_Common_Restore\build\Common_Restore"): CreateProcess error=206, The filename or extension is too long
  3. 0

    Jenkins cannot start process on Windows Slave

    Stack Overflow | 2 years ago | Alex Sorokoletov
    java.io.IOException: Cannot run program "tf" (in directory "c:\Jenkins\workspace\ProjectName-WindowsPhone"): CreateProcess error=87, The parameter is incorrect
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    "hg pull" fails when Jenkins is a Windows Service

    Stack Overflow | 2 years ago
    java.io.IOException: Cannot run program "hg" (in directory "D:\Hudson\workspace\MercurialTest"): CreateProcess error=87, The parameter is incorrect
  6. 0

    Plugin isn't compatible with Custom Tools

    GitHub | 2 years ago | joshuaspence
    java.io.IOException: Cannot run program "arc" (in directory "/mnt/jenkins-slave-workspace/workspace/redacted"): error=2, No such file or directory
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

    Cannot run program "cmd.exe" (in directory "C:\jenkins\workspace\12_Common_Restore\build\Common_Restore"): CreateProcess error=206, The filename or extension is too long

    at java.lang.ProcessBuilder.start()
  2. Java RT
    ProcessBuilder.start
    1. java.lang.ProcessBuilder.start(Unknown Source)
    1 frame
  3. Hudson
    Launcher$RemoteLaunchCallable.call
    1. hudson.Proc$LocalProc.<init>(Proc.java:244)
    2. hudson.Proc$LocalProc.<init>(Proc.java:216)
    3. hudson.Launcher$LocalLauncher.launch(Launcher.java:803)
    4. hudson.Launcher$ProcStarter.start(Launcher.java:381)
    5. hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1136)
    6. hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1101)
    6 frames
  4. Hudson :: Remoting Layer
    InterceptingExecutorService$1.call
    1. hudson.remoting.UserRequest.perform(UserRequest.java:118)
    2. hudson.remoting.UserRequest.perform(UserRequest.java:48)
    3. hudson.remoting.Request$2.run(Request.java:328)
    4. hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
    4 frames
  5. Java RT
    ThreadPoolExecutor$Worker.run
    1. java.util.concurrent.FutureTask.run(Unknown Source)
    2. java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    3. java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    3 frames
  6. Hudson :: Remoting Layer
    Engine$1$1.run
    1. hudson.remoting.Engine$1$1.run(Engine.java:63)
    1 frame
  7. Java RT
    Thread.run
    1. java.lang.Thread.run(Unknown Source)
    1 frame