Uploaded image for project: 'Quarkus'
  1. Quarkus
  2. QUARKUS-2005

`quarkus.openshift.arguments` doesn't work in OCP + native mode

XMLWordPrintable

    • False
    • None
    • False
    • +
    • Hide
      Description

      Setting quarkus.openshift.arguments in native mode when the entrypoint is not set nor overridden by quarkus.openshift.command causes the following `CreateContainerError` error:

      ----
      `runc create failed: unable to start container process: exec: \" ARG1 \ ": executable file not found in $ PATH`.
      ----

      ARG1 can be set up using `quarkus.openshift.arguments`

      Background

      This problem occurs because the manifests of Kubernetes and OpenShift containers have two optional arguments: `command` and `args`. If these arguments are omitted, the container runs with the entrypoint defined in the container image. However, problems arise when only the `args` argument is specified.

      When specifying 'args', make sure you specify `command` too. If not, `args` will be treated as the actual command, which in most cases results in Pod failure.

      Workaround

      To work around this problem, set the entrypoint with `quarkus.openshift.command` manually.

      For the 'quarkus.native.builder-image' parameter not defined by the user (which is therefore set to its default value), change the entry point to 'quarkus.openshift.command=/home/quarkus/application'.
      Show
      Description Setting quarkus.openshift.arguments in native mode when the entrypoint is not set nor overridden by quarkus.openshift.command causes the following `CreateContainerError` error: ---- `runc create failed: unable to start container process: exec: \" ARG1 \ ": executable file not found in $ PATH`. ---- ARG1 can be set up using `quarkus.openshift.arguments` Background This problem occurs because the manifests of Kubernetes and OpenShift containers have two optional arguments: `command` and `args`. If these arguments are omitted, the container runs with the entrypoint defined in the container image. However, problems arise when only the `args` argument is specified. When specifying 'args', make sure you specify `command` too. If not, `args` will be treated as the actual command, which in most cases results in Pod failure. Workaround To work around this problem, set the entrypoint with `quarkus.openshift.command` manually. For the 'quarkus.native.builder-image' parameter not defined by the user (which is therefore set to its default value), change the entry point to 'quarkus.openshift.command=/home/quarkus/application'.
    • Documented as Known Issue
    • Hide

      Requirements:

      • Java 11/ 17
      • Quarkus 2.7.5.Final / 2.7.5.ER2
      • Openshift 4.10

      Reproducer:

      git clone git@github.com:quarkus-qe/quarkus-test-suite.git 

      Module: lifecycle-application

      mvn -B -V clean verify -Dnative -Dopenshift -fae -Dmaven.repo.local=/tmp/rh-quarkus-2.7.5.ER2-maven-repository/rh-quarkus-2.7.5.GA-maven-repository/maven-repository -Dquarkus.platform.version=2.7.5.Final-redhat-00004 -Dquarkus-plugin.version=2.7.5.Final-redhat-00004 -Dquarkus.platform.group-id=com.redhat.quarkus.platform -Dquarkus.platform.artifact-id=quarkus-bom -Dall-modules -pl lifecycle-application 

      Note: maven.repo.local is pointing to 2.7.5.ER2 repository

       

      Show
      Requirements: Java 11/ 17 Quarkus 2.7.5.Final / 2.7.5.ER2 Openshift 4.10 Reproducer: git clone git@github.com:quarkus-qe/quarkus-test-suite.git Module: lifecycle-application mvn -B -V clean verify -Dnative -Dopenshift -fae -Dmaven.repo.local=/tmp/rh-quarkus-2.7.5.ER2-maven-repository/rh-quarkus-2.7.5.GA-maven-repository/maven-repository -Dquarkus.platform.version=2.7.5.Final-redhat-00004 -Dquarkus-plugin.version=2.7.5.Final-redhat-00004 -Dquarkus.platform.group-id=com.redhat.quarkus.platform -Dquarkus.platform.artifact-id=quarkus-bom -Dall-modules -pl lifecycle-application Note: maven.repo.local is pointing to 2.7.5.ER2 repository  
    • ---

      When I deploy a native application that requires custom java arguments into OCP 4.10 the container crash at creation/start time with the following error:

      oc get pods 
      app-1-dwfb5    0/1     CreateContainerError   0          20s 
      oc describe pod app-1-dwfb5 

       

      Events:
        Type     Reason          Age               From               Message
        ----     ------          ----              ----               -------
        Normal   Scheduled       63s               default-scheduler  Successfully assigned ts-fgrltckoih/app-1-dwfb5 to ocp4-10-gl2nw-worker-0-nbgvv
        Normal   AddedInterface  61s               multus             Add eth0 [10.128.2.216/23] from openshift-sdn
        Normal   Pulled          59s               kubelet            Successfully pulled image "image-registry.openshift-image-registry.svc:5000/ts-fgrltckoih/app@sha256:525c030e520217f4e049496e4a4a9d26afa93efae750fe36f7c2f38348254efc" in 2.076644547s
        Warning  Failed          58s               kubelet            Error: container create failed: time="2022-04-12T07:51:38Z" level=error msg="runc create failed: unable to start container process: exec: \"ARG1\": executable file not found in $PATH"
        Normal   Pulled          57s               kubelet            Successfully pulled image "image-registry.openshift-image-registry.svc:5000/ts-fgrltckoih/app@sha256:525c030e520217f4e049496e4a4a9d26afa93efae750fe36f7c2f38348254efc" in 139.839247ms
        Warning  Failed          57s               kubelet            Error: container create failed: time="2022-04-12T07:51:39Z" level=error msg="runc create failed: unable to start container process: exec: \"ARG1\": executable file not found in $PATH"
        Warning  Failed          43s               kubelet            Error: container create failed: time="2022-04-12T07:51:53Z" level=error msg="runc create failed: unable to start container process: exec: \"ARG1\": executable file not found in $PATH"
        Normal   Pulled          43s               kubelet            Successfully pulled image "image-registry.openshift-image-registry.svc:5000/ts-fgrltckoih/app@sha256:525c030e520217f4e049496e4a4a9d26afa93efae750fe36f7c2f38348254efc" in 129.635937ms
        Normal   Pulled          31s               kubelet            Successfully pulled image "image-registry.openshift-image-registry.svc:5000/ts-fgrltckoih/app@sha256:525c030e520217f4e049496e4a4a9d26afa93efae750fe36f7c2f38348254efc" in 138.761777ms
        Warning  Failed          31s               kubelet            Error: container create failed: time="2022-04-12T07:52:05Z" level=error msg="runc create failed: unable to start container process: exec: \"ARG1\": executable file not found in $PATH"
        Normal   Pulled          20s               kubelet            Successfully pulled image "image-registry.openshift-image-registry.svc:5000/ts-fgrltckoih/app@sha256:525c030e520217f4e049496e4a4a9d26afa93efae750fe36f7c2f38348254efc" in 229.794292ms
        Warning  Failed          20s               kubelet            Error: container create failed: time="2022-04-12T07:52:16Z" level=error msg="runc create failed: unable to start container process: exec: \"ARG1\": executable file not found in $PATH"
        Normal   Pulling         9s (x6 over 61s)  kubelet            Pulling image "image-registry.openshift-image-registry.svc:5000/ts-fgrltckoih/app@sha256:525c030e520217f4e049496e4a4a9d26afa93efae750fe36f7c2f38348254efc"
        Normal   Pulled          9s                kubelet            Successfully pulled image "image-registry.openshift-image-registry.svc:5000/ts-fgrltckoih/app@sha256:525c030e520217f4e049496e4a4a9d26afa93efae750fe36f7c2f38348254efc" in 128.577373ms
        Warning  Failed          9s                kubelet            Error: container create failed: time="2022-04-12T07:52:27Z" level=error msg="runc create failed: unable to start container process: exec: \"ARG1\": executable file not found in $PATH"
       

      Appliction.properties:

      quarkus.openshift.arguments=ARG1,ARG2 

      Main class:

      @QuarkusMain
      public final class Main {
          private static final Logger LOG = Logger.getLogger(Main.class);
          private static final String ARGUMENTS_FROM_MAIN = "Received arguments: ";
      
          private Main() {
      
          }
      
          public static void main(String... args) {
              LOG.info(ARGUMENTS_FROM_MAIN + String.join(",", args));
              Quarkus.run(args);
          }
      }
       

      Endpoint

      @Path("/args")
      public class ArgsResource {
          @Inject
          @CommandLineArguments
          String[] args;
      
          @GET
          @Produces(MediaType.TEXT_PLAIN)
          public String get() {
              return Stream.of(args).collect(Collectors.joining(","));
          }
      } 

      Works in JVM mode fails in native mode (over OCP)

              ikanello1@redhat.com Ioannis Kanellos
              rhn-support-pagonzal Pablo Gonzalez Granados (Inactive)
              Pablo Gonzalez Granados Pablo Gonzalez Granados (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: