Open danieloh30 opened 3 years ago
/cc @geoand
Interesting point.
Unfortunately this won't work, so we should probably just disallow it. WDYT @iocanel ?
@geoand To be clear, is this an intended result? meaning is that the docker build strategy doesn't allow remote-dev?
It's a case of that it can't work, so we should disallow it with a good error message
Understood. I suggest that we need to add a note in document(https://quarkus.io/guides/maven-tooling#remote-development-mode)
Out of curiosity, why can't it work? Any reason?
Because it depends on the dockerfile being present, which it's not in remote-dev (on the server side)
It basically uses dockerfile.jvm file that Quarkus project genereates.
This seems unfortunate.
Shouldn't we be able to detect remote dev is being requested and ignore / fallback to something that works ?
Since docker build strategy is a recommended one we at least need to tell the user how he can/should use use remote dev with it?
Fallback to what though?
The docker build strategy needs to the Dockefile to be available (not to mention Docker which there is no guarantee exists on the remote machine).
Why is the docker file being used in dev mode anyway? Shouldn't this have a guard to stop it being run for dev/test? You can use the DevModeType to also guard explicitly against remote-dev mode.
what is the "DevModeType"? Is that a sort of configuration we can set in application.properties?
It's an internal flag that tracks the type of devmode (normal, remote dev client, remote dev server, tests_only).
Why is the docker file being used in dev mode anyway? Shouldn't this have a guard to stop it being run for dev/test? You can use the DevModeType to also guard explicitly against remote-dev mode.
Yes, that's what I meant when I said we should guard against this
Describe the bug
(Describe the problem clearly and concisely.) Failed to start quarkus when I set the remote dev and docker build strategy configuration at the same time. If I remove the docker build strategy configuration(quarkus.openshift.build-strategy=docker), the quarkus app gets started well.
Expected behavior
(Describe the expected behavior clearly and concisely.) Quarkus should start without an error.
Actual behavior
(Describe the actual behavior clearly and concisely.) Failed to start with the following errors:
2021-06-17 14:04:37,756 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (main) Failed to start quarkus: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors [error]: Build step io.quarkus.container.image.openshift.deployment.OpenshiftProcessor#openshiftPrepareJvmDockerBuild threw an exception: java.lang.NullPointerException at io.quarkus.container.image.openshift.deployment.OpenshiftProcessor.openshiftPrepareJvmDockerBuild(OpenshiftProcessor.java:93) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:820) at io.quarkus.builder.BuildContext.run(BuildContext.java:277) at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18) at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2442) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1476) at java.base/java.lang.Thread.run(Thread.java:829) at org.jboss.threads.JBossThread.run(JBossThread.java:501)
Caused by: io.quarkus.builder.BuildException: Build failure: Build failed due to errors [error]: Build step io.quarkus.container.image.openshift.deployment.OpenshiftProcessor#openshiftPrepareJvmDockerBuild threw an exception: java.lang.NullPointerException at io.quarkus.container.image.openshift.deployment.OpenshiftProcessor.openshiftPrepareJvmDockerBuild(OpenshiftProcessor.java:93) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:820) at io.quarkus.builder.BuildContext.run(BuildContext.java:277) at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18) at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2442) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1476) at java.base/java.lang.Thread.run(Thread.java:829) at org.jboss.threads.JBossThread.run(JBossThread.java:501)
Caused by: java.lang.NullPointerException at io.quarkus.container.image.openshift.deployment.OpenshiftProcessor.openshiftPrepareJvmDockerBuild(OpenshiftProcessor.java:93) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:820) at io.quarkus.builder.BuildContext.run(BuildContext.java:277) at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18) at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2442) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1476) at java.base/java.lang.Thread.run(Thread.java:829) at org.jboss.threads.JBossThread.run(JBossThread.java:501)
To Reproduce
Link to a small reproducer (preferably a Maven project if the issue is not Gradle-specific).
Or attach an archive containing the reproducer to the issue.
Steps to reproduce the behavior:
Configuration
Screenshots
(If applicable, add screenshots to help explain your problem.)
Environment (please complete the following information):
OpenShift 4.7.2
Output of
uname -a
orver
Darwin Daniels-MacBook-Pro 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64
Output of
java -version
java version "11.0.10" 2021-01-19 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.10+8-LTS-162) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.10+8-LTS-162, mixed mode)
GraalVM version (if different from Java)
Quarkus version or git rev
2.0.0.CR3
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: /Users/danieloh/.m2/wrapper/dists/apache-maven-3.6.3-bin/1iopthnavndlasol9gbrbg6bf2/apache-maven-3.6.3 Java version: 11.0.10, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-11.0.10.jdk/Contents/Home Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"
Additional context
(Add any other context about the problem here.)