• Icon: Task Task
    • Resolution: Unresolved
    • Icon: Minor Minor
    • cli
    • None
    • Jenkins latest version

      D:\Program Files (x86)\Jenkins\tools>java -jar jenkins-cli.jar -s http://myservername:8080/ -auth myusername:mypassword help
      java.io.IOException: Server returned HTTP response code: 401 for URL: http://myservername:8080/cli?remoting=false
              at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
              at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
              at hudson.cli.FullDuplexHttpStream.<init>(FullDuplexHttpStream.java:72)
              at hudson.cli.CLI.plainHttpConnection(CLI.java:279)
              at hudson.cli.CLI._main(CLI.java:271)
              at hudson.cli.CLI.main(CLI.java:83)

          [JENKINS-58057] Jenkins CLI - notable to execute

          Lamine Drame added a comment -

          What's in your jenkins log file ?

          /var/lib/jenkins/jenkins.log

          Lamine Drame added a comment - What's in your jenkins log file ? /var/lib/jenkins/jenkins.log

          Bk Guy added a comment -

          I was having the same issue. What works for me is I generated a token from here,  JENKINS_URL/me/configure, and use the token as the password.

          Bk Guy added a comment - I was having the same issue. What works for me is I generated a token from here,   JENKINS_URL/me/configure , and use the token as the password.

          David added a comment -

          I met this 'issue', because I have a special char '$' in my password. You should escape special char with a backslash like this '\$'

          David added a comment - I met this 'issue', because I have a special char '$' in my password. You should escape special char with a backslash like this '\$'

          James added a comment - - edited

          I am encountering the same problem - no $ in my password, but I do have a ! - tried escaping that as with backslash but no difference. 

          I've never used the CLI agent against this server, does the "remoting=false" in response indicate something needs to be enabled on the Jenkins master to allow using the CLI agent? It just feels like a permission issue.

          PS.  Using version 2.236.4

           

          James added a comment - - edited I am encountering the same problem - no $ in my password, but I do have a ! - tried escaping that as with backslash but no difference.  I've never used the CLI agent against this server, does the " remoting=false " in response indicate something needs to be enabled on the Jenkins master to allow using the CLI agent? It just feels like a permission issue. PS.  Using version 2.236.4  

          Dmytro added a comment -

          If it helps anyone - I had the same error and in my case the issue was wrong username and password

          Dmytro added a comment - If it helps anyone - I had the same error and in my case the issue was wrong username and password

            0511 Rohit Kumar
            kshahzad Khurram Shahzad
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: