Description
openedon Oct 9, 2023
Describe the bug
I have an application, which uses consul, I use property "quarkus.consul-config.agent.host-port" to provide the application with path to deployed consul instance. Starting from 6 or 7 of October, when I deploy this app on Openshift using 999-SNAPSHOT build, the app can not retrieve this property and fails to start.
The property is stored in openshift DeploymentConfig as "template.spec.containers.env.name".
If the property is put into property file, or the property variable inside the yaml is renamed into "QUARKUS_CONSUL_CONFIG_AGENT_HOST_PORT", then everything works fine.
Expected behavior
Application starts succefully
Actual behavior
Application fails with the following error:
16:07:48,407 INFO [app] java.lang.RuntimeException: Failed to start quarkus
16:07:48,408 INFO [app] at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
16:07:48,408 INFO [app] at io.quarkus.runtime.Application.start(Application.java:101)
16:07:48,409 INFO [app] at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:111)
16:07:48,409 INFO [app] at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
16:07:48,409 INFO [app] at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
16:07:48,410 INFO [app] at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
16:07:48,410 INFO [app] at io.quarkus.runner.GeneratedMain.main(Unknown Source)
16:07:48,411 INFO [app] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
16:07:48,411 INFO [app] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
16:07:48,411 INFO [app] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
16:07:48,412 INFO [app] at java.base/java.lang.reflect.Method.invoke(Method.java:568)
16:07:48,412 INFO [app] at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:61)
16:07:48,413 INFO [app] at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:32)
16:07:48,413 INFO [app] Caused by: java.lang.RuntimeException: An error occurred while attempting to fetch configuration from Consul.
16:07:48,413 INFO [app] at io.quarkus.consul.config.runtime.ConsulConfigSourceFactory.getConfigSources(ConsulConfigSourceFactory.java:82)
16:07:48,414 INFO [app] at io.quarkus.consul.config.runtime.ConsulConfigSourceFactory.getConfigSources(ConsulConfigSourceFactory.java:28)
16:07:48,414 INFO [app] at io.quarkus.consul.config.runtime.ConsulConfigSourceFactory.getConfigSources(ConsulConfigSourceFactory.java:19)
16:07:48,415 INFO [app] at io.smallrye.config.ConfigSourceFactory$ConfigurableConfigSourceFactory.getConfigSources(ConfigSourceFactory.java:58)
16:07:48,415 INFO [app] at io.smallrye.config.ConfigurableConfigSource.getConfigSources(ConfigurableConfigSource.java:50)
16:07:48,416 INFO [app] at io.smallrye.config.SmallRyeConfig$ConfigSources.mapLateSources(SmallRyeConfig.java:687)
16:07:48,416 INFO [app] at io.smallrye.config.SmallRyeConfig$ConfigSources.<init>(SmallRyeConfig.java:577)
16:07:48,416 INFO [app] at io.smallrye.config.SmallRyeConfig.<init>(SmallRyeConfig.java:68)
16:07:48,417 INFO [app] at io.smallrye.config.SmallRyeConfigBuilder.build(SmallRyeConfigBuilder.java:698)
16:07:48,417 INFO [app] at io.quarkus.runtime.generated.Config.readConfig(Unknown Source)
16:07:48,417 INFO [app] at io.quarkus.runtime.generated.Config.createRunTimeConfig(Unknown Source)
16:07:48,418 INFO [app] at io.quarkus.deployment.steps.RuntimeConfigSetup.deploy(Unknown Source)
16:07:48,418 INFO [app] ... 13 more
16:07:48,419 INFO [app] Caused by: java.util.concurrent.CompletionException: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: localhost/127.0.0.1:8500
16:07:48,419 INFO [app] at io.smallrye.mutiny.operators.uni.UniBlockingAwait.await(UniBlockingAwait.java:79)
16:07:48,420 INFO [app] at io.smallrye.mutiny.groups.UniAwait.atMost(UniAwait.java:65)
16:07:48,420 INFO [app] at io.quarkus.consul.config.runtime.ConsulConfigSourceFactory.getConfigSources(ConsulConfigSourceFactory.java:79)
16:07:48,420 INFO [app] ... 24 more
16:07:48,421 INFO [app] Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: localhost/127.0.0.1:8500
16:07:48,422 INFO [app] Caused by: java.net.ConnectException: Connection refused
16:07:48,422 INFO [app] at java.base/sun.nio.ch.Net.pollConnect(Native Method)
16:07:48,422 INFO [app] at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672)
16:07:48,423 INFO [app] at java.base/sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:946)
16:07:48,423 INFO [app] at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:337)
16:07:48,424 INFO [app] at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:334)
16:07:48,424 INFO [app] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:776)
16:07:48,425 INFO [app] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
16:07:48,425 INFO [app] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
16:07:48,425 INFO [app] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
16:07:48,426 INFO [app] at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
16:07:48,426 INFO [app] at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
16:07:48,427 INFO [app] at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
16:07:48,427 INFO [app] at java.base/java.lang.Thread.run(Thread.java:833)
How to Reproduce?
git clone git@github.com:quarkus-qe/quarkus-test-framework.git
mvn clean install -Pframework
- Log in into openshift
This fails: " mvn clean install -Pexamples,openshift -pl examples/consul/ -Dit.test=OpenShiftGreetingResourceIT -Dquarkus.platform.version=999-SNAPSHOT"
This works as expected:mvn clean install -Pexamples,openshift -pl examples/consul/ -Dit.test=OpenShiftGreetingResourceIT -Dquarkus.platform.version=3.4.2
If option -Dts.global.delete.folder.on.exit=false
is added, then yaml file examples/consul/target/OpenShiftGreetingResourceIT/app/openshift.yml
contains deployment config
By default, the project is cleared afterwards, add -Dts.openshift.delete.project.after.all=false -Dts.openshift.ephemeral.namespaces.enabled=false
to use the persistent one
Output of uname -a
or ver
6.4.14-200.fc38.x86_64
Output of java -version
17.0.5, vendor: GraalVM Community
GraalVM version (if different from Java)
No response
Quarkus version or git rev
Build tool (ie. output of mvnw --version
or gradlew --version
)
Apache Maven 3.8.7 (b89d5959fcde851dcb1c8946a785a163f14e1e29)
Additional information
No response