• Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • core
    • Jenkins ver. 1.467.
      slave running on HP Itaniunm B.11.23 U ia64 with java 1.6

      We have a slave running on an HP Itanium host (ver. HP-UX unknown B.11.23 U ia64) where the readlink command does not exists. So when trying to resolve symlinks, slave agent fails with the following error:

      hudson.util.IOException2: java.io.IOException: Cannot run program "readlink" (in directory "/misc/home_tmp_dstk110/."): readlink: not found
      at hudson.FilePath.copyRecursiveTo(FilePath.java:1771)
      at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:116)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
      at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:711)
      at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:686)
      at hudson.model.Build$RunnerImpl.post2(Build.java:162)
      at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:633)
      at hudson.model.Run.run(Run.java:1463)
      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: java.util.concurrent.ExecutionException: java.io.IOException: Cannot run program "readlink" (in directory "/misc/home_tmp_dstk110/."): readlink: not found
      at hudson.remoting.Channel$3.adapt(Channel.java:679)
      at hudson.remoting.Channel$3.adapt(Channel.java:674)
      at hudson.remoting.FutureAdapter.get(FutureAdapter.java:55)
      at hudson.FilePath.copyRecursiveTo(FilePath.java:1769)
      ... 10 more
      Caused by: java.io.IOException: Cannot run program "readlink" (in directory "/misc/home_tmp_dstk110/."): readlink: not found
      at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
      at java.lang.Runtime.exec(Runtime.java:593)
      at org.jruby.ext.posix.util.ExecIt.run(ExecIt.java:61)
      at org.jruby.ext.posix.util.ExecIt.runAndWait(ExecIt.java:51)

          [JENKINS-14021] HP-UX doesn't have readlink

          Do you know any equiavlent command in HP-UX that works instead of readlink?

          Kohsuke Kawaguchi added a comment - Do you know any equiavlent command in HP-UX that works instead of readlink?

          Well, no ... But why do you need to use it to retrieve artifacts ?

          Fulvio Cavarretta added a comment - Well, no ... But why do you need to use it to retrieve artifacts ?

          Hi Kohsuke, i am a colleague of Fulvio.
          jna and jna-posix libraries does not support HP Platform.
          In jna-posix there is a Posix Factory with following method:

          public static POSIX getPOSIX(POSIXHandler handler, boolean useNativePOSIX)
          {
          POSIX posix = null;

          if (useNativePOSIX) {
          try {
          if (Platform.IS_MAC)
          posix = loadMacOSPOSIX(handler);
          else if (Platform.IS_LINUX)
          posix = loadLinuxPOSIX(handler);
          else if (Platform.IS_FREEBSD)
          posix = loadFreeBSDPOSIX(handler);
          else if (Platform.IS_OPENBSD)
          posix = loadOpenBSDPOSIX(handler);
          else if (Platform.IS_32_BIT) {
          if (Platform.IS_WINDOWS)
          posix = loadWindowsPOSIX(handler);
          else if (Platform.IS_SOLARIS)

          { posix = loadSolarisPOSIX(handler); }

          }

          if (handler.isVerbose())
          if (posix != null)
          System.err.println("Successfully loaded native POSIX impl.");
          else
          System.err.println("Failed to load native POSIX impl; falling back on Java impl. Unsupported OS.");
          }
          catch (Throwable t)
          {
          if (handler.isVerbose())

          { System.err.println("Failed to load native POSIX impl; falling back on Java impl. Stacktrace follows."); t.printStackTrace(); }

          }
          }

          Any executable can not be run on this platform using the posix library.

          Marco Biancini added a comment - Hi Kohsuke, i am a colleague of Fulvio. jna and jna-posix libraries does not support HP Platform. In jna-posix there is a Posix Factory with following method: public static POSIX getPOSIX(POSIXHandler handler, boolean useNativePOSIX) { POSIX posix = null; if (useNativePOSIX) { try { if (Platform.IS_MAC) posix = loadMacOSPOSIX(handler); else if (Platform.IS_LINUX) posix = loadLinuxPOSIX(handler); else if (Platform.IS_FREEBSD) posix = loadFreeBSDPOSIX(handler); else if (Platform.IS_OPENBSD) posix = loadOpenBSDPOSIX(handler); else if (Platform.IS_32_BIT) { if (Platform.IS_WINDOWS) posix = loadWindowsPOSIX(handler); else if (Platform.IS_SOLARIS) { posix = loadSolarisPOSIX(handler); } } if (handler.isVerbose()) if (posix != null) System.err.println("Successfully loaded native POSIX impl."); else System.err.println("Failed to load native POSIX impl; falling back on Java impl. Unsupported OS."); } catch (Throwable t) { if (handler.isVerbose()) { System.err.println("Failed to load native POSIX impl; falling back on Java impl. Stacktrace follows."); t.printStackTrace(); } } } Any executable can not be run on this platform using the posix library.

          Thomas Jenny added a comment -

          the closest I come is:

          $ touch aFile
          $ ln -s aFile aLink
          $ file -h aLink 
          aLink:          symbolic link to aFile
          
          

          Thomas Jenny added a comment - the closest I come is: $ touch aFile $ ln -s aFile aLink $ file -h aLink aLink: symbolic link to aFile

          I have the same problem on AIX (5.3 and 6.1). And it's kinda vital for me

          There was a script you may look at: http://unix.derkeiler.com/Newsgroups/comp.unix.shell/2011-12/msg00221.html

          Or if the functionality required measures only to getting the path you can parse the ls -l output. But carefully, because:

          freya:~/tmp/3>touch file
          freya:~/tmp/3>ln -s – file -\>
          freya:~/tmp/3>ln -s – file -\>\ 1
          freya:~/tmp/3>ln -s – -\>\ 1 file1
          freya:~/tmp/3>ls -l
          total 0
          lrwxrwxrwx 1 pooh users 4 Aug 20 11:44 -> -> file
          lrwxrwxrwx 1 pooh users 4 Aug 20 11:44 -> 1 -> file
          rw-rr- 1 pooh users 0 Aug 20 11:44 file
          lrwxrwxrwx 1 pooh users 4 Aug 20 11:45 file1 -> -> 1

          Anyway why do you need to call external program and not do it in java?

          Yury Pukhalsky added a comment - I have the same problem on AIX (5.3 and 6.1). And it's kinda vital for me There was a script you may look at: http://unix.derkeiler.com/Newsgroups/comp.unix.shell/2011-12/msg00221.html Or if the functionality required measures only to getting the path you can parse the ls -l output. But carefully, because: freya:~/tmp/3>touch file freya:~/tmp/3>ln -s – file -\> freya:~/tmp/3>ln -s – file -\>\ 1 freya:~/tmp/3>ln -s – -\>\ 1 file1 freya:~/tmp/3>ls -l total 0 lrwxrwxrwx 1 pooh users 4 Aug 20 11:44 -> -> file lrwxrwxrwx 1 pooh users 4 Aug 20 11:44 -> 1 -> file rw-r r - 1 pooh users 0 Aug 20 11:44 file lrwxrwxrwx 1 pooh users 4 Aug 20 11:45 file1 -> -> 1 Anyway why do you need to call external program and not do it in java?

          Tom Denley added a comment -

          I've added a stopgap fix in this pull request. This doesn't represent a final solution, but might take the heat off things a bit.

          https://github.com/jenkinsci/jenkins/pull/547

          Tom Denley added a comment - I've added a stopgap fix in this pull request. This doesn't represent a final solution, but might take the heat off things a bit. https://github.com/jenkinsci/jenkins/pull/547

          Even if i have readlink installed on the host, it doesn't see it:

          Building remotely on aix_53_dev in workspace /build/hudson/workspace/scm_test
          [scm_test] $ /bin/sh -xe /tmp/hudson6874049592446335227.sh
          + echo 1
          + 1> 1
          + which readlink
          /opt/freeware/bin/readlink
          + echo /bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java14/jre/bin:/usr/java14/bin:/usr/vac/bin:/usr/local/bin:/opt/freeware/bin:/usr/vac/bin:/usr/local/bin:/opt/freeware/bin
          /bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java14/jre/bin:/usr/java14/bin:/usr/vac/bin:/usr/local/bin:/opt/freeware/bin:/usr/vac/bin:/usr/local/bin:/opt/freeware/bin
          Archiving artifacts
          ERROR: Failed to archive artifacts: 1
          hudson.util.IOException2: java.io.IOException: Cannot run program "readlink" (in directory "/build/hudson/."): error=2, A file or directory in the path name does not exist.

          Yury Pukhalsky added a comment - Even if i have readlink installed on the host, it doesn't see it: Building remotely on aix_53_dev in workspace /build/hudson/workspace/scm_test [scm_test] $ /bin/sh -xe /tmp/hudson6874049592446335227.sh + echo 1 + 1> 1 + which readlink /opt/freeware/bin/readlink + echo /bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java14/jre/bin:/usr/java14/bin:/usr/vac/bin:/usr/local/bin:/opt/freeware/bin:/usr/vac/bin:/usr/local/bin:/opt/freeware/bin /bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java14/jre/bin:/usr/java14/bin:/usr/vac/bin:/usr/local/bin:/opt/freeware/bin:/usr/vac/bin:/usr/local/bin:/opt/freeware/bin Archiving artifacts ERROR: Failed to archive artifacts: 1 hudson.util.IOException2: java.io.IOException: Cannot run program "readlink" (in directory "/build/hudson/."): error=2, A file or directory in the path name does not exist.

          Jesse Glick added a comment -

          JENKINS-13202 already mentioned the readlink issue.

          Jesse Glick added a comment - JENKINS-13202 already mentioned the readlink issue.

            Unassigned Unassigned
            fcavarretta Fulvio Cavarretta
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: