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

svn+ssh on slave node causes org.tmatesoft.svn.core.SVNCancelException

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • remoting
    • None
    • Platform: All, OS: All

      Using

      • Hudson 1.101
      • SSH to launch a slave agent (Linux master, Windows/Cygwin slave)
      • the svn+ssh protocol for a Subversion repository
      • credentials with a username and a private keyfile (no passphrase)

      The build succeeds on a master node, however, an exception occurs when it is
      tied to a slave node:

      java.lang.NullPointerException:
      at
      hudson.scm.SubversionSCM$DescriptorImpl$SshPublicKeyCredential.getKeyFile(SubversionSCM.java:598)
      at
      hudson.scm.SubversionSCM$DescriptorImpl$SshPublicKeyCredential.createSVNAuthentication(SubversionSCM.java:619)
      at
      hudson.scm.SubversionSCM$DescriptorImpl$SshPublicKeyCredential.createSVNAuthentication(SubversionSCM.java:568)
      at
      hudson.scm.SubversionSCM$DescriptorImpl$SVNAuthenticationProviderImpl.requestClientAuthentication(SubversionSCM.java:661)
      at
      org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager.getFirstAuthentication(DefaultSVNAuthenticationManager.java:148)
      at
      org.tmatesoft.svn.core.internal.io.svn.SVNGanymedConnector.open(SVNGanymedConnector.java:62)
      at
      org.tmatesoft.svn.core.internal.io.svn.SVNConnection.open(SVNConnection.java:59)
      at
      org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.openConnection(SVNRepositoryImpl.java:999)
      at
      org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.getLatestRevision(SVNRepositoryImpl.java:136)
      at
      org.tmatesoft.svn.core.wc.SVNBasicClient.getRevisionNumber(SVNBasicClient.java:344)
      at
      org.tmatesoft.svn.core.wc.SVNBasicClient.getLocations(SVNBasicClient.java:458)
      at
      org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:414)
      at
      org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:378)
      at
      org.tmatesoft.svn.core.wc.SVNUpdateClient.doCheckout(SVNUpdateClient.java:305)
      at hudson.scm.SubversionSCM$1.invoke(SubversionSCM.java:304)
      at hudson.scm.SubversionSCM$1.invoke(SubversionSCM.java:277)
      at hudson.FilePath$FileCallableWrapper.call(FilePath.java:904)
      at hudson.remoting.UserRequest.perform(UserRequest.java:57)
      at hudson.remoting.UserRequest.perform(UserRequest.java:22)
      at hudson.remoting.Request$2.run(Request.java:178)
      at
      java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
      at
      java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
      at java.lang.Thread.run(Thread.java:595)

          [JENKINS-474] svn+ssh on slave node causes org.tmatesoft.svn.core.SVNCancelException

          kianwin added a comment -

          The first issue is fixed.

          For the second issue, I ran:
          java.util.logging.Logger.getLogger("hudson.scm.SubversionSCM").setLevel(java.util.logging.Level.ALL)

          and obtained on the system log:
          Apr 27, 2007 1:25:03 AM hudson.model.Run run
          INFO: debug-remote-svn-ssh #2 main build action completed: FAILURE

          Apr 27, 2007 1:25:03 AM hudson.scm.SubversionSCM
          FINE:
          getCredential(svn+ssh://...)=>hudson.scm.SubversionSCM$DescriptorImpl$SshPublicKeyCredential@d50eb9

          Apr 27, 2007 1:25:03 AM hudson.scm.SubversionSCM
          FINE:
          getCredential(svn+ssh://...)=>hudson.scm.SubversionSCM$DescriptorImpl$SshPublicKeyCredential@d50eb9

          The console output remains:
          ...
          org.tmatesoft.svn.core.SVNCancelException: svn: authentication cancelled
          ...

          kianwin added a comment - The first issue is fixed. For the second issue, I ran: java.util.logging.Logger.getLogger("hudson.scm.SubversionSCM").setLevel(java.util.logging.Level.ALL) and obtained on the system log: Apr 27, 2007 1:25:03 AM hudson.model.Run run INFO: debug-remote-svn-ssh #2 main build action completed: FAILURE Apr 27, 2007 1:25:03 AM hudson.scm.SubversionSCM FINE: getCredential(svn+ssh://...)=>hudson.scm.SubversionSCM$DescriptorImpl$SshPublicKeyCredential@d50eb9 Apr 27, 2007 1:25:03 AM hudson.scm.SubversionSCM FINE: getCredential(svn+ssh://...)=>hudson.scm.SubversionSCM$DescriptorImpl$SshPublicKeyCredential@d50eb9 The console output remains: ... org.tmatesoft.svn.core.SVNCancelException: svn: authentication cancelled ...

          I added one more probe message in 1.107 SNAPSHOT. Would it be possible to try
          the latest snapshot with the same debug probe?

          I wonder if it's at all possible for you to run Hudson under the debugger to see
          what's going on.

          Kohsuke Kawaguchi added a comment - I added one more probe message in 1.107 SNAPSHOT. Would it be possible to try the latest snapshot with the same debug probe? I wonder if it's at all possible for you to run Hudson under the debugger to see what's going on.

          kianwin added a comment -

          Sorry for being away for awhile.

          On 1.107-SNAPSHOT, the system log produces:

          May 23, 2007 9:32:13 PM hudson.model.Run run
          INFO: debug-remote-svn-ssh #1 main build action completed: FAILURE

          May 23, 2007 9:32:13 PM hudson.scm.SubversionSCM
          FINE:
          getCredential(svn+ssh://server.com)=>hudson.scm.SubversionSCM$DescriptorImpl$SshPublicKeyCredential@74cb02

          May 23, 2007 9:32:08 PM hudson.scm.SubversionSCM
          FINE:
          getCredential(svn+ssh://server.com)=>hudson.scm.SubversionSCM$DescriptorImpl$SshPublicKeyCredential@74cb02

          May 23, 2007 9:31:59 PM hudson.triggers.SCMTrigger$Runner runPolling
          INFO: Polling SCM changes of hudson-job

          May 23, 2007 9:31:56 PM hudson.scm.SubversionSCM
          FINE:
          requestClientAuthentication(svn.ssh,svn+ssh://server.com/home/hudson-slave/svn/project/trunk/src,svn+ssh://server.com)

          =>hudson.scm.SubversionSCM$DescriptorImpl$SshPublicKeyCredential@74cb02

          May 23, 2007 9:31:56 PM hudson.scm.SubversionSCM
          FINE:
          getCredential(svn+ssh://server.com)=>hudson.scm.SubversionSCM$DescriptorImpl$SshPublicKeyCredential@74cb02


          Nothing much there, huh. =/

          I could try to attach a debugger to Hudson, if I could figure out how to make it
          work. Actually, I did attempt to establish a remote debugging session through
          Eclipse, but I did not succeed in placing a breakpoint. Any mini-guides that you
          know off the top of your head?

          Also, I'm guessing it will be more interesting to look at the
          org.tmatesoft.svn.core package? The code in SubversionSCM.java appears to be
          fairly straight-forward...

          kianwin added a comment - Sorry for being away for awhile. On 1.107-SNAPSHOT, the system log produces: May 23, 2007 9:32:13 PM hudson.model.Run run INFO: debug-remote-svn-ssh #1 main build action completed: FAILURE May 23, 2007 9:32:13 PM hudson.scm.SubversionSCM FINE: getCredential(svn+ssh://server.com)=>hudson.scm.SubversionSCM$DescriptorImpl$SshPublicKeyCredential@74cb02 May 23, 2007 9:32:08 PM hudson.scm.SubversionSCM FINE: getCredential(svn+ssh://server.com)=>hudson.scm.SubversionSCM$DescriptorImpl$SshPublicKeyCredential@74cb02 May 23, 2007 9:31:59 PM hudson.triggers.SCMTrigger$Runner runPolling INFO: Polling SCM changes of hudson-job May 23, 2007 9:31:56 PM hudson.scm.SubversionSCM FINE: requestClientAuthentication(svn.ssh,svn+ssh://server.com/home/hudson-slave/svn/project/trunk/src,svn+ssh://server.com) =>hudson.scm.SubversionSCM$DescriptorImpl$SshPublicKeyCredential@74cb02 May 23, 2007 9:31:56 PM hudson.scm.SubversionSCM FINE: getCredential(svn+ssh://server.com)=>hudson.scm.SubversionSCM$DescriptorImpl$SshPublicKeyCredential@74cb02 Nothing much there, huh. =/ I could try to attach a debugger to Hudson, if I could figure out how to make it work. Actually, I did attempt to establish a remote debugging session through Eclipse, but I did not succeed in placing a breakpoint. Any mini-guides that you know off the top of your head? Also, I'm guessing it will be more interesting to look at the org.tmatesoft.svn.core package? The code in SubversionSCM.java appears to be fairly straight-forward...

          Hmm. All the log messages appear to be as expected. Hudson is returning a
          credential that the SVNKit is supposed to use.

          It would be really great if you can try a debugger. Normally, when a break point
          fails to attach like you describe, the cause is that your source files aren't
          matching the binary. You can verify this hypothesis by placing breakpoints to a
          lot of places (and hope one of them hits, and from there you can look at local
          variables and so on to see if the line numbers are matching), place break points
          on exceptions (that hits when exceptions are thrown), or place breakpoints to
          somewhere very stable.

          Kohsuke Kawaguchi added a comment - Hmm. All the log messages appear to be as expected. Hudson is returning a credential that the SVNKit is supposed to use. It would be really great if you can try a debugger. Normally, when a break point fails to attach like you describe, the cause is that your source files aren't matching the binary. You can verify this hypothesis by placing breakpoints to a lot of places (and hope one of them hits, and from there you can look at local variables and so on to see if the line numbers are matching), place break points on exceptions (that hits when exceptions are thrown), or place breakpoints to somewhere very stable.

          dbertrand added a comment -

          Created an attachment (id=64)
          Patch for "Authentication cancelled" SVNSSHAuthentication bug.

          dbertrand added a comment - Created an attachment (id=64) Patch for "Authentication cancelled" SVNSSHAuthentication bug.

          I believe I fixed this bug in 1.113, but I'm not sure. Verification appreciated.

          dbertrand, thank you for the patch, but you attached the whole source file, not
          the diff. Since I can't figure out which version of the file you based your
          change, I can't be sure what changes you made.

          I compared it against the trunk, but I didn't find obvious changes. Perhaps the
          Hudson code since evolved to contain the same fix?

          Kohsuke Kawaguchi added a comment - I believe I fixed this bug in 1.113, but I'm not sure. Verification appreciated. dbertrand, thank you for the patch, but you attached the whole source file, not the diff. Since I can't figure out which version of the file you based your change, I can't be sure what changes you made. I compared it against the trunk, but I didn't find obvious changes. Perhaps the Hudson code since evolved to contain the same fix?

          kianwin added a comment -

          The issue remains in Hudson 1.114. The same exception occurs:

          org.tmatesoft.svn.core.SVNCancelException: svn: authentication cancelled
          at
          org.tmatesoft.svn.core.internal.wc.SVNErrorManager.cancel(SVNErrorManager.java:30)
          at
          org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager.getFirstAuthentication(DefaultSVNAuthenticationManager.java:155)
          at
          org.tmatesoft.svn.core.internal.io.svn.SVNGanymedConnector.open(SVNGanymedConnector.java:89)
          at org.tmatesoft.svn.core.internal.io.svn.SVNConnection.open(SVNConnection.java:60)
          at
          org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.openConnection(SVNRepositoryImpl.java:998)
          at
          org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.getLatestRevision(SVNRepositoryImpl.java:136)
          at
          org.tmatesoft.svn.core.wc.SVNBasicClient.getRevisionNumber(SVNBasicClient.java:344)
          at org.tmatesoft.svn.core.wc.SVNBasicClient.getLocations(SVNBasicClient.java:458)
          at
          org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:414)
          at
          org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:378)
          at org.tmatesoft.svn.core.wc.SVNUpdateClient.doCheckout(SVNUpdateClient.java:305)
          at hudson.scm.SubversionSCM$1.invoke(SubversionSCM.java:305)
          at hudson.scm.SubversionSCM$1.invoke(SubversionSCM.java:278)
          at hudson.FilePath$FileCallableWrapper.call(FilePath.java:933)
          at hudson.remoting.UserRequest.perform(UserRequest.java:57)
          at hudson.remoting.UserRequest.perform(UserRequest.java:22)
          at hudson.remoting.Request$2.run(Request.java:178)
          at
          java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
          at java.lang.Thread.run(Thread.java:595)

          kianwin added a comment - The issue remains in Hudson 1.114. The same exception occurs: org.tmatesoft.svn.core.SVNCancelException: svn: authentication cancelled at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.cancel(SVNErrorManager.java:30) at org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager.getFirstAuthentication(DefaultSVNAuthenticationManager.java:155) at org.tmatesoft.svn.core.internal.io.svn.SVNGanymedConnector.open(SVNGanymedConnector.java:89) at org.tmatesoft.svn.core.internal.io.svn.SVNConnection.open(SVNConnection.java:60) at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.openConnection(SVNRepositoryImpl.java:998) at org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryImpl.getLatestRevision(SVNRepositoryImpl.java:136) at org.tmatesoft.svn.core.wc.SVNBasicClient.getRevisionNumber(SVNBasicClient.java:344) at org.tmatesoft.svn.core.wc.SVNBasicClient.getLocations(SVNBasicClient.java:458) at org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:414) at org.tmatesoft.svn.core.wc.SVNBasicClient.createRepository(SVNBasicClient.java:378) at org.tmatesoft.svn.core.wc.SVNUpdateClient.doCheckout(SVNUpdateClient.java:305) at hudson.scm.SubversionSCM$1.invoke(SubversionSCM.java:305) at hudson.scm.SubversionSCM$1.invoke(SubversionSCM.java:278) at hudson.FilePath$FileCallableWrapper.call(FilePath.java:933) at hudson.remoting.UserRequest.perform(UserRequest.java:57) at hudson.remoting.UserRequest.perform(UserRequest.java:22) at hudson.remoting.Request$2.run(Request.java:178) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) at java.lang.Thread.run(Thread.java:595)

          kianwin added a comment -

          I am migrating the Hudson slave from Cygwin to Linux in the next few days, so I
          will be able to check if this bug is platform-specific in any way.

          kianwin added a comment - I am migrating the Hudson slave from Cygwin to Linux in the next few days, so I will be able to check if this bug is platform-specific in any way.

          1.151 contains some fixes to svn+ssh handling.

          Kohsuke Kawaguchi added a comment - 1.151 contains some fixes to svn+ssh handling.

          kianwin added a comment -

          Sorry for taking awhile to verify this.

          Everything works great on 1.166. Thanks!

          kianwin added a comment - Sorry for taking awhile to verify this. Everything works great on 1.166. Thanks!

            Unassigned Unassigned
            kianwin kianwin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: