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

FilePath#installIfNecessaryFrom consistently fails to download certain files

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • core
    • None
    • Jenkins 1.532 and 2.0; running on OS X 10.11.4 and Ubuntu 14.04.3

      When testing the Go Plugin, which is a ToolInstaller and so makes use of this FilePath API, I've seen that it consistently fails to download certain files — regardless of which OS Jenkins is running on, and from which web server the files are being downloaded from (and whether HTTP or HTTPS).

      An typical stacktrace:

      java.io.IOException: Failed to install https://storage.googleapis.com/golang/go1.6.2.darwin-amd64.tar.gz to /tmp/jenkins/tools/Go_1.6.2
              at hudson.FilePath.installIfNecessaryFrom(FilePath.java:832)
              at Repro.main(Repro.java:31)
      Caused by: java.io.IOException: Failed to unpack https://storage.googleapis.com/golang/go1.6.2.darwin-amd64.tar.gz (158817 bytes read of total 84750242)
              at hudson.FilePath.installIfNecessaryFrom(FilePath.java:826)
              ... 1 more
      Caused by: java.io.IOException: Failed to extract input stream
              at hudson.FilePath.readFromTar(FilePath.java:2300)
              at hudson.FilePath.access$400(FilePath.java:190)
              at hudson.FilePath$10.invoke(FilePath.java:720)
              at hudson.FilePath$10.invoke(FilePath.java:718)
              at hudson.FilePath.act(FilePath.java:990)
              at hudson.FilePath.act(FilePath.java:968)
              at hudson.FilePath.untarFrom(FilePath.java:718)
              at hudson.FilePath.installIfNecessaryFrom(FilePath.java:824)
              ... 1 more
      Caused by: java.io.IOException: Truncated TAR archive
              at org.apache.commons.compress.archivers.tar.TarArchiveInputStream.read(TarArchiveInputStream.java:618)
              at java.io.InputStream.read(InputStream.java:101)
              at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1792)
              at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1769)
              at org.apache.commons.io.IOUtils.copy(IOUtils.java:1744)
              at hudson.util.IOUtils.copy(IOUtils.java:40)
              at hudson.FilePath.readFromTar(FilePath.java:2290)
              ... 8 more
      

      The issue can be reproduced like this:

      FilePath filePath = new FilePath(new File("..."));
      filePath.installIfNecessaryFrom(new URL(url), null, null);
      

      This Git repository contains this in a ready-to-run form:
      https://github.com/orrc/jenkins-filepath-untar

            Unassigned Unassigned
            orrc Christopher Orr
            Votes:
            8 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: