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 will crash when specified the environment variable QUARKUS_KUBERNETES_CONFIG_SECRETS_ENABLED #36622

Closed
cuichenli opened this issue Oct 23, 2023 · 8 comments
Labels

Comments

@cuichenli
Copy link
Contributor

Describe the bug

according to the document https://quarkus.io/guides/kubernetes-config#quarkus-kubernetes-config_quarkus.kubernetes-config.secrets.enabled

this environment variable should match the config for quarkus.kubernetes-config.secrets.enabled

But the actual case is whenever this environment variable is provided, quarkus will fail to start with the following error messages:

2023-10-23 15:09:11,515 ERROR [io.qua.run.Application] (Quarkus Main Thread) Failed to start application (with profile [dev]): java.lang.RuntimeException: Failed to start quarkus
	at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
	at io.quarkus.runtime.Application.start(Application.java:101)
	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:111)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
	at io.quarkus.runner.GeneratedMain.main(Unknown Source)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
	at io.quarkus.runner.bootstrap.StartupActionImpl$1.run(StartupActionImpl.java:113)
	at java.base/java.lang.Thread.run(Thread.java:1589)
Caused by: java.lang.IndexOutOfBoundsException: Range [34, -1) out of bounds for length 41
	at java.base/jdk.internal.util.Preconditions$3.apply(Preconditions.java:71)
	at java.base/jdk.internal.util.Preconditions$3.apply(Preconditions.java:68)
	at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:213)
	at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:210)
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:98)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckFromToIndex(Preconditions.java:112)
	at java.base/jdk.internal.util.Preconditions.checkFromToIndex(Preconditions.java:349)
	at java.base/java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:683)
	at java.base/java.lang.StringBuilder.append(StringBuilder.java:218)
	at io.smallrye.config.ConfigMappingProvider.additionalMappedProperties(ConfigMappingProvider.java:1132)
	at io.smallrye.config.ConfigMappingProvider.mapConfiguration(ConfigMappingProvider.java:960)
	at io.smallrye.config.ConfigMappings.mapConfiguration(ConfigMappings.java:91)
	at io.smallrye.config.SmallRyeConfigBuilder.build(SmallRyeConfigBuilder.java:647)
	at io.quarkus.runtime.generated.Config.readConfig(Unknown Source)
	at io.quarkus.runtime.generated.Config.createRunTimeConfig(Unknown Source)
	at io.quarkus.deployment.steps.RuntimeConfigSetup.deploy(Unknown Source)
	... 11 more

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

https://github.com/cuichenli/quarkus-buggy-environment-variable

QUARKUS_KUBERNETES_CONFIG_SECRETS_ENABLED="true" ./gradlew quarkusDev

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

3.4.2

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

No response

Additional information

No response

@cuichenli cuichenli added the kind/bug Something isn't working label Oct 23, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Oct 23, 2023

/cc @geoand (kubernetes), @iocanel (kubernetes)

@rysurd
Copy link
Contributor

rysurd commented Oct 24, 2023

Hello ! I'll try to have a look at this issue if no one is already on it.

@geoand
Copy link
Contributor

geoand commented Oct 24, 2023

Go for it!

@radcortez
Copy link
Member

@rysurd thanks, but this is already fixed in the latest Quarkus version.

@cuichenli please, update to Quarkus 3.5.0. Thanks!

@radcortez radcortez closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2023
@gsmet
Copy link
Member

gsmet commented Oct 24, 2023

please, update to Quarkus 3.5.0. Thanks!

It's not released yet, we will release it tomorrow :).

@cuichenli
Copy link
Contributor Author

@radcortez thanks for the info. do you know in which pr we got this issue fixed? just want to know why this is happening. thanks!

@rysurd
Copy link
Contributor

rysurd commented Oct 24, 2023

Yes I'd interested too in knowing how this was fixed :)

@radcortez
Copy link
Member

This was introduced in smallrye/smallrye-config#984 and later fixed by smallrye/smallrye-config#1000 as part of some work to improve memory allocation.

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

No branches or pull requests

5 participants