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

SearchDomainUnknownHostException #74

Open
agoncal opened this issue Feb 3, 2023 · 2 comments
Open

SearchDomainUnknownHostException #74

agoncal opened this issue Feb 3, 2023 · 2 comments
Labels
backlog Backlog items tests tests framework, unit test, integration test, etc.

Comments

@agoncal
Copy link
Contributor

agoncal commented Feb 3, 2023

@radcortez I've created a branch (https://github.com/quarkiverse/quarkus-azure-services/tree/agoncal/playback) where I am putting PlayBack Tests in action (see #37).

When I execute my PlayBack test I get the Netty exception below. I set the right properties and get the right connection string to App Configuration (I know it's the right connection string because a simple Hello World using this string connection works).

In the code (https://github.com/quarkiverse/quarkus-azure-services/blob/main/extensions/azure-app-configuration/runtime/src/main/java/io/quarkiverse/azure/app/configuration/AzureAppConfigurationConfigSourceFactory.java#L36) you added the following comment:

// We cannot use the Quarkus Vert.x instance, because the configuration executes before starting Vert.x
2023-02-03 12:26:06,713 ERROR [com.azu.cor.htt.pol.RetryPolicy] (vert.x-eventloop-thread-4) {"az.sdk.message":"Retry attempts have been exhausted.","exception":"Failed to resolve 'appcs-quarkus-azure-app-configuration-true.azconfig.io' and search domain query for configured domains failed as well: [numericable.fr]","tryCount":3}
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 8.173 s <<< FAILURE! - in io.quarkiverse.azure.app.configuration.pt.AzureAppConfigurationTest
[ERROR] io.quarkiverse.azure.app.configuration.pt.AzureAppConfigurationTest  Time elapsed: 8.173 s  <<< ERROR!
java.lang.RuntimeException: java.lang.RuntimeException: Failed to start quarkus

Caused by: reactor.core.Exceptions$ReactiveException: io.netty.resolver.dns.DnsResolveContext$SearchDomainUnknownHostException: Failed to resolve 'appcs-quarkus-azure-app-conf.azconfig.io' and search domain query for configured domains failed as well: [numericable.fr]
        at reactor.core.Exceptions.propagate(Exceptions.java:396)
        at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:97)
        at reactor.core.publisher.Mono.block(Mono.java:1742)
        at com.azure.core.implementation.http.rest.AsyncRestProxy.handleRestReturnType(AsyncRestProxy.java:229)
        at com.azure.core.implementation.http.rest.AsyncRestProxy.invoke(AsyncRestProxy.java:80)
        at com.azure.core.implementation.http.rest.RestProxyBase.invoke(RestProxyBase.java:105)
        at com.azure.core.http.rest.RestProxy.invoke(RestProxy.java:92)
        at jdk.proxy4/jdk.proxy4.$Proxy66.listKeyValues(Unknown Source)
        at com.azure.data.appconfiguration.implementation.ConfigurationClientImpl.listConfigurationSettingsSinglePage(ConfigurationClientImpl.java:757)
        at com.azure.data.appconfiguration.implementation.ConfigurationClientImpl.lambda$listConfigurationSettings$24(ConfigurationClientImpl.java:626)
@agoncal
Copy link
Contributor Author

agoncal commented Feb 3, 2023

After some investigation, I noticed that when we use the Netty HTTP Client, it works.

Today the extension uses the Vertx HTTP Client and this causes the exception:

Vertx vertx = Vertx.vertx();
HttpClient vertxAsyncHttpClient = new VertxAsyncHttpClientBuilder().vertx(vertx).build();

ConfigurationClientBuilder clientBuilder = new ConfigurationClientBuilder()
        .httpClient(vertxAsyncHttpClient)
        .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.NONE))
        .connectionString(config.connectionString());

But if I change the HTTP Client to Netty, it works:

HttpClient nettyAsyncHttpClient = new NettyAsyncHttpClientBuilder().build();

ConfigurationClientBuilder clientBuilder = new ConfigurationClientBuilder()
        .httpClient(nettyAsyncHttpClient)
        .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.NONE))
        .connectionString(config.connectionString());

And within the repository we have a http-client-vertx. I am confused about which HTTP Client to use.

There is a related issue: quarkusio/quarkus#26879

@radcortez
Copy link
Contributor

Yes, we changed to the Vert.x one because we cannot compile the Netty one to native (as described in quarkusio/quarkus#26879)

I don't see a reason for the Vert.x one not to work. Maybe we are missing something there. I'll try to have a look.

@majguo majguo added tests tests framework, unit test, integration test, etc. backlog Backlog items labels Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Backlog items tests tests framework, unit test, integration test, etc.
Projects
None yet
Development

No branches or pull requests

3 participants