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

Inconsistent CLI failiures

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • cli

    Description

      I keep running into this. It's not a consistent behavior as the same CLI command passes/fails randomly.

      The command from CLI is: java -jar jenkins-cli.jar -s http://my-URL build job_name --username "admn" --password "admn1234" -p p1=$var p2=$othervar -w

      And here's the obtained error:
      May 11, 2015 3:04:05 PM WARNING org.jenkinsci.main.modules.cli.auth.ssh.SshCliAuthenticator authenticate
      CLI authentication failure
      java.io.EOFException
      at java.io.DataInputStream.readUnsignedShort(DataInputStream.java:323)
      at java.io.DataInputStream.readUTF(DataInputStream.java:572)
      at java.io.DataInputStream.readUTF(DataInputStream.java:547)
      at hudson.cli.Connection.readUTF(Connection.java:85)
      at hudson.cli.Connection.verifyIdentity(Connection.java:244)
      at org.jenkinsci.main.modules.cli.auth.ssh.SshCliAuthenticator.authenticate(SshCliAuthenticator.java:39)
      at hudson.cli.CliManagerImpl$2.run(CliManagerImpl.java:109)

      Attachments

        Activity

          danielbeck Daniel Beck added a comment -

          Does it fail randomly for the same user, on the same machine? As the error is in SSH Key authentication, it is dependent on your environment.

          danielbeck Daniel Beck added a comment - Does it fail randomly for the same user, on the same machine? As the error is in SSH Key authentication, it is dependent on your environment.

          Hi Daniel,
          It's the same user. Two machines submitting to the same master often fail.
          However, I spent some time looking at things yesterday, and I realized that even in the case where the CLI build submission is actually invoked, the log would still show:
          May 12, 2015 6:41:53 AM WARNING org.jenkinsci.main.modules.cli.auth.ssh.SshCliAuthenticator authenticate
          CLI authentication failure
          java.io.EOFException
          at java.io.DataInputStream.readUnsignedShort(DataInputStream.java:323)
          at java.io.DataInputStream.readUTF(DataInputStream.java:572)
          at java.io.DataInputStream.readUTF(DataInputStream.java:547)
          at hudson.cli.Connection.readUTF(Connection.java:85)
          at hudson.cli.Connection.verifyIdentity(Connection.java:244)
          at org.jenkinsci.main.modules.cli.auth.ssh.SshCliAuthenticator.authenticate(SshCliAuthenticator.java:39)
          at hudson.cli.CliManagerImpl$2.run(CliManagerImpl.java:109)

          Any ideas?

          raccary Raymond Accary added a comment - Hi Daniel, It's the same user. Two machines submitting to the same master often fail. However, I spent some time looking at things yesterday, and I realized that even in the case where the CLI build submission is actually invoked, the log would still show: May 12, 2015 6:41:53 AM WARNING org.jenkinsci.main.modules.cli.auth.ssh.SshCliAuthenticator authenticate CLI authentication failure java.io.EOFException at java.io.DataInputStream.readUnsignedShort(DataInputStream.java:323) at java.io.DataInputStream.readUTF(DataInputStream.java:572) at java.io.DataInputStream.readUTF(DataInputStream.java:547) at hudson.cli.Connection.readUTF(Connection.java:85) at hudson.cli.Connection.verifyIdentity(Connection.java:244) at org.jenkinsci.main.modules.cli.auth.ssh.SshCliAuthenticator.authenticate(SshCliAuthenticator.java:39) at hudson.cli.CliManagerImpl$2.run(CliManagerImpl.java:109) Any ideas?
          danielbeck Daniel Beck added a comment -

          Try to add the -noKeyAuth option to the java -jar jenkins-cli.jar invocation.

          danielbeck Daniel Beck added a comment - Try to add the -noKeyAuth option to the java -jar jenkins-cli.jar invocation.

          -noKeyAuth, can you explain a bit on what this option would do?
          Note that: the master is password-protected.

          raccary Raymond Accary added a comment - -noKeyAuth, can you explain a bit on what this option would do? Note that: the master is password-protected.
          danielbeck Daniel Beck added a comment -

          It will prevent trying to authorize using an SSH key (e.g. ~/.ssh/id_rsa) which the CLI does by default.

          danielbeck Daniel Beck added a comment - It will prevent trying to authorize using an SSH key (e.g. ~/.ssh/id_rsa) which the CLI does by default.

          How will it handle the authorization then?
          Another thing, had this been always failing or passing, I wouldn't be this skeptical on this solution.
          The fact that it's an inconsistent/random/intermittent failure is the troubling part. Any ideas on what could be the reason?

          raccary Raymond Accary added a comment - How will it handle the authorization then? Another thing, had this been always failing or passing, I wouldn't be this skeptical on this solution. The fact that it's an inconsistent/random/intermittent failure is the troubling part. Any ideas on what could be the reason?
          danielbeck Daniel Beck added a comment -

          How will it handle the authorization then?

          You're specifying user name and password on the command line.

          danielbeck Daniel Beck added a comment - How will it handle the authorization then? You're specifying user name and password on the command line.
          danielbeck Daniel Beck added a comment -

          raccary So, did it work?

          danielbeck Daniel Beck added a comment - raccary So, did it work?

          It still shows in the logs as a warning.

          raccary Raymond Accary added a comment - It still shows in the logs as a warning.

          People

            Unassigned Unassigned
            raccary Raymond Accary
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: