Uploaded image for project: 'Cloud Enablement'
  1. Cloud Enablement
  2. CLOUD-1817

Java S2I image: terrible error message with multiple JARs in /deployments

XMLWordPrintable

    • 1
    • Release Notes
    • Hide
      Cause: Error logging from multiple deployments was never reached
      Consequence: A non-informative "Permission denied" error message was printed if multiple deployments were present in the deployments directory and neither $JAVA_MAIN_CLASS nor $JAVA_APP_JAR was set
      Fix: Error logging from multiple deployments moved to correct location
      Consequence: A proper error message is now printed if multiple deployments are present in the deployments directory and neither $JAVA_MAIN_CLASS nor $JAVA_APP_JAR is set
      Show
      Cause: Error logging from multiple deployments was never reached Consequence: A non-informative "Permission denied" error message was printed if multiple deployments were present in the deployments directory and neither $JAVA_MAIN_CLASS nor $JAVA_APP_JAR was set Fix: Error logging from multiple deployments moved to correct location Consequence: A proper error message is now printed if multiple deployments are present in the deployments directory and neither $JAVA_MAIN_CLASS nor $JAVA_APP_JAR is set
    • CLOUD Maintenance Sprint 9

      (This comes from OBST-55.)

      I'm using the latest Red Hat OpenShift Java S2I image (registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift:latest) to run a WildFly Swarm project. Under some circumstances, it may happen that 2 JARs appear in /deployments in the built image. In such case, the run-java.sh script gets confused and prints a really terrible error message:

      Starting the Java application using /opt/run-java/run-java.sh ...
      /opt/run-java/run-java.sh: line 44: cd: /home/jboss: Permission denied
      

      To reproduce, download the attached reproducer.yml, run oc apply -f reproducer.yml, then oc start-build foobar and then watch the pod log.

      I looked into the run-java.sh script and I kinda understand why this happens, but the issue really is in that there are 2 JARs in /deployments which they shouldn't. But figuring out that this is the issue requires carefully inspecting the run-java.sh script, which is time-consuming and highly unfriendly. Maybe the script could print a warning message before looking in /home/jboss?

      (BTW, this could also possibly happen with Spring Boot, see OBST-273.)

              wdecoste1@redhat.com William Decoste (Inactive)
              lthon@redhat.com Ladislav Thon
              Ladislav Thon Ladislav Thon
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: