quarkus: `quarkus.openshift.arguments` fails on OCP + native mode
Describe the bug
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)
How to reproduce
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 -Dall-modules -pl lifecycle-application
Expected behavior
Same as JVM mode
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (16 by maintainers)
Commits related to this issue
- fix (#24885) Do not infer command/args based on s2i image used — committed to iocanel/quarkus by iocanel 2 years ago
- fix (#24885) Do not infer command/args based on s2i image used — committed to iocanel/quarkus by iocanel 2 years ago
- fix (#24885) Do not infer command/args based on s2i image used — committed to iocanel/quarkus by iocanel 2 years ago
After sleeping enough on it, I am leaning towards on never generating the command.
From my point of view, the correct option should be the third as when no command is added, it should default to the one from the base image. If the base image does not default an entrypoint, then the failure is expected. (The same reasoning is for JVM).
@geoand need to investigate