Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maven-property provided by maven-plugin leads to exception in mutable-jar when devmode is activated #13980

Closed
turing85 opened this issue Dec 18, 2020 · 2 comments · Fixed by #14809
Labels
Milestone

Comments

@turing85
Copy link
Contributor

turing85 commented Dec 18, 2020

Describe the bug
If a property provided by a 3rd party maven plugin is used to set the value of a quarkus-property, the generated mutable-jar cannot be started with QUARKUS_LAUNCH_DEVMODE=true.

Example:
The git-commit-id-maven-plugin - when executed - provides the current git hash in short format in maven-property git.commit.id.describe-short. We can then use this property as value in quarkus.container-image.additional-tags to tag the image created with the current git hash.

Expected behavior
The image should be built and work as expected when executed.

Actual behavior
The image is built and tagged correctly, the container is started, but the app throws the following exception on startup:

2020-12-18 22:55:50,363 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (main) Failed to start quarkus: java.lang.RuntimeException: java.util.NoSuchElementException: SRCFG00011: Could not expand value git.commit.id.describe-short in property quarkus.container-image.additional-tags
	at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:254)
	at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:135)
	at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:55)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.firstStart(IsolatedDevModeMain.java:75)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:361)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:52)
	at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:129)
	at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:82)
	at io.quarkus.deployment.mutability.DevModeTask.main(DevModeTask.java:70)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at io.quarkus.bootstrap.runner.DevModeMediator.doStart(DevModeMediator.java:50)
	at io.quarkus.bootstrap.runner.DevModeMediator.doDevMode(DevModeMediator.java:29)
	at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:34)
	at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:24)
Caused by: java.util.NoSuchElementException: SRCFG00011: Could not expand value git.commit.id.describe-short in property quarkus.container-image.additional-tags
	at io.smallrye.config.ExpressionConfigSourceInterceptor.lambda$getValue$0(ExpressionConfigSourceInterceptor.java:44)
	at io.smallrye.common.expression.ExpressionNode.emit(ExpressionNode.java:22)
	at io.smallrye.common.expression.Expression.evaluateException(Expression.java:56)
	at io.smallrye.common.expression.Expression.evaluate(Expression.java:70)
	at io.smallrye.config.ExpressionConfigSourceInterceptor.getValue(ExpressionConfigSourceInterceptor.java:37)
	at io.smallrye.config.ExpressionConfigSourceInterceptor.getValue(ExpressionConfigSourceInterceptor.java:18)
	at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20)
	at io.smallrye.config.SmallRyeConfig.getConfigValue(SmallRyeConfig.java:189)
	at io.smallrye.config.SmallRyeConfig.getValue(SmallRyeConfig.java:146)
	at io.quarkus.deployment.configuration.BuildTimeConfigurationReader$ReadOperation.readConfigValue(BuildTimeConfigurationReader.java:612)
	at io.quarkus.deployment.configuration.BuildTimeConfigurationReader$ReadOperation.readConfigGroup(BuildTimeConfigurationReader.java:557)
	at io.quarkus.deployment.configuration.BuildTimeConfigurationReader$ReadOperation.run(BuildTimeConfigurationReader.java:285)
	at io.quarkus.deployment.configuration.BuildTimeConfigurationReader.readConfiguration(BuildTimeConfigurationReader.java:241)
	at io.quarkus.deployment.ExtensionLoader.loadStepsFrom(ExtensionLoader.java:236)
	at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:97)
	at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:252)
	... 16 more

2020-12-18 22:55:50,363 INFO  [io.qua.dep.dev.IsolatedDevModeMain] (main) Attempting to start hot replacement endpoint to recover from previous Quarkus startup failure

Notice that the container does not terminate.

To Reproduce

  • Checkout https://github.com/turing85/quarkus-property-devmode-bug

  • Build the application, start the container:

    ./mvnw -Dquarkus.container-image.build=true clean package && docker run quarkus-bug/hello-app
    

Environment (please complete the following information):

  • Output of uname -a or ver:

    Linux XXX 5.4.0-59-generic #65-Ubuntu SMP Thu Dec 10 12:01:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
    
  • Output of java -version:

    openjdk version "11.0.4" 2019-07-16
    OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.4+11)
    OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.4+11, mixed mode)
    
  • GraalVM version (if different from Java): N/A

  • Quarkus version or git rev: 1.10.5.Final

  • Build tool (ie. output of mvnw --version or gradlew --version):

    Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
    Maven home: /home/marco/.m2/wrapper/dists/apache-maven-3.6.3-bin/1iopthnavndlasol9gbrbg6bf2/apache-maven-3.6.3
    Java version: 11.0.4, vendor: AdoptOpenJDK, runtime: /opt/adoptOpenJDK/11.0.4+11
    Default locale: en_US, platform encoding: UTF-8
    OS name: "linux", version: "5.4.0-59-generic", arch: "amd64", family: "unix"
    

Additional context
This only occurs when the environment variable QUARKUS_LAUNCH_DEVMODE is set to true. If this flag is removed form Dockerfile.fast-jar, the container starts up as expected.

@turing85 turing85 added the kind/bug Something isn't working label Dec 18, 2020
@ghost ghost added the area/maven label Dec 18, 2020
@ghost
Copy link

ghost commented Dec 18, 2020

/cc @quarkusio/devtools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants