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

Starting build with jenkins-cli and File Parameter fails in HTTP mode

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Critical
    • Resolution: Unresolved
    • Component/s: cli
    • Labels:
      None
    • Environment:
      2.60.1
    • Similar Issues:

      Description

      I am running into an issue with Jenkins 2.60.1 and the new "remoting-free" jenkins-cli. When running build command with string, boolean and other parameters, it works fine.
       
      However, using the File Parameter fails with the message

      ERROR: This command is requesting the deprecated -remoting mode. See [https://jenkins.io/redirect/cli-command-requires-channel]
      

      Uploading a file as a parameter is not mentioned anywhere, as far as I could find, and the help page is not helpful at all.
      If I invoke the command with -remoting mode enabled, it works, but I would expect this functionality to work even in http mode.

      For reference, this is the command I am using:

      $ java -jar jenkins-cli.jar -s https://jenkins.example.com:443/ build testing -p paramfile.txt=hello.txt
      

       

      This works without any problems with older versions.

        Attachments

          Activity

          melka Martin Melka created issue -
          melka Martin Melka made changes -
          Field Original Value New Value
          Description I am running into an issue with Jenkins 2.60.1 and the new "remoting-free" jenkins-cli. When running {{build}} command with string, boolean and other parameters, it works fine.
           
          However, using the File Parameter fails with the message
          {code}
          ERROR: This command is requesting the deprecated -remoting mode. See [https://jenkins.io/redirect/cli-command-requires-channel]
          {code}
          Uploading a file as a parameter is not mentioned anywhere, as far as I could find, and the help page is not helpful at all.
          I am running into an issue with Jenkins 2.60.1 and the new "remoting-free" jenkins-cli. When running {{build}} command with string, boolean and other parameters, it works fine.
            
           However, using the File Parameter fails with the message
          {code:java}
          ERROR: This command is requesting the deprecated -remoting mode. See [https://jenkins.io/redirect/cli-command-requires-channel]
          {code}
          Uploading a file as a parameter is not mentioned anywhere, as far as I could find, and the help page is not helpful at all. If I invoke the command *with* {-remoting} mode enabled, it works, but I would expect this functionality to work even in http mode.

           

          This works without any problems with older versions.
          melka Martin Melka made changes -
          Summary Starting build with jenkins-cli and File Parameter fails Starting build with jenkins-cli and File Parameter fails in HTTP mode
          melka Martin Melka made changes -
          Description I am running into an issue with Jenkins 2.60.1 and the new "remoting-free" jenkins-cli. When running {{build}} command with string, boolean and other parameters, it works fine.
            
           However, using the File Parameter fails with the message
          {code:java}
          ERROR: This command is requesting the deprecated -remoting mode. See [https://jenkins.io/redirect/cli-command-requires-channel]
          {code}
          Uploading a file as a parameter is not mentioned anywhere, as far as I could find, and the help page is not helpful at all. If I invoke the command *with* {-remoting} mode enabled, it works, but I would expect this functionality to work even in http mode.

           

          This works without any problems with older versions.
          I am running into an issue with Jenkins 2.60.1 and the new "remoting-free" jenkins-cli. When running {{build}} command with string, boolean and other parameters, it works fine.
            
           However, using the File Parameter fails with the message
          {code:java}
          ERROR: This command is requesting the deprecated -remoting mode. See [https://jenkins.io/redirect/cli-command-requires-channel]
          {code}
          Uploading a file as a parameter is not mentioned anywhere, as far as I could find, and the help page is not helpful at all.
          If I invoke the command *with* {{-remoting}} mode enabled, it works, but I would expect this functionality to work even in http mode.

           

          This works without any problems with older versions.
          melka Martin Melka made changes -
          Description I am running into an issue with Jenkins 2.60.1 and the new "remoting-free" jenkins-cli. When running {{build}} command with string, boolean and other parameters, it works fine.
            
           However, using the File Parameter fails with the message
          {code:java}
          ERROR: This command is requesting the deprecated -remoting mode. See [https://jenkins.io/redirect/cli-command-requires-channel]
          {code}
          Uploading a file as a parameter is not mentioned anywhere, as far as I could find, and the help page is not helpful at all.
          If I invoke the command *with* {{-remoting}} mode enabled, it works, but I would expect this functionality to work even in http mode.

           

          This works without any problems with older versions.
          I am running into an issue with Jenkins 2.60.1 and the new "remoting-free" jenkins-cli. When running {{build}} command with string, boolean and other parameters, it works fine.
            
           However, using the File Parameter fails with the message
          {code:java}
          ERROR: This command is requesting the deprecated -remoting mode. See [https://jenkins.io/redirect/cli-command-requires-channel]
          {code}
          Uploading a file as a parameter is not mentioned anywhere, as far as I could find, and the help page is not helpful at all.
          If I invoke the command *with* {{-remoting}} mode enabled, it works, but I would expect this functionality to work even in http mode.

          For reference, this is the command I am using:
          {code}
          $ java -jar jenkins-cli.jar -s https://jenkins.example.com:443/ build testing -p paramfile.txt=hello.txt
          {code}
           

          This works without any problems with older versions.
          Hide
          chenrici Christoph Henrici added a comment - - edited

          Any information on this? This is obviously an issue or missing documentation.   Also the link is wrong.  

          I had the same problem using cli over ssh, so it's not restricted to http

          ssh -l xxx  -p 53801  172.16.92.190  build TestFileParameter -v -f -s -p testFile=Test.json
          

           Also running on localhost 

          ssh -l xxx  -p 53801  localhost  build TestFileParameter -v -f -s -p testFile.json=Test.json
          

          Fails in the same way. 

           

          Show
          chenrici Christoph Henrici added a comment - - edited Any information on this? This is obviously an issue or missing documentation.   Also the link is wrong.   I had the same problem using cli over ssh, so it's not restricted to http ssh -l xxx  -p 53801  172.16.92.190  build TestFileParameter -v -f -s -p testFile=Test.json  Also running on localhost  ssh -l xxx  -p 53801  localhost  build TestFileParameter -v -f -s -p testFile.json=Test.json Fails in the same way.   
          Hide
          chenrici Christoph Henrici added a comment -

          After looking at the Code: https://github.com/jenkinsci/jenkins/blob/cc964ef664250b6737e471ef546a46a37421cb4f/core/src/main/java/hudson/model/FileParameterDefinition.java

          I found that this works: 

           

          cat Test.json |  ssh -l che  -p 53801  localhost  build TestFileParameter -v -f -s  -p testFile.json=
          

          This transfers the file correctly and creates a file named 'stdin' in the workspace containing the data of Test.json

          Show
          chenrici Christoph Henrici added a comment - After looking at the Code: https://github.com/jenkinsci/jenkins/blob/cc964ef664250b6737e471ef546a46a37421cb4f/core/src/main/java/hudson/model/FileParameterDefinition.java I found that this works:    cat Test.json |  ssh -l che  -p 53801  localhost  build TestFileParameter -v -f -s  -p testFile.json= This transfers the file correctly and creates a file named 'stdin' in the workspace containing the data of Test.json

            People

            • Assignee:
              Unassigned
              Reporter:
              melka Martin Melka
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: