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

quarkus.http.host property initialization exception during build time, started from Qarkus 2.10.1+ #27185

Closed
OleKsimov opened this issue Aug 8, 2022 · 4 comments · Fixed by #27660
Assignees
Labels
area/config kind/bug Something isn't working
Milestone

Comments

@OleKsimov
Copy link

OleKsimov commented Aug 8, 2022

Describe the bug

Hi guys!
I believe something is changed in the build process in Quarkus 2.10.x+ for "quarkus.http.host" property initialization process.
Right now, it's necessary to have it during container build time, which doesn't look correct because the build system host may differ from the app's host.
In our project, it works as ENV variable from a container:

quarkus.http.host: ${HOST}

and it worked perfectly fine up to 2.9.2 version, but today I checked all versions from 2.10.1 to 2.11.2, and the build process failed with the following exception:

2022-08-08T14:35:22.6914579Z #15 126.2 * What went wrong:
2022-08-08T14:35:22.6916064Z #15 126.2 Execution failed for task ':some-service:quarkusBuild'.
2022-08-08T14:35:22.6916697Z #15 126.2 > io.quarkus.builder.BuildException: Build failure: Build failed due to errors
2022-08-08T14:35:22.8415007Z #15 126.2   	[error]: Build step io.quarkus.smallrye.openapi.deployment.SmallRyeOpenApiProcessor#build threw an exception: java.util.NoSuchElementException: SRCFG00011: Could not expand value HOST in property quarkus.http.host
2022-08-08T14:35:22.8417268Z #15 126.2   	at io.smallrye.config.ExpressionConfigSourceInterceptor$1.accept(ExpressionConfigSourceInterceptor.java:68)
2022-08-08T14:35:22.8418927Z #15 126.2   	at io.smallrye.config.ExpressionConfigSourceInterceptor$1.accept(ExpressionConfigSourceInterceptor.java:58)
2022-08-08T14:35:22.8420391Z #15 126.2   	at io.smallrye.common.expression.ExpressionNode.emit(ExpressionNode.java:22)
2022-08-08T14:35:22.8421680Z #15 126.2   	at io.smallrye.common.expression.Expression.evaluateException(Expression.java:56)
2022-08-08T14:35:22.8422955Z #15 126.2   	at io.smallrye.common.expression.Expression.evaluate(Expression.java:70)
2022-08-08T14:35:22.8424310Z #15 126.2   	at io.smallrye.config.ExpressionConfigSourceInterceptor.getValue(ExpressionConfigSourceInterceptor.java:58)
2022-08-08T14:35:22.8425850Z #15 126.2   	at io.smallrye.config.ExpressionConfigSourceInterceptor.getValue(ExpressionConfigSourceInterceptor.java:38)
2022-08-08T14:35:22.8427426Z #15 126.2   	at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20)
2022-08-08T14:35:22.8428995Z #15 126.2   	at io.smallrye.config.FallbackConfigSourceInterceptor.getValue(FallbackConfigSourceInterceptor.java:24)
2022-08-08T14:35:22.8430624Z #15 126.2   	at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20)
2022-08-08T14:35:22.8432169Z #15 126.2   	at io.smallrye.config.FallbackConfigSourceInterceptor.getValue(FallbackConfigSourceInterceptor.java:24)
2022-08-08T14:35:22.8434393Z #15 126.2   	at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20)
2022-08-08T14:35:22.8436036Z #15 126.2   	at io.smallrye.config.PropertyNamesConfigSourceInterceptor.getValue(PropertyNamesConfigSourceInterceptor.java:17)
2022-08-08T14:35:22.8437654Z #15 126.2   	at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20)
2022-08-08T14:35:22.8439137Z #15 126.2   	at io.smallrye.config.SmallRyeConfig.getConfigValue(SmallRyeConfig.java:307)
2022-08-08T14:35:22.8440428Z #15 126.2   	at io.smallrye.config.SmallRyeConfig.getValue(SmallRyeConfig.java:225)
2022-08-08T14:35:22.8441639Z #15 126.2   	at io.smallrye.config.SmallRyeConfig.getOptionalValue(SmallRyeConfig.java:324)
2022-08-08T14:35:22.8443617Z #15 126.2   	at io.quarkus.smallrye.openapi.deployment.SmallRyeOpenApiProcessor.getAutoServerFilter(SmallRyeOpenApiProcessor.java:455)
2022-08-08T14:35:22.8446409Z #15 126.2   	at io.quarkus.smallrye.openapi.deployment.SmallRyeOpenApiProcessor.storeDocument(SmallRyeOpenApiProcessor.java:1024)
2022-08-08T14:35:22.8448037Z #15 126.2   	at io.quarkus.smallrye.openapi.deployment.SmallRyeOpenApiProcessor.storeDocument(SmallRyeOpenApiProcessor.java:1004)
2022-08-08T14:35:22.8449599Z #15 126.2   	at io.quarkus.smallrye.openapi.deployment.SmallRyeOpenApiProcessor.build(SmallRyeOpenApiProcessor.java:719)
2022-08-08T14:35:22.8451040Z #15 126.2   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)15 actionable tasks: 15 executed
2022-08-08T14:35:22.8452000Z #15 126.2 
2022-08-08T14:35:22.8452977Z #15 126.2   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2022-08-08T14:35:22.8454447Z #15 126.2   	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2022-08-08T14:35:22.8455732Z #15 126.2   	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
2022-08-08T14:35:22.8456941Z #15 126.2   	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:944)
2022-08-08T14:35:22.8458138Z #15 126.2   	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
2022-08-08T14:35:22.8459305Z #15 126.2   	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
2022-08-08T14:35:22.8460522Z #15 126.2   	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
2022-08-08T14:35:22.8461873Z #15 126.2   	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
2022-08-08T14:35:22.8463026Z #15 126.2   	at java.base/java.lang.Thread.run(Thread.java:829)
2022-08-08T14:35:22.8463964Z #15 126.2   	at org.jboss.threads.JBossThread.run(JBossThread.java:501)

Expected behavior

quarkus.http.host property is initialized during runtime (on startup) as in Quarkus 2.9.2 version

Actual behavior

A container build process fails with an exception "Could not expand value HOST in property quarkus.http.host"

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.10.1+

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

No response

Additional information

No response

@OleKsimov OleKsimov added the kind/bug Something isn't working label Aug 8, 2022
@geoand
Copy link
Contributor

geoand commented Aug 9, 2022

cc @radcortez

@radcortez
Copy link
Member

This seems to be caused by #25800.

smallrye/smallrye-config#802 should fix this.

@OleKsimov
Copy link
Author

@radcortez
I've tested it today with 2.12.0 version and the exception during build time is still present.

@radcortez
Copy link
Member

This was not released yet. It requires SmallRye Config 2.12.0.

@quarkus-bot quarkus-bot bot added this to the 2.13 - main milestone Sep 4, 2022
@gsmet gsmet modified the milestones: 2.13 - main, 2.12.1.Final Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants