Custom config source cannot find key in Quarkus 2.0.0

1,425 views
Skip to first unread message

Den

unread,
Jul 2, 2021, 10:55:19 AM7/2/21
to Quarkus Development mailing list
Hello,

I have a custom config source containing 'some.key=value' and when I start the application with mvn quarkus:dev I get:
 java.util.NoSuchElementException: SRCFG00014: The config property some.key is required but it could not be found in any config source.

At startup, I can see in debugger the key/value is available on method ConfigSource.getValue(String propertyName), The method is first called with %dev prefix '%dev.some.key' which returns null and then it is called again without %dev. prefix which then returns correct value.  But then the exception is thrown.

This application works fine in older versions. Does custom config source works differently now, or is it a bug?

Thanks!

Roberto Cortez

unread,
Jul 2, 2021, 7:34:39 PM7/2/21
to denni...@gmail.com, Quarkus Development mailing list
Hi Den,

We removed the ability to register custom sources for static init, due to them being too problematic. In some situations this was causing chicken / egg issues.

Where are you trying to access your configuration? Is it on static init? Can you provide a reproducer?

Thanks!

Cheers,
Roberto

--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/8939a12f-3fb0-41ee-a707-2af70dcc33ban%40googlegroups.com.

Den

unread,
Jul 3, 2021, 3:57:44 AM7/3/21
to Quarkus Development mailing list

HI Roberto, what do you mean by static init? Packaging the application? Then no, the config is needed at runtime and the error happens at runtime. I'll try to create a reproducer
Message has been deleted
Message has been deleted

Den

unread,
Jul 3, 2021, 5:00:54 AM7/3/21
to Quarkus Development mailing list

Roberto Cortez

unread,
Jul 5, 2021, 5:56:44 AM7/5/21
to denni...@gmail.com, Quarkus Development mailing list
Thanks. I’ll have a look.

Reply all
Reply to author
Forward
0 new messages