fabric8io-images / s2i

OpenShift S2I images for Java and Karaf applications
Apache License 2.0
70 stars 84 forks source link

Missing or more than one assembly archive file *.zip in /tmp/src/target #260

Open kkdavidwong opened 3 years ago

kkdavidwong commented 3 years ago

Hello

I am trying to build using the s2i builder fuse-karaf-openshift but I get the below error. I see that there was similar issue#157 dated May 2018 marked as closed but no solution is described. Can someone help?

I run the following command: s2i build ~/workspace/fuse-camel-cbr registry.redhat.io/fuse7/fuse-karaf-openshift s2i-cbr2 --loglevel=5

I0111 18:03:04.337063 195642 sti.go:711] [INFO] Writing OBR metadata I0111 18:03:04.339963 195642 sti.go:711] [INFO] ------------------------------------------------------------------------ I0111 18:03:04.340001 195642 sti.go:711] [INFO] BUILD SUCCESS I0111 18:03:04.340015 195642 sti.go:711] [INFO] ------------------------------------------------------------------------ I0111 18:03:04.340330 195642 sti.go:711] [INFO] Total time: 03:19 min I0111 18:03:04.340366 195642 sti.go:711] [INFO] Finished at: 2021-01-11T23:03:04Z I0111 18:03:04.548154 195642 sti.go:711] [INFO] Final Memory: 30M/106M I0111 18:03:04.548364 195642 sti.go:711] [INFO] ------------------------------------------------------------------------ I0111 18:03:04.594352 195642 sti.go:711] Copying built artifacts from /tmp/src/target into /deployments... I0111 18:03:04.691604 195642 sti.go:711] Directory /tmp/src/target contains bundles I0111 18:03:04.691677 195642 sti.go:711] camel-blueprint-cbr-1.0.0-SNAPSHOT.jar I0111 18:03:04.691707 195642 sti.go:711] classes I0111 18:03:04.691732 195642 sti.go:711] generated-test-sources I0111 18:03:04.691768 195642 sti.go:711] maven-status I0111 18:03:04.691794 195642 sti.go:711] surefire-reports I0111 18:03:04.691814 195642 sti.go:711] test-bundles I0111 18:03:04.691834 195642 sti.go:711] test-classes I0111 18:03:04.691900 195642 sti.go:711] Missing, or more than one, assembly or archive file *.zip in /tmp/src/target I0111 18:03:04.804617 195642 docker.go:1044] Waiting for container "7e365380b58ac5f7621c2ece90361ab636bbc7ea66803b91d639b14e54b98e0c" to stop ... I0111 18:03:07.251446 195642 docker.go:980] Removing container "7e365380b58ac5f7621c2ece90361ab636bbc7ea66803b91d639b14e54b98e0c" ... I0111 18:03:07.542361 195642 docker.go:990] Removed container "7e365380b58ac5f7621c2ece90361ab636bbc7ea66803b91d639b14e54b98e0c" I0111 18:03:07.542587 195642 cleanup.go:33] Removing temporary directory /tmp/s2i039059575 I0111 18:03:07.542599 195642 fs.go:313] Removing directory '/tmp/s2i039059575' I0111 18:03:07.546440 195642 build.go:170] Build failed E0111 18:03:07.546470 195642 errors.go:296] An error occurred: non-zero (13) exit code from registry.redhat.io/fuse7/fuse-karaf-openshift

rhuss commented 3 years ago

@dhirajsb any idea ?

dhirajsb commented 3 years ago

@rhuss looks like the s2i build didn't build a karaf assembly for some reason. Basically the karaf maven plugin's assembly goal should have been invoked and an assembly zip archive should have been created. Maybe an issue with the project's pom.xml??

The resolution not mentioned in the older ticket is to print the contents of the /tmp/src/target directory, which shows that no assembly was created.

@kkdavidwong, can you verify that the output from the following line:

Running 'mvn ${maven_env_args} ${MAVEN_ARGS} ${MAVEN_ARGS_APPEND}'"

has the default maven opts:

install -DskipTests -e -Dfabric8.skip=true -B

Also, try running maven with those options locally to see whether the assembly archive is being created in the target directory. If it isn't try and investigate the cause for that. The way it works is that the pom packaging should be <packaging>karaf-assembly</packaging>, which automatically adds karaf:assembly goal to the build to create the assembly.

kkdavidwong commented 3 years ago

Thank you for looking into this problem.

there is maven goal assembly and install...

  <plugin>
    <groupId>org.jboss.redhat-fuse</groupId>
    <artifactId>karaf-maven-plugin</artifactId>
    <version>${fuse.bom.version}</version>
    <extensions>true</extensions>
    <executions>
      <execution>
        <id>karaf-assembly</id>
        <goals>
          <goal>assembly</goal>
        </goals>
        <phase>install</phase>
      </execution>
    </executions>
    <configuration>
      <javase>1.8</javase>
      <karafVersion>v4x</karafVersion>
      <framework>framework</framework>
      <useReferenceUrls>true</useReferenceUrls>
      <archiveTarGz>false</archiveTarGz>
      <includeBuildOutputDirectory>false</includeBuildOutputDirectory>
      <startupFeatures>
        <feature>framework</feature>
        <feature>jaas</feature>
        <feature>log</feature>
        <feature>shell</feature>
        <feature>management</feature>
        <feature>aries-blueprint</feature>
        <feature>camel-blueprint</feature>
        <feature>fabric8-karaf-blueprint</feature>
        <feature>fabric8-karaf-checks</feature>
      </startupFeatures>
      <startupBundles>
mvn:${project.groupId}/${project.artifactId}/${project.version}
      </startupBundles>
    </configuration>
  </plugin>

Maven arguments: I0118 10:46:10.371356 71316 sti.go:711] Starting S2I Karaf Build ..... I0118 10:46:10.371413 71316 sti.go:711] Maven build detected I0118 10:46:10.371426 71316 sti.go:711] Using custom maven settings from /tmp/src/configuration/settings.xml I0118 10:46:10.593765 71316 sti.go:711] Using MAVEN_OPTS '-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -XX:+ExitOnOutOfMemoryError' I0118 10:46:10.593786 71316 sti.go:711] Found pom.xml ... I0118 10:46:10.593793 71316 sti.go:711] Running 'mvn -Dmaven.repo.local=/tmp/artifacts/m2 -s /tmp/src/configuration/settings.xml install -DskipTests -e -Dfabric8.skip=true -B ' I0118 10:46:11.395585 71316 sti.go:711] [1mApache Maven 3.5.0 (Red Hat 3.5.0-4.3) [m I0118 10:46:11.395610 71316 sti.go:711] Maven home: /opt/rh/rh-maven35/root/usr/share/maven I0118 10:46:11.395644 71316 sti.go:711] Java version: 1.8.0_272, vendor: Red Hat, Inc. I0118 10:46:11.395659 71316 sti.go:711] Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.272.b10-1.el7_9.x86_64/jre I0118 10:46:11.395676 71316 sti.go:711] Default locale: en_US, platform encoding: ANSI_X3.4-1968

On Thu, Jan 14, 2021 at 2:17 PM Dhiraj Bokde notifications@github.com wrote:

@rhuss https://github.com/rhuss looks like the s2i build didn't build a karaf assembly for some reason. Basically the karaf maven plugin's assembly goal should have been invoked and an assembly zip archive should have been created. Maybe an issue with the project's pom.xml??

The resolution not mentioned in the older ticket is to print the contents of the /tmp/src/target directory, which shows that no assembly was created.

@kkdavidwong https://github.com/kkdavidwong, can you verify that the output from the following line:

Running 'mvn ${maven_env_args} ${MAVEN_ARGS} ${MAVEN_ARGS_APPEND}'"

has the default maven opts:

install -DskipTests -e -Dfabric8.skip=true -B

Also, try running maven with those options locally to see whether the assembly archive is being created in the target directory. If it isn't try and investigate the cause for that. The way it works is that the pom packaging should be

karaf-assembly, which automatically adds karaf:assembly goal to the build to create the assembly. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub , or unsubscribe .