java.io.IOException: Cannot run program "cmd" (in directory "c:\workspace\TestCmd"): CreateProcess error=87, The parameter is incorrect

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

This is a bug in some versions of the Arduino IDE. Try updating to the version 1.6.12 or further.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • First encounter this issue, when someone accidentally removed key value of one global properties. Suddenly all jobs started failing with exception message say "Parameter is incorrect" without detail information. Aware of the property change, spent a few hours to track down this issue. It turned out, not just global properties, a parameterized build job which has one parameter with empty key value, could cause the same error. Ideally, global properties, parameterized build config, should not allow key as empty in the first place. But there are many plugins could set properties which end up to environment properties passed to windows process. Could Jenkins do one of the following steps: 1) after consolidate all environment properties, do a validation, if found empty key, break and print out all details Or 2) after empty key found, skip it Steps to re-produce: 1) create a free style job 2) config it as parameterized build, add a String parameter, with key left as empty, value equals to "xyz" 3) add build step, execute windows shell script with just one command: echo %path% output: {code} [TestCmd] $ cmd /c call C:\Users\xyz\AppData\Local\Temp\hudson2947220984372050691.bat The parameter is incorrect FATAL: command execution failed java.io.IOException: Cannot run program "cmd" (in directory "c:\workspace\TestCmd"): CreateProcess error=87, The parameter is incorrect at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041) at hudson.Proc$LocalProc.<init>(Proc.java:244) at hudson.Proc$LocalProc.<init>(Proc.java:216) at hudson.Launcher$LocalLauncher.launch(Launcher.java:815) at hudson.Launcher$ProcStarter.start(Launcher.java:381) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:95) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:64) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782) at hudson.model.Build$BuildExecution.build(Build.java:205) at hudson.model.Build$BuildExecution.doRun(Build.java:162) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) at hudson.model.Run.execute(Run.java:1738) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Caused by: java.io.IOException: CreateProcess error=87, The parameter is incorrect at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(ProcessImpl.java:385) at java.lang.ProcessImpl.start(ProcessImpl.java:136) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022) ... 15 more {code}
    via by Shijun Kong,
  • First encounter this issue, when someone accidentally removed key value of one global properties. Suddenly all jobs started failing with exception message say "Parameter is incorrect" without detail information. Aware of the property change, spent a few hours to track down this issue. It turned out, not just global properties, a parameterized build job which has one parameter with empty key value, could cause the same error. Ideally, global properties, parameterized build config, should not allow key as empty in the first place. But there are many plugins could set properties which end up to environment properties passed to windows process. Could Jenkins do one of the following steps: 1) after consolidate all environment properties, do a validation, if found empty key, break and print out all details Or 2) after empty key found, skip it Steps to re-produce: 1) create a free style job 2) config it as parameterized build, add a String parameter, with key left as empty, value equals to "xyz" 3) add build step, execute windows shell script with just one command: echo %path% output: {code} [TestCmd] $ cmd /c call C:\Users\xyz\AppData\Local\Temp\hudson2947220984372050691.bat The parameter is incorrect FATAL: command execution failed java.io.IOException: Cannot run program "cmd" (in directory "c:\workspace\TestCmd"): CreateProcess error=87, The parameter is incorrect at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041) at hudson.Proc$LocalProc.<init>(Proc.java:244) at hudson.Proc$LocalProc.<init>(Proc.java:216) at hudson.Launcher$LocalLauncher.launch(Launcher.java:815) at hudson.Launcher$ProcStarter.start(Launcher.java:381) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:95) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:64) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782) at hudson.model.Build$BuildExecution.build(Build.java:205) at hudson.model.Build$BuildExecution.doRun(Build.java:162) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) at hudson.model.Run.execute(Run.java:1738) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Caused by: java.io.IOException: CreateProcess error=87, The parameter is incorrect at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(ProcessImpl.java:385) at java.lang.ProcessImpl.start(ProcessImpl.java:136) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022) ... 15 more {code}
    via by Shijun Kong,
  • Ant with Hudson
    via Stack Overflow by Kumar
    ,
  • Java Doc generation failing
    via GitHub by edanian
    ,
  • Run a command shell in jenkins
    via Stack Overflow by Med braim
    ,
  • Understanding Console Output
    via by Steve Berg,
    • java.io.IOException: Cannot run program "cmd" (in directory "c:\workspace\TestCmd"): CreateProcess error=87, The parameter is incorrect at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041) at hudson.Proc$LocalProc.<init>(Proc.java:244) at hudson.Proc$LocalProc.<init>(Proc.java:216) at hudson.Launcher$LocalLauncher.launch(Launcher.java:815) at hudson.Launcher$ProcStarter.start(Launcher.java:381) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:95) at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:64) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782) at hudson.model.Build$BuildExecution.build(Build.java:205) at hudson.model.Build$BuildExecution.doRun(Build.java:162) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) at hudson.model.Run.execute(Run.java:1738) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Caused by: java.io.IOException: CreateProcess error=87, The parameter is incorrect at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.<init>(ProcessImpl.java:385) at java.lang.ProcessImpl.start(ProcessImpl.java:136) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022) ... 15 more

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    158 more bugmates