Uploaded image for project: 'Codehaus Cargo'
  1. CARGO-1336

Cargo does not fail correctly when the downloaded ZIP file is broken

    Details

    • Type: Bug
    • Status: Closed (View workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects versions: 1.4.11
    • Fix versions: 1.4.16
    • Components: Core
    • Labels:
      None

      Description

      The download of the Wildfly 8.x server (126MB) failed and the wildfly-8.2.0.Final.zip file was only 11MB in the default folder (${java.io.tempdir}/installs).

      The cargo.log has no indication of any kind of failure:

      [12:45:51.521][debug][2.ContainerStartMojo] Resolved artifact and dependencies: [file:/C:/Users/mrumpf/.m2/repository/org/codehaus/cargo/cargo-core-container-wildfly/1.4.11/cargo-core-container-wildfly-1.4.11.jar, file:/C:/Users/mrumpf/.m2/repository/org/codehaus/cargo/cargo-core-container-jboss/1.4.11/cargo-core-container-jboss-1.4.11.jar]
      [12:45:51.522][info][2.ContainerStartMojo] Resolved container artifact org.codehaus.cargo:cargo-core-container-wildfly:jar:1.4.11 for container wildfly8x
      [12:45:51.692][debug][ller.ZipURLInstaller] Container [wildfly-8.2.0.Final.zip] is not yet installed.
      [12:45:51.692][debug][ller.ZipURLInstaller] Container [wildfly-8.2.0.Final.zip] is downloaded, now unpacking.
      [12:45:51.692][info][ller.ZipURLInstaller] Installing container in [C:\work\workspaces\github\spring-boot\spring-boot-deployment-tests\spring-boot-deployment-test-wildfly\target\cargo\installs\wildfly-8.2.0.Final]
      [12:46:06.477][debug][ller.ZipURLInstaller] Container [wildfly-8.2.0.Final.zip] is unpacked, now registering.
      

      I changed the downloadDir to a local folder to make the file download again:

      [12:25:40.685][debug][2.ContainerStartMojo] Resolved artifact and dependencies: [file:/C:/Users/mrumpf/.m2/repository/org/codehaus/cargo/cargo-core-container-wildfly/1.4.11/cargo-core-container-wildfly-1.4.11.jar, file:/C:/Users/mrumpf/.m2/repository/org/codehaus/cargo/cargo-core-container-jboss/1.4.11/cargo-core-container-jboss-1.4.11.jar]
      [12:25:40.686][info][2.ContainerStartMojo] Resolved container artifact org.codehaus.cargo:cargo-core-container-wildfly:jar:1.4.11 for container wildfly8x
      [12:25:40.841][debug][ller.ZipURLInstaller] Container [wildfly-8.2.0.Final.zip] is not yet installed.
      [12:25:40.841][debug][ller.ZipURLInstaller] Container [wildfly-8.2.0.Final.zip] is not yet downloaded.
      [12:25:40.842][info][ller.ZipURLInstaller] Downloading container from [http://download.jboss.org/wildfly/8.2.0.Final/wildfly-8.2.0.Final.zip] to [C:\work\workspaces\github\spring-boot\spring-boot-deployment-tests\spring-boot-deployment-test-wildfly\target\downloads\wildfly-8.2.0.Final.zip]
      [12:39:41.686][debug][ller.ZipURLInstaller] Container [wildfly-8.2.0.Final.zip] is downloaded, now unpacking.
      [12:39:41.687][info][ller.ZipURLInstaller] Installing container in [C:\work\workspaces\github\spring-boot\spring-boot-deployment-tests\spring-boot-deployment-test-wildfly\target\extracts\wildfly-8.2.0.Final]
      [12:39:43.821][debug][ller.ZipURLInstaller] Container [wildfly-8.2.0.Final.zip] is unpacked, now registering.
      

      This time it failed at 120MB and the ZIP file was corrupt again.

      The issue is with our corporate proxy, corrupting files when the proxy thinks that it contains some kind of malware.

      But still Cargo should have some checks that the downloaded ZIP file is OK and it should not tell the user that everything is fine in such a case.

      In both cases the Maven build fails later with the following error:

      [ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.11:start (start-cargo) on project spring-boot-deployment-test-wildfly: Execution start-cargo of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.11:start failed: Failed to get container installation home as the container has not yet been installed. Please call install() first. -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.11:start (start-cargo) on project spring-boot-deployment-test-wildfly: Execution start-cargo of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.11:start failed: Failed to get container installation home as the container has not yet been installed. Please call install() first.
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
      	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
      	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
      	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
      	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
      	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
      	at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
      Caused by: org.apache.maven.plugin.PluginExecutionException: Execution start-cargo of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.11:start failed: Failed to get container installation home as the container has not yet been installed. Please call install() first.
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:144)
      	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
      	... 19 more
      Caused by: org.codehaus.cargo.container.ContainerException: Failed to get container installation home as the container has not yet been installed. Please call install() first.
      	at org.codehaus.cargo.container.installer.ZipURLInstaller.getHome(ZipURLInstaller.java:317)
      	at org.codehaus.cargo.maven2.configuration.Container.setupHome(Container.java:794)
      	at org.codehaus.cargo.maven2.configuration.Container.createContainer(Container.java:460)
      	at org.codehaus.cargo.maven2.AbstractCargoMojo.createNewContainer(AbstractCargoMojo.java:719)
      	at org.codehaus.cargo.maven2.AbstractCargoMojo.createContainer(AbstractCargoMojo.java:630)
      	at org.codehaus.cargo.maven2.ContainerStartMojo.doExecute(ContainerStartMojo.java:54)
      	at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo.java:432)
      	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
      	... 20 more
      [ERROR] 
      [ERROR] 
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
      

        Attachments

          Activity

            People

            • Assignee:
              alitokmen S. Ali Tokmen
              Reporter:
              mrumpf MichaelR (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: