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

CVS authentication failure while running rlog command (Windows master / Unix slave)

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: cvs-plugin
    • Labels:
      None
    • Environment:
      Jenkins 1.463
      CVS Plugin 2.3
      Master is running Windows, Slave is on Solaris
    • Similar Issues:

      Description

      I'm building on a Solaris slave trying to access a CVS repository over SSH connection
      Private key location is set to $SSH_PRIVATE_KEY_DIR/id_rsa
      and known hosts to $SSH_PRIVATE_KEY_DIR/known_hosts

      On the slave, SSH_PRIVATE_KEY_DIR is set to:
      /export/home/cxt2tst/.ssh

      Checkout is done properly:
      Building remotely on picard in workspace /export/home/cxt2tst/HUDSON/workspace/server.8.0
      cvs update -d -P -r HEAD -D 14 May 2012 14:17:28 +0200 server.8.0
      cvs update: Updating server.8.0
      cvs update: Updating server.8.0/configuration
      ....
      ....

      but when it tries to get the ChangeLog, an exception is raised with the following stack trace
      FATAL: CVS authentication failure while running rlog command
      java.lang.RuntimeException: CVS authentication failure while running rlog command
      at hudson.scm.CVSSCM.getRemoteLogForModule(CVSSCM.java:530)
      at hudson.scm.CVSSCM.calculateChangeLog(CVSSCM.java:414)
      at hudson.scm.CVSSCM.checkout(CVSSCM.java:821)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1218)
      at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:586)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:475)
      at hudson.model.Run.run(Run.java:1434)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:239)
      Caused by: org.netbeans.lib.cvsclient.connection.AuthenticationException: SSH connection failed.
      at org.netbeans.lib.cvsclient.connection.SSHConnection.open(SSHConnection.java:134)
      at org.netbeans.lib.cvsclient.Client$1.run(Client.java:374)
      at java.lang.Thread.run(Unknown Source)
      Caused by: com.jcraft.jsch.JSchException: java.io.FileNotFoundException: \export\home\cxt2tst\.ssh\id_rsa (The system cannot find the path specified)
      at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:98)
      at com.jcraft.jsch.JSch.addIdentity(JSch.java:224)
      at com.jcraft.jsch.JSch.addIdentity(JSch.java:218)
      at org.netbeans.lib.cvsclient.connection.SSHConnection.open(SSHConnection.java:128)
      ... 2 more
      Caused by: java.io.FileNotFoundException: \export\home\cxt2tst\.ssh\id_rsa (The system cannot find the path specified)
      at java.io.FileInputStream.open(Native Method)
      at java.io.FileInputStream.<init>(Unknown Source)
      at java.io.FileInputStream.<init>(Unknown Source)
      at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:83)
      ... 5 more

      It seems it cannot find the file due to the use of wrong path separator

        Attachments

          Activity

          lklock lklock created issue -
          Hide
          schaarda Daniel Schaarschmidt added a comment -

          Just ran into the same problem, Master is Windows, Slaves are both SLES. I would not have noticed the wrong path seperators if you had not mentioned it, but it seems to be the same problem - checkout ok (after a lot of trying around), rlog not working.

          I'm using Jenkins 1.465 and just upgraded the CVS-Plugin from 1.6 to 2.3. For now, I'll have to go back to 1.6 as this is an absolute showstopper for us.

          Show
          schaarda Daniel Schaarschmidt added a comment - Just ran into the same problem, Master is Windows, Slaves are both SLES. I would not have noticed the wrong path seperators if you had not mentioned it, but it seems to be the same problem - checkout ok (after a lot of trying around), rlog not working. I'm using Jenkins 1.465 and just upgraded the CVS-Plugin from 1.6 to 2.3. For now, I'll have to go back to 1.6 as this is an absolute showstopper for us.
          Hide
          mc1arke Michael Clarke added a comment -

          Daniel: please provide the format you have for your path so I can build a unit test for to include it.

          Show
          mc1arke Michael Clarke added a comment - Daniel: please provide the format you have for your path so I can build a unit test for to include it.
          Hide
          schaarda Daniel Schaarschmidt added a comment -

          The path I tried was:
          /home/myUser/.ssh/id_dsa

          I would certainly prefer to use "~" instead of home/myUser or using a placeholder like lklock, but I just tried the path that should have been easier to get working.

          Obviously that path won't work on the Windows master so I set one of the two Linux Nodes as parent using the Matrix Tie Parent plugin.

          Show
          schaarda Daniel Schaarschmidt added a comment - The path I tried was: /home/myUser/.ssh/id_dsa I would certainly prefer to use "~" instead of home/myUser or using a placeholder like lklock, but I just tried the path that should have been easier to get working. Obviously that path won't work on the Windows master so I set one of the two Linux Nodes as parent using the Matrix Tie Parent plugin.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: mc1arke
          Path:
          src/main/java/org/netbeans/lib/cvsclient/connection/SSHConnection.java
          http://jenkins-ci.org/commit/cvsclient/03badcdfdd9834b8cde2c5d66b13c16b5f7e774b
          Log:
          JENKINS-13764: Set known hosts & passfile using local system path separators

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: mc1arke Path: src/main/java/org/netbeans/lib/cvsclient/connection/SSHConnection.java http://jenkins-ci.org/commit/cvsclient/03badcdfdd9834b8cde2c5d66b13c16b5f7e774b Log: JENKINS-13764 : Set known hosts & passfile using local system path separators
          mc1arke Michael Clarke made changes -
          Field Original Value New Value
          Status Open [ 1 ] In Progress [ 3 ]
          mc1arke Michael Clarke made changes -
          Assignee Michael Clarke [ mc1arke ]
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: mc1arke
          Path:
          pom.xml
          http://jenkins-ci.org/commit/cvs-plugin/5cc27a9675d76ef41bd156cd77d64ea8b3d04692
          Log:
          [FIXED JENKINS-13764] Upgrade to latest CVS client

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: mc1arke Path: pom.xml http://jenkins-ci.org/commit/cvs-plugin/5cc27a9675d76ef41bd156cd77d64ea8b3d04692 Log: [FIXED JENKINS-13764] Upgrade to latest CVS client
          scm_issue_link SCM/JIRA link daemon made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          schaarda Daniel Schaarschmidt added a comment -

          It's still not working.
          Same error as posted originally, tried with Jenkins CVS-Plguin 2.4.

          When I look at the SSHConnection.java the method open() replaces / and \ with System.file,.separator. But it seems to use the settings from the master, not the slave. So with Windows Master and Linux Slave, I get \ instead of /, which is wrong and leads to the said exception.

          Show
          schaarda Daniel Schaarschmidt added a comment - It's still not working. Same error as posted originally, tried with Jenkins CVS-Plguin 2.4. When I look at the SSHConnection.java the method open() replaces / and \ with System.file,.separator. But it seems to use the settings from the master, not the slave. So with Windows Master and Linux Slave, I get \ instead of /, which is wrong and leads to the said exception.
          schaarda Daniel Schaarschmidt made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Hide
          mc1arke Michael Clarke added a comment -

          Daniel: I'm unable to replicate your issue, please provide a new Stack Trace and the details of where your private key and known hosts file are saved.

          Show
          mc1arke Michael Clarke added a comment - Daniel: I'm unable to replicate your issue, please provide a new Stack Trace and the details of where your private key and known hosts file are saved.
          Hide
          schaarda Daniel Schaarschmidt added a comment -

          Jenkins 1.465, CVS Plugin 2.5, Master: Windows Server 2003, Slave Linux

          Jenkins is running on the master, the build is done on the Linux slave. SSH-Key-Location is configured as "/home/myUser/.ssh/id_dsa"
          The checkout from CVS works fine, but when the rlog command is executed I get the following error:

          cvs rlog -S -d05 Sep 2012 09:51:41 +0200<05 Sep 2012 09:53:54 +0200 project2
          FATAL: CVS authentication failure while running rlog command
          java.lang.RuntimeException: CVS authentication failure while running rlog command
          at hudson.scm.CVSSCM.getRemoteLogForModule(CVSSCM.java:537)
          at hudson.scm.CVSSCM.calculateChangeLog(CVSSCM.java:419)
          at hudson.scm.CVSSCM.checkout(CVSSCM.java:853)
          at hudson.model.AbstractProject.checkout(AbstractProject.java:1218)
          at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:586)
          at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:475)
          at hudson.model.Run.run(Run.java:1434)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:239)
          Caused by: org.netbeans.lib.cvsclient.connection.AuthenticationException: SSH connection failed.
          at org.netbeans.lib.cvsclient.connection.SSHConnection.open(SSHConnection.java:141)
          at org.netbeans.lib.cvsclient.Client$1.run(Client.java:374)
          at java.lang.Thread.run(Thread.java:662)
          Caused by: com.jcraft.jsch.JSchException: java.io.FileNotFoundException: \home\myUser\.ssh\id_dsa (Das System kann den angegebenen Pfad nicht finden)
          at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:98)
          at com.jcraft.jsch.JSch.addIdentity(JSch.java:224)
          at com.jcraft.jsch.JSch.addIdentity(JSch.java:218)
          at org.netbeans.lib.cvsclient.connection.SSHConnection.open(SSHConnection.java:135)
          ... 2 more
          Caused by: java.io.FileNotFoundException: \home\myUser\ssh\id_dsa (Das System kann den angegebenen Pfad nicht finden)
          at java.io.FileInputStream.open(Native Method)
          at java.io.FileInputStream.<init>(FileInputStream.java:106)
          at java.io.FileInputStream.<init>(FileInputStream.java:66)
          at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:83)
          ... 5 more

          Do you notice the different file separators?

          Show
          schaarda Daniel Schaarschmidt added a comment - Jenkins 1.465, CVS Plugin 2.5, Master: Windows Server 2003, Slave Linux Jenkins is running on the master, the build is done on the Linux slave. SSH-Key-Location is configured as "/home/myUser/.ssh/id_dsa" The checkout from CVS works fine, but when the rlog command is executed I get the following error: cvs rlog -S -d05 Sep 2012 09:51:41 +0200<05 Sep 2012 09:53:54 +0200 project2 FATAL: CVS authentication failure while running rlog command java.lang.RuntimeException: CVS authentication failure while running rlog command at hudson.scm.CVSSCM.getRemoteLogForModule(CVSSCM.java:537) at hudson.scm.CVSSCM.calculateChangeLog(CVSSCM.java:419) at hudson.scm.CVSSCM.checkout(CVSSCM.java:853) at hudson.model.AbstractProject.checkout(AbstractProject.java:1218) at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:586) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:475) at hudson.model.Run.run(Run.java:1434) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:239) Caused by: org.netbeans.lib.cvsclient.connection.AuthenticationException: SSH connection failed. at org.netbeans.lib.cvsclient.connection.SSHConnection.open(SSHConnection.java:141) at org.netbeans.lib.cvsclient.Client$1.run(Client.java:374) at java.lang.Thread.run(Thread.java:662) Caused by: com.jcraft.jsch.JSchException: java.io.FileNotFoundException: \home\myUser\.ssh\id_dsa (Das System kann den angegebenen Pfad nicht finden) at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:98) at com.jcraft.jsch.JSch.addIdentity(JSch.java:224) at com.jcraft.jsch.JSch.addIdentity(JSch.java:218) at org.netbeans.lib.cvsclient.connection.SSHConnection.open(SSHConnection.java:135) ... 2 more Caused by: java.io.FileNotFoundException: \home\myUser\ssh\id_dsa (Das System kann den angegebenen Pfad nicht finden) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:106) at java.io.FileInputStream.<init>(FileInputStream.java:66) at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:83) ... 5 more Do you notice the different file separators?
          Hide
          mc1arke Michael Clarke added a comment -

          Daniel: this is expected behaviour - Rlog activities (polling and changelog generation) happen on the Master which is why the path is converted to contain Windows separators in your case. Polling isn't given a workspace so there would be no way to execute polling on a slave. Changelog generation could potentially be done on the same machine as the checkout, but this wouldn't fix the polling issue. This therefore isn't a suitable solution as polling would still fail for any users with a similar setup to yours.

          To fix this properly, you'll have to copy your private key file to \home\myUser\.ssh\id_dsa on your master (or set environmental variables that specify where it is on each machine and then copy it to the relevant location).

          Show
          mc1arke Michael Clarke added a comment - Daniel: this is expected behaviour - Rlog activities (polling and changelog generation) happen on the Master which is why the path is converted to contain Windows separators in your case. Polling isn't given a workspace so there would be no way to execute polling on a slave. Changelog generation could potentially be done on the same machine as the checkout, but this wouldn't fix the polling issue. This therefore isn't a suitable solution as polling would still fail for any users with a similar setup to yours. To fix this properly, you'll have to copy your private key file to \home\myUser\.ssh\id_dsa on your master (or set environmental variables that specify where it is on each machine and then copy it to the relevant location).
          Hide
          mc1arke Michael Clarke added a comment -

          Re-closing defect as fixed since initial issue is resolved. Secondary issue can be resolved by following above comment.

          Show
          mc1arke Michael Clarke added a comment - Re-closing defect as fixed since initial issue is resolved. Secondary issue can be resolved by following above comment.
          mc1arke Michael Clarke made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          schaarda Daniel Schaarschmidt added a comment - - edited

          Thanks for the tip Michael, but I can't get it to work. I configured different paths using environmental variables on Master and Slave. But: rlog uses the environment variable from the SLAVE to get the path on the master.

          Show
          schaarda Daniel Schaarschmidt added a comment - - edited Thanks for the tip Michael, but I can't get it to work. I configured different paths using environmental variables on Master and Slave. But: rlog uses the environment variable from the SLAVE to get the path on the master.
          Hide
          mc1arke Michael Clarke added a comment -

          Do you have polling enabled, and does it work? The Environmental Variables we're passed during the checkout (and subsequent change-log) stage are for the node the work would be done on (the slave in your case) which is why they're resolving wrongly. If polling works then I should be able to make a change to generate change-logs on the slave and leave polling as it is, otherwise I'm going to have to consider our approach to rlog usage with SSH.

          Show
          mc1arke Michael Clarke added a comment - Do you have polling enabled, and does it work? The Environmental Variables we're passed during the checkout (and subsequent change-log) stage are for the node the work would be done on (the slave in your case) which is why they're resolving wrongly. If polling works then I should be able to make a change to generate change-logs on the slave and leave polling as it is, otherwise I'm going to have to consider our approach to rlog usage with SSH.
          Hide
          schaarda Daniel Schaarschmidt added a comment -

          Polling is enabled, but when I tried with the new CVS-Plugin-Version I manually triggered the build for testing purposes, so I'm not sure whether polling would have worked or not. Because this behaviour is a showstopper for us, I went back to version 1.6. I'll have another go with the current version next week to test polling.

          Show
          schaarda Daniel Schaarschmidt added a comment - Polling is enabled, but when I tried with the new CVS-Plugin-Version I manually triggered the build for testing purposes, so I'm not sure whether polling would have worked or not. Because this behaviour is a showstopper for us, I went back to version 1.6. I'll have another go with the current version next week to test polling.
          Hide
          hossinho Ali Hosseini added a comment -

          Hi There,

          I'm having the same exact issue, and noticed this bug is marked as Fixed, but I see no resolution. The initial issue was never fixed, and the same exact error message is reproducable.

          Using version 2.9, I set my private key path to:
          $HOME/.ssh/id_rsa

          This should work, since both Windows master and Linux slave have $HOME set accordingly. Yet, the process that runs 'cvs rlog' is picking up $HOME from the slave. Do you really have to reconsider the whole 'cvs rlog' approach, or could the fix be as simple as invoking 'cvs rlog' with private key path resolved locally?

          Thanks in advance.

          Show
          hossinho Ali Hosseini added a comment - Hi There, I'm having the same exact issue, and noticed this bug is marked as Fixed, but I see no resolution. The initial issue was never fixed, and the same exact error message is reproducable. Using version 2.9, I set my private key path to: $HOME/.ssh/id_rsa This should work, since both Windows master and Linux slave have $HOME set accordingly. Yet, the process that runs 'cvs rlog' is picking up $HOME from the slave. Do you really have to reconsider the whole 'cvs rlog' approach, or could the fix be as simple as invoking 'cvs rlog' with private key path resolved locally? Thanks in advance.
          Hide
          hossinho Ali Hosseini added a comment -

          I've ran into this issue after updating. We were on the older 1.2 version.

          Show
          hossinho Ali Hosseini added a comment - I've ran into this issue after updating. We were on the older 1.2 version.
          hossinho Ali Hosseini made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Michael Clarke
          Path:
          src/main/java/hudson/scm/AbstractCvs.java
          src/main/java/hudson/scm/CVSSCM.java
          src/main/java/hudson/scm/CvsProjectset.java
          http://jenkins-ci.org/commit/cvs-plugin/2c0d618f097f845d82b7aa8b7edf5a6c96a8e40d
          Log:
          [FIXED JENKINS-13764] Use same location as workspace for post build rlog

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michael Clarke Path: src/main/java/hudson/scm/AbstractCvs.java src/main/java/hudson/scm/CVSSCM.java src/main/java/hudson/scm/CvsProjectset.java http://jenkins-ci.org/commit/cvs-plugin/2c0d618f097f845d82b7aa8b7edf5a6c96a8e40d Log: [FIXED JENKINS-13764] Use same location as workspace for post build rlog
          scm_issue_link SCM/JIRA link daemon made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Michael Clarke
          Path:
          src/main/java/hudson/scm/AbstractCvs.java
          src/main/java/hudson/scm/CVSSCM.java
          src/main/java/hudson/scm/CvsProjectset.java
          http://jenkins-ci.org/commit/cvs-plugin/3268e14834012cef211fe3d44df6be083db2f10e
          Log:
          [FIXED JENKINS-13764] Use same location as workspace for post build rlog

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michael Clarke Path: src/main/java/hudson/scm/AbstractCvs.java src/main/java/hudson/scm/CVSSCM.java src/main/java/hudson/scm/CvsProjectset.java http://jenkins-ci.org/commit/cvs-plugin/3268e14834012cef211fe3d44df6be083db2f10e Log: [FIXED JENKINS-13764] Use same location as workspace for post build rlog
          lklock lklock made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 144231 ] JNJira + In-Review [ 205854 ]

            People

            • Assignee:
              mc1arke Michael Clarke
              Reporter:
              lklock lklock
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: