Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-34478

JSON-editor with File-Upload causes "Argument list too long" fatal error

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      Ubuntu 14.04 x64
      Oracle JDK 1.7.0_80
      Extended Choice Parameter Plug-In 0.64
    • Similar Issues:

      Description

      Related to: JENKINS-34440

      After using File-Upload feature from JSON-Editor with a single 2MB file upload,
      the Jenkins job return fatal error:

      [test-JSON_UI] $ /bin/bash -x /tmp/hudson8925785768174517081.sh
      FATAL: command execution failed
      java.io.IOException: Cannot run program "/bin/bash" (in directory "/home/devops/jenkins_slave/workspace/Test/test-JSON_UI"): error=7, Argument list too long
      at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
      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.Launcher$RemoteLaunchCallable.call(Launcher.java:1148)
      at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1113)
      at hudson.remoting.UserRequest.perform(UserRequest.java:120)
      at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      at hudson.remoting.Request$2.run(Request.java:326)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)
      at ......remote call to jenkins-slave3(192.168.100.162)(Native Method)
      at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1416)
      at hudson.remoting.UserResponse.retrieve(UserRequest.java:220)
      at hudson.remoting.Channel.call(Channel.java:781)
      at hudson.Launcher$RemoteLauncher.launch(Launcher.java:928)
      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: error=7, Argument list too long
      at java.lang.UNIXProcess.forkAndExec(Native Method)
      at java.lang.UNIXProcess.<init>(UNIXProcess.java:187)
      at java.lang.ProcessImpl.start(ProcessImpl.java:130)
      at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
      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.Launcher$RemoteLaunchCallable.call(Launcher.java:1148)
      at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1113)
      at hudson.remoting.UserRequest.perform(UserRequest.java:120)
      at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      at hudson.remoting.Request$2.run(Request.java:326)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)

        Attachments

          Activity

          totoroliu Rick Liu created issue -
          Hide
          totoroliu Rick Liu added a comment -

          If I'm using Jenkins File parameter,
          I'm able to upload a single 50MB+ file.

          Show
          totoroliu Rick Liu added a comment - If I'm using Jenkins File parameter, I'm able to upload a single 50MB+ file.
          Hide
          vimil vimil added a comment -

          This error is because the json has exceeded the maximimum length of arguments that can be passed through the commandline.

          You can choose the save to file option in the configuration to save the json value to a file. The batch program can then access the json file directly without it being passed through the commandline.

          Show
          vimil vimil added a comment - This error is because the json has exceeded the maximimum length of arguments that can be passed through the commandline. You can choose the save to file option in the configuration to save the json value to a file. The batch program can then access the json file directly without it being passed through the commandline.
          Hide
          totoroliu Rick Liu added a comment -

          Is it correct that this "save to file" option stores the file on Jenkins master and not on Jenkins slave?

          Show
          totoroliu Rick Liu added a comment - Is it correct that this "save to file" option stores the file on Jenkins master and not on Jenkins slave?
          Hide
          vimil vimil added a comment -

          Yes thats right. Let me know if you run into issues with this

          Show
          vimil vimil added a comment - Yes thats right. Let me know if you run into issues with this
          Hide
          totoroliu Rick Liu added a comment -

          What's the normal practice to download files from master? (hopefully without plugin)
          or Do I have to use plugins? (any suggestions)

          Show
          totoroliu Rick Liu added a comment - What's the normal practice to download files from master? (hopefully without plugin) or Do I have to use plugins? (any suggestions)
          Hide
          vimil vimil added a comment -

          Rick, I can make an enhancement to store the file in the job's work-space folder. So if the job runs on the slave then it will be available in the workspace folder which is on the slave machine.

          Show
          vimil vimil added a comment - Rick, I can make an enhancement to store the file in the job's work-space folder. So if the job runs on the slave then it will be available in the workspace folder which is on the slave machine.
          Hide
          totoroliu Rick Liu added a comment -

          That'd be awesome~
          Thank you very much vimil.

          Show
          totoroliu Rick Liu added a comment - That'd be awesome~ Thank you very much vimil.
          Hide
          totoroliu Rick Liu added a comment -

          By the way,

          I have another question regarding to JSON's File option:

          "File": {
          "type": "string",
          "propertyOrder": 3,

          • "media":
            Unknown macro: { "binaryEncoding"}

            ,*
            "options":

            Unknown macro: { "include_filename"}

            }

          Do I have to predefine "binaryEncoding" and "type"?
          If I want to allow user to upload either text files, or tarball files, or image files,
          then how do I make it to dynamically use different binaryEncoding and type?

          Show
          totoroliu Rick Liu added a comment - By the way, I have another question regarding to JSON's File option: "File": { "type": "string", "propertyOrder": 3, "media": Unknown macro: { "binaryEncoding"} ,* "options": Unknown macro: { "include_filename"} } Do I have to predefine "binaryEncoding" and "type"? If I want to allow user to upload either text files, or tarball files, or image files, then how do I make it to dynamically use different binaryEncoding and type?
          Hide
          vimil vimil added a comment -

          version 0.65 of the plugin has the enhancement to save the json file to the workspace of the running job. This will be on the slave machine if the job is configured to run on the slave.

          the json file will be present under parameters folder in the workspace. The parameter value will hold the location of the file, so you can use that to get the json file location.

          Regarding your question about predefining "binaryEncoding" and "type", you don't have to specify the type. The users will be able to upload any type of file, but all the uploaded files will appear in the json file in base64 encoded format.

          Show
          vimil vimil added a comment - version 0.65 of the plugin has the enhancement to save the json file to the workspace of the running job. This will be on the slave machine if the job is configured to run on the slave. the json file will be present under parameters folder in the workspace. The parameter value will hold the location of the file, so you can use that to get the json file location. Regarding your question about predefining "binaryEncoding" and "type", you don't have to specify the type. The users will be able to upload any type of file, but all the uploaded files will appear in the json file in base64 encoded format.
          Hide
          vimil vimil added a comment -

          marking this as fixed in version 0.65

          Show
          vimil vimil added a comment - marking this as fixed in version 0.65
          vimil vimil made changes -
          Field Original Value New Value
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 170599 ] JNJira + In-Review [ 198908 ]

            People

            • Assignee:
              vimil vimil
              Reporter:
              totoroliu Rick Liu
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: