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

hudson.tools.DownloadFromUrlInstaller#performInstallation faild when same named directory in archived file

    XMLWordPrintable

Details

    Description

      hudson.tools.DownloadFromUrlInstaller#performInstallation
      faild at call 'base.moveAllChildrenTo(expected)'

      archived file example:

      +- test
        +- sub
          +- sub
      

      'test/sub'.moveAllChildrenTo('test') fail at hudson.FilePath

      'test/sub/sub'.renameTo('test/') failed.

      It caused by destination folder 'test/sub' that existed already.

      Attachments

        Activity

          kkkon Kiyofumi Kondoh added a comment - I made pull request https://github.com/jenkinsci/jenkins/pull/714

          Linux occured. not only Windows.

          Running hudson.FilePathTest
          Tests run: 20, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 14.181 sec <<< FAILURE!
          testMoveAllChildrenTo(hudson.FilePathTest) Time elapsed: 0.141 sec <<< ERROR!
          java.io.IOException: Failed to rename /home/kkkon/jenkins/core/target/hudson524228362593606165tmp/test/sub/sub to /home/kkkon/jenkins/core/target/hudson524228362593606165tmp/test/sub
          at hudson.FilePath$32.invoke(FilePath.java:1666)
          at hudson.FilePath$32.invoke(FilePath.java:1658)
          at hudson.FilePath.act(FilePath.java:865)
          at hudson.FilePath.act(FilePath.java:838)
          at hudson.FilePath.moveAllChildrenTo(FilePath.java:1658)
          at hudson.FilePathTest.testMoveAllChildrenTo(FilePathTest.java:601)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at junit.framework.TestCase.runTest(TestCase.java:168)
          at junit.framework.TestCase.runBare(TestCase.java:134)
          at junit.framework.TestResult$1.protect(TestResult.java:110)
          at junit.framework.TestResult.runProtected(TestResult.java:128)
          at junit.framework.TestResult.run(TestResult.java:113)
          at junit.framework.TestCase.run(TestCase.java:124)
          at junit.framework.TestSuite.runTest(TestSuite.java:243)
          at junit.framework.TestSuite.run(TestSuite.java:238)
          at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
          at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
          at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
          at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
          at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
          at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
          at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
          at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

          kkkon Kiyofumi Kondoh added a comment - Linux occured. not only Windows. Running hudson.FilePathTest Tests run: 20, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 14.181 sec <<< FAILURE! testMoveAllChildrenTo(hudson.FilePathTest) Time elapsed: 0.141 sec <<< ERROR! java.io.IOException: Failed to rename /home/kkkon/jenkins/core/target/hudson524228362593606165tmp/test/sub/sub to /home/kkkon/jenkins/core/target/hudson524228362593606165tmp/test/sub at hudson.FilePath$32.invoke(FilePath.java:1666) at hudson.FilePath$32.invoke(FilePath.java:1658) at hudson.FilePath.act(FilePath.java:865) at hudson.FilePath.act(FilePath.java:838) at hudson.FilePath.moveAllChildrenTo(FilePath.java:1658) at hudson.FilePathTest.testMoveAllChildrenTo(FilePathTest.java:601) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at junit.framework.TestCase.runTest(TestCase.java:168) at junit.framework.TestCase.runBare(TestCase.java:134) at junit.framework.TestResult$1.protect(TestResult.java:110) at junit.framework.TestResult.runProtected(TestResult.java:128) at junit.framework.TestResult.run(TestResult.java:113) at junit.framework.TestCase.run(TestCase.java:124) at junit.framework.TestSuite.runTest(TestSuite.java:243) at junit.framework.TestSuite.run(TestSuite.java:238) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

          Code changed in jenkins
          User: kkkon
          Path:
          core/src/main/java/hudson/FilePath.java
          core/src/test/java/hudson/FilePathTest.java
          http://jenkins-ci.org/commit/jenkins/8a9e1ab59f4346a02f1aebc26a41691d0e6edea0
          Log:
          [FIXED JENKINS-16846] fix logic and add test

          FilePath#moveAllChildrenTo faild,
          when same name directory exist.

          change Void to void, recursive_invoke is internal helper function.

          thanks review by jglick

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: kkkon Path: core/src/main/java/hudson/FilePath.java core/src/test/java/hudson/FilePathTest.java http://jenkins-ci.org/commit/jenkins/8a9e1ab59f4346a02f1aebc26a41691d0e6edea0 Log: [FIXED JENKINS-16846] fix logic and add test FilePath#moveAllChildrenTo faild, when same name directory exist. change Void to void, recursive_invoke is internal helper function. thanks review by jglick

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          core/src/main/java/hudson/FilePath.java
          http://jenkins-ci.org/commit/jenkins/20347431aee7960846550538c4d48d11225d28d3
          Log:
          JENKINS-16846

          This is a much simpler fix

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: core/src/main/java/hudson/FilePath.java http://jenkins-ci.org/commit/jenkins/20347431aee7960846550538c4d48d11225d28d3 Log: JENKINS-16846 This is a much simpler fix

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/16c395e32c54fe38d05b88237c376d105c45231a
          Log:
          [FIXED JENKINS-16846]

          Compare: https://github.com/jenkinsci/jenkins/compare/2bfc2bb199a3...16c395e32c54

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html http://jenkins-ci.org/commit/jenkins/16c395e32c54fe38d05b88237c376d105c45231a Log: [FIXED JENKINS-16846] Compare: https://github.com/jenkinsci/jenkins/compare/2bfc2bb199a3...16c395e32c54
          dogfood dogfood added a comment -

          Integrated in jenkins_main_trunk #3330
          [FIXED JENKINS-16846] fix logic and add test (Revision 8a9e1ab59f4346a02f1aebc26a41691d0e6edea0)
          JENKINS-16846 (Revision 20347431aee7960846550538c4d48d11225d28d3)
          [FIXED JENKINS-16846] (Revision 16c395e32c54fe38d05b88237c376d105c45231a)

          Result = SUCCESS
          diverKon+github : 8a9e1ab59f4346a02f1aebc26a41691d0e6edea0
          Files :

          • core/src/main/java/hudson/FilePath.java
          • core/src/test/java/hudson/FilePathTest.java

          kohsuke : 20347431aee7960846550538c4d48d11225d28d3
          Files :

          • core/src/main/java/hudson/FilePath.java

          kohsuke : 16c395e32c54fe38d05b88237c376d105c45231a
          Files :

          • changelog.html
          dogfood dogfood added a comment - Integrated in jenkins_main_trunk #3330 [FIXED JENKINS-16846] fix logic and add test (Revision 8a9e1ab59f4346a02f1aebc26a41691d0e6edea0) JENKINS-16846 (Revision 20347431aee7960846550538c4d48d11225d28d3) [FIXED JENKINS-16846] (Revision 16c395e32c54fe38d05b88237c376d105c45231a) Result = SUCCESS diverKon+github : 8a9e1ab59f4346a02f1aebc26a41691d0e6edea0 Files : core/src/main/java/hudson/FilePath.java core/src/test/java/hudson/FilePathTest.java kohsuke : 20347431aee7960846550538c4d48d11225d28d3 Files : core/src/main/java/hudson/FilePath.java kohsuke : 16c395e32c54fe38d05b88237c376d105c45231a Files : changelog.html

          People

            Unassigned Unassigned
            kkkon Kiyofumi Kondoh
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: