Starting with the integration of JNR in 1.518, the login CLI command fails on Windows:

      hudson.util.IOException2: remote file operation failed: C:\Documents and Settings\Jesse Glick\.hudson\cli-credentials at hudson.remoting.Channel@1a8afc3:CLI channel from /127.0.0.1
              at hudson.FilePath.act(FilePath.java:905)
              at hudson.FilePath.act(FilePath.java:882)
              at hudson.cli.ClientAuthenticationCache.save(ClientAuthenticationCache.java:109)
              at hudson.cli.ClientAuthenticationCache.set(ClientAuthenticationCache.java:97)
              at hudson.cli.LoginCommand.run(LoginCommand.java:37)
              at ...
      Caused by: java.io.IOException: Remote call on CLI channel from /127.0.0.1 failed
              at hudson.remoting.Channel.call(Channel.java:723)
              at hudson.FilePath.act(FilePath.java:898)
              ... 24 more
      Caused by: java.lang.NoClassDefFoundError: jnr/ffi/util/ref/internal/Finalizer$ShutDown
              at java.lang.Class.getDeclaredMethods0(Native Method)
              at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
              at java.lang.Class.getMethod0(Unknown Source)
              at java.lang.Class.getMethod(Unknown Source)
              at jnr.ffi.util.ref.FinalizableReferenceQueue.getStartFinalizer(FinalizableReferenceQueue.java:292)
              at jnr.ffi.util.ref.FinalizableReferenceQueue.<clinit>(FinalizableReferenceQueue.java:90)
              at jnr.ffi.provider.jffi.NativeFinalizer.<init>(NativeFinalizer.java:9)
              at jnr.ffi.provider.jffi.NativeFinalizer$SingletonHolder.<clinit>(NativeFinalizer.java:12)
              at jnr.ffi.provider.jffi.NativeFinalizer.getInstance(NativeFinalizer.java:16)
              at jnr.ffi.provider.jffi.TransientNativeMemory$Magazine.<init>(TransientNativeMemory.java:110)
              at jnr.ffi.provider.jffi.TransientNativeMemory.allocate(TransientNativeMemory.java:53)
              at jnr.ffi.provider.jffi.NativeMemoryManager.allocateDirect(NativeMemoryManager.java:45)
              at jnr.ffi.Memory.allocateDirect(Memory.java:124)
              at jnr.posix.WString$1.toNative(WString.java:33)
              at jnr.posix.WString$1.toNative(WString.java:26)
              at jnr.posix.WindowsLibC$jnr$ffi$0._wchmod(Unknown Source)
              at jnr.posix.WindowsPOSIX.chmod(WindowsPOSIX.java:136)
              at jnr.posix.CheckedPOSIX.chmod(CheckedPOSIX.java:49)
              at jnr.posix.LazyPOSIX.chmod(LazyPOSIX.java:51)
              at hudson.cli.ClientAuthenticationCache$2.invoke(ClientAuthenticationCache.java:121)
              at hudson.cli.ClientAuthenticationCache$2.invoke(ClientAuthenticationCache.java:109)
              at ...
      Caused by: java.lang.ClassNotFoundException: jnr.ffi.util.ref.internal.Finalizer$ShutDown
              at java.net.URLClassLoader$1.run(Unknown Source)
              at ...
              ... 31 more

          [JENKINS-19192] CLI login command fails on Windows

          Jesse Glick created issue -

          Jesse Glick added a comment -

          The code in question is part of JNR but was copied from an old version of Guava. Web searches turn up https://code.google.com/p/guava-libraries/issues/detail?id=312 but this seems to have a different cause. The JNR team seems to have made some patches to this code since copying it, but not to have kept it fully in synch with the original.

          Jesse Glick added a comment - The code in question is part of JNR but was copied from an old version of Guava. Web searches turn up https://code.google.com/p/guava-libraries/issues/detail?id=312 but this seems to have a different cause. The JNR team seems to have made some patches to this code since copying it, but not to have kept it fully in synch with the original.

          Jesse Glick added a comment -

          Can easily work around the problem by avoiding JNR in this spot, but there is no guarantee a similar problem would not recur on another CLI command, until the root class loading issue is diagnosed.

          Jesse Glick added a comment - Can easily work around the problem by avoiding JNR in this spot, but there is no guarantee a similar problem would not recur on another CLI command, until the root class loading issue is diagnosed.
          Jesse Glick made changes -
          Link New: This issue is blocking JENKINS-14351 [ JENKINS-14351 ]
          Jesse Glick made changes -
          Labels Original: cli jnr regression remoting windows New: cli jnr lts-candidate regression remoting windows
          Jesse Glick made changes -
          Assignee New: Jesse Glick [ jglick ]
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

          Jesse Glick added a comment -

          Jesse Glick added a comment - Unconfirmed hypothesis: https://code.google.com/p/guava-libraries/issues/detail?id=1505

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          core/src/main/java/hudson/cli/ClientAuthenticationCache.java
          http://jenkins-ci.org/commit/jenkins/707629b03f96c9d210e9e0b89ea3c62b2ed37bb4
          Log:
          [FIXED JENKINS-19192] LoginCommand failed on Windows after introduction of JNR.
          Root cause of class loading error (on jnr.ffi.util.ref.internal.Finalizer$ShutDown) still unclear,
          but easy fix is to simplify ClientAuthenticationCache.save to use FilePath.chmod,
          which at least for now relies on hudson.util.jna.GNUCLibrary rather than JNR.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/java/hudson/cli/ClientAuthenticationCache.java http://jenkins-ci.org/commit/jenkins/707629b03f96c9d210e9e0b89ea3c62b2ed37bb4 Log: [FIXED JENKINS-19192] LoginCommand failed on Windows after introduction of JNR. Root cause of class loading error (on jnr.ffi.util.ref.internal.Finalizer$ShutDown) still unclear, but easy fix is to simplify ClientAuthenticationCache.save to use FilePath.chmod, which at least for now relies on hudson.util.jna.GNUCLibrary rather than JNR.
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: