Azure / Azure/azure-functions-java-worker

[BUG] Java class DnsContextFactory could not be found the DNS on Azure function service.

Open
#496 2 comments 0 reactions 1 assignee Claimed by @shreyas-gopalakrishna View on GitHub
area:java-functions Bug needs-discussion needs-investigation Needs: Triage (Functions) reviewed
Dominant language
Java
Stars
103
Forks
74
Avg merge
4d 8h
Merged PRs (30d)
2

Description

#### Repro steps

Provide the steps required to reproduce the problem:

1. Call Azure key vault, Service bus, Storage APIs,... by Netty.
2. Netty will be resolved DNS by [DirContextUtils](https://github.com/netty/netty/blob/4.1/resolver-dns/src/main/java/io/netty/resolver/dns/DefaultDnsServerAddressStreamProvider.java#L53) class to get host IP of the above APIs.
3. DirContextUtils is got host name via DnsContextFactory.

#### Expected behavior

Provide a description of the expected behavior.

- After DirContextUtils is performed, the DNS string is dns://xxxx dns://yyyy

#### Actual behavior

Provide a description of the actual behavior observed.

- The DNS string is dns:// (empty)
- The Netty will call a fallback function to resolve IPs. The fallback function will be used the Google DNS. I don't want use this DNS for my Azure function.

#### Related information

Provide any related information

* Programming language used: Java 11
* Links to source: [DirContextUtils](https://github.com/netty/netty/blob/559c08555eea54582b24c7c52152f75b6dbb4301/resolver-dns/src/main/java/io/netty/resolver/dns/DirContextUtils.java#L45)
* Netty version: 4.1.68 - 4.1.70
* Os: **win**

#### Some settings of Azure function:
- Configuration:
WEBSITE_DNS_SERVER = 168.63.129.16
WEBSITE_CONTENTOVERVNET = 1
WEBSITE_VNET_ROUTE_ALL = 1
FUNCTIONS_EXTENSION_VERSION = ~4

- Networking:
Vnet: enabled

```log
2021-12-08T06:29:34.017 [Information] DEBUG io.netty.resolver.dns.DirContextUtils: Skipping a malformed nameserver URI: dns://
2021-12-08T06:29:34.018 [Information] java.net.URISyntaxException: Expected authority at index 6: dns://
2021-12-08T06:29:34.018 [Information] at java.base/java.net.URI$Parser.fail(URI.java:2913)
2021-12-08T06:29:34.018 [Information] at java.base/java.net.URI$Parser.failExpecting(URI.java:2919)
2021-12-08T06:29:34.018 [Information] at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3163)
2021-12-08T06:29:34.018 [Information] at java.base/java.net.URI$Parser.parse(URI.java:3114)
2021-12-08T06:29:34.019 [Information] at java.base/java.net.URI.(URI.java:600)
2021-12-08T06:29:34.019 [Information] at io.netty.resolver.dns.DirContextUtils.addNameServers(DirContextUtils.java:56)
2021-12-08T06:29:34.019 [Information] at io.netty.resolver.dns.DefaultDnsServerAddressStreamProvider.(DefaultDnsServerAddressStreamProvider.java:53)
2021-12-08T06:29:34.019 [Information] at io.netty.resolver.dns.DnsServerAddressStreamProviders$DefaultProviderHolder$1.provider(DnsServerAddressStreamProviders.java:140)
2021-12-08T06:29:34.019 [Information] at io.netty.resolver.dns.DnsServerAddressStreamProviders$DefaultProviderHolder$1.(DnsServerAddressStreamProviders.java:120)
2021-12-08T06:29:34.019 [Information] at io.netty.resolver.dns.DnsServerAddressStreamProviders$DefaultProviderHolder.(DnsServerAddressStreamProviders.java:118)
2021-12-08T06:29:34.019 [Information] at io.netty.resolver.dns.DnsServerAddressStreamProviders.unixDefault(DnsServerAddressStreamProviders.java:107)
2021-12-08T06:29:34.019 [Information] at io.netty.resolver.dns.DnsServerAddressStreamProviders.platformDefault(DnsServerAddressStreamProviders.java:103)
2021-12-08T06:29:34.019 [Information] at io.netty.resolver.dns.DnsNameResolverBuilder.(DnsNameResolverBuilder.java:60)
2021-12-08T06:29:34.019 [Information] at reactor.netty.transport.NameResolverProvider.newNameResolverGroup(NameResolverProvider.java:432)
2021-12-08T06:29:34.019 [Information] at reactor.netty.tcp.TcpResources.getOrCreateDefaultResolver(TcpResources.java:306)
2021-12-08T06:29:34.019 [Information] at reactor.netty.http.HttpResources.getOrCreateDefaultResolver(HttpResources.java:140)
2021-12-08T06:29:34.019 [Information] at reactor.netty.http.client.HttpClientConfig.defaultAddressResolverGroup(HttpClientConfig.java:380)
2021-12-08T06:29:34.019 [Information] at reactor.netty.transport.ClientTransportConfig.resolverInternal(ClientTransportConfig.java:219)
2021-12-08T06:29:34.019 [Information] at reactor.netty.http.client.HttpClientConfig.resolverInternal(HttpClientConfig.java:434)
2021-12-08T06:29:34.019 [Information] at reactor.netty.http.client.HttpClientConnect$MonoHttpConnect.lambda$subscribe$0(HttpClientConnect.java:265)
2021-12-08T06:29:34.019 [Information] at reactor.core.publisher.MonoCreate.subscribe(MonoCreate.java:57)
2021-12-08T06:29:34.019 [Information] at reactor.core.publisher.FluxRetryWhen.subscribe(FluxRetryWhen.java:76)
2021-12-08T06:29:34.019 [Information] at reactor.core.publisher.MonoRetryWhen.subscribeOrReturn(MonoRetryWhen.java:46)
2021-12-08T06:29:34.019 [Information] at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:57)
2021-12-08T06:29:34.019 [Information] at reactor.netty.http.client.HttpClientConnect$MonoHttpConnect.subscribe(HttpClientConnect.java:272)
2021-12-08T06:29:34.019 [Information] at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64)
2021-12-08T06:29:34.020 [Information] at reactor.core.publisher.FluxRetryWhen.subscribe(FluxRetryWhen.java:76)
2021-12-08T06:29:34.020 [Information] at reactor.core.publisher.MonoRetryWhen.subscribeOrReturn(MonoRetryWhen.java:46)
2021-12-08T06:29:34.020 [Information] at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:57)
2021-12-08T06:29:34.020 [Information] at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52)
2021-12-08T06:29:34.020 [Information] at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64)
2021-12-08T06:29:34.020 [Information] at reactor.core.publisher.MonoDelaySubscription.accept(MonoDelaySubscription.java:52)
2021-12-08T06:29:34.020 [Information] at reactor.core.publisher.MonoDelaySubscription.accept(MonoDelaySubscription.java:33)
2021-12-08T06:29:34.021 [Information] at reactor.core.publisher.FluxDelaySubscription$DelaySubscriptionOtherSubscriber.onNext(FluxDelaySubscription.java:130)
2021-12-08T06:29:34.021 [Information] at reactor.core.publisher.MonoDelay$MonoDelayRunnable.run(MonoDelay.java:119)
2021-12-08T06:29:34.021 [Information] at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68)
2021-12-08T06:29:34.021 [Information] at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28)
2021-12-08T06:29:34.021 [Information] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
2021-12-08T06:29:34.021 [Information] at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
2021-12-08T06:29:34.021 [Information] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
2021-12-08T06:29:34.021 [Information] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
2021-12-08T06:29:34.021 [Information] at java.base/java.lang.Thread.run(Thread.java:829)
2021-12-08T06:29:34.021 [Information] WARN io.netty.resolver.dns.DefaultDnsServerAddressStreamProvider: Default DNS servers: [/8.8.8.8:53, /8.8.4.4:53] (Google Public DNS as a fallback)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.