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-config-yaml: Regression since Quarkus 2.7.0.Final #23406

Closed
mschorsch opened this issue Feb 3, 2022 · 3 comments · Fixed by #23633
Closed

quarkus-config-yaml: Regression since Quarkus 2.7.0.Final #23406

mschorsch opened this issue Feb 3, 2022 · 3 comments · Fixed by #23633
Labels
area/config kind/bug Something isn't working
Milestone

Comments

@mschorsch
Copy link
Contributor

Describe the bug

Since Quarkus 2.7.0.Final the following application.yaml produces a failure:

api:
  endpoints:
    "/hello/[0-9]+":
      enabled: true
    "/hello/abc":
      enabled: false

Expected behavior

No response

Actual behavior

ERROR [io.qua.dep.dev.IsolatedDevModeMain] (main) Failed to start quarkus: java.lang.RuntimeException: java.lang.RuntimeException: Failed to start quarkus
	at io.quarkus.dev.appstate.ApplicationStateNotification.waitForApplicationStart(ApplicationStateNotification.java:51)
	at io.quarkus.runner.bootstrap.StartupActionImpl.runMainClass(StartupActionImpl.java:122)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.firstStart(IsolatedDevModeMain.java:145)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:456)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:67)
	at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:150)
	at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:106)
	at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:132)
	at io.quarkus.deployment.dev.DevModeMain.main(DevModeMain.java:62)
Caused by: 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:104)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:67)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:41)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:120)
	at io.quarkus.runner.GeneratedMain.main(Unknown Source)
	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.runner.bootstrap.StartupActionImpl$1.run(StartupActionImpl.java:103)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.IllegalStateException: io.smallrye.config.ConfigValidationException: Configuration validation failed:
	java.util.NoSuchElementException: SRCFG00014: The config property enabled is required but it could not be found in any config source
	at io.smallrye.config.SmallRyeConfigBuilder.build(SmallRyeConfigBuilder.java:453)
	at io.quarkus.runtime.generated.Config.readConfig(Unknown Source)
	at io.quarkus.deployment.steps.RuntimeConfigSetup.deploy(Unknown Source)
	... 13 more
Caused by: io.smallrye.config.ConfigValidationException: Configuration validation failed:
	java.util.NoSuchElementException: SRCFG00014: The config property enabled is required but it could not be found in any config source
	at io.smallrye.config.ConfigMappingProvider.mapConfiguration(ConfigMappingProvider.java:882)
	at io.smallrye.config.ConfigMappingProvider.mapConfiguration(ConfigMappingProvider.java:838)
	at io.smallrye.config.SmallRyeConfigBuilder.build(SmallRyeConfigBuilder.java:450)
	... 15 more

How to Reproduce?

reproducer.zip

Output of uname -a or ver

No response

Output of java -version

Java 11

GraalVM version (if different from Java)

No response

Quarkus version or git rev

Quarkus 2.7.0.Final

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

Maven

Additional information

No response

@mschorsch mschorsch added the kind/bug Something isn't working label Feb 3, 2022
@gsmet
Copy link
Member

gsmet commented Feb 3, 2022

@radcortez could you have a look?

@radcortez
Copy link
Member

Sure.

@radcortez
Copy link
Member

In this particular case, due to the indexed properties support, the square brackets are reserved to represent collections, but because of smallrye/smallrye-config#682, it kinda worked.

My recommendation is to avoid using square brackets in the property's name, although I'm preparing a PR to support them in key map names.

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.

3 participants