question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Apple Silicon triggers Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider

See original GitHub issue

When running Netty on Apple Silicon, this error is thrown:

i.n.r.d.DnsServerAddressStreamProviders  : Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider, fallback to system defaults. This may result in incorrect DNS resolutions on MacOS.

In https://github.com/netty/netty/issues/11020 the solution is provided. Which is to add this dependency:

<dependency>
  <groupId>io.netty</groupId>
  <artifactId>netty-resolver-dns-native-macos</artifactId>
  <classifier>osx-aarch_64</classifier>
</dependency>

As a Spring Boot Webflux user, I see that reactor-netty-http pulls in io.netty:netty-resolver-dns-native-macos with classifier osx-x86_64. Reading the pom (https://search.maven.org/artifact/io.projectreactor.netty/reactor-netty-http/1.0.21/jar), this simply happens all the time, whatever arch you’re on.

Reading reactor-netty-core/build.gradle however, I see some logic that tries to set this dynamically based on architecture. It would seem however, that when the artifact is published to maven central, this logic is no longer present in the pom.

Expected Behavior

Reactor-netty-http when included as a dependency in another project on a Apple Silicon machine, should pull in io.netty:netty-resolver-dns-native-macos with classifier osx-aarch_64.

Actual Behavior

reactor-netty-http pulls in io.netty:netty-resolver-dns-native-macos with classifier osx-x86_64, no matter the actual architecture that’s in use.

Steps to Reproduce

The issue https://github.com/netty/netty/issues/11020 provides a repository and reproduction steps

Possible Solution

Include io.netty:netty-resolver-dns-native-macos both with classifier osx-x86_64 and osx-aarch_64. It seems that including osx-x86_64 on an m1 doesn’t do any harm, so I’m (possibly wrongly) assuming the reverse is also fine.

Your Environment

Apple Silicon

  • Reactor version(s) used: 1.0.21
  • Other relevant libraries versions (eg. netty, …): io.netty:netty-resolver-dns-classes-macos:jar:4.1.79.Final
  • JVM version (java -version): openjdk 17.0.3
  • OS and version (eg. uname -a): Darwin xxx 21.6.0 Darwin Kernel Version 21.6.0: Wed Aug 10 14:28:23 PDT 2022; root:xnu-8020.141.5~2/RELEASE_ARM64_T6000 arm64 arm Darwin

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
violetaggcommented, Aug 25, 2022

I proposed an improvement for the log message and this improvement will be in the next Netty 4.1.80.Final/5.0.0.Alpha5 https://github.com/netty/netty/pull/12732

The next step is to remove in version 2.0.x, the dependency to netty-resolver-dns-native-macos with classifier osx-x86_64 so that the users can specify the one that they need.

0reactions
violetaggcommented, Aug 25, 2022

Some of our users have strong requirements to not have unnecessary transitive dependencies so we are not going to add this additional dependency.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to load io.netty.resolver.dns.macos ... - GitHub
Apple Silicon triggers Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider reactor/reactor-netty#2440.
Read more >
Unable to load io.netty.resolver.dns.macos ... - Medium
Problem. MacBook Pro (14-inch, 2021) Chip : Apple M1 Pro. Kotlin version : 1.6.20. Found issue when trying to run or use library...
Read more >
Spring Boot 2.4.2 - DNS Resolution Problem at start on Apple ...
Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider,fallback to system defaults. This may result in incorrect DNS ...
Read more >
Big Sur reproducible DNS resolutio… | Apple Developer Forums
Hello, Since the upgrade to Big Sur, I noticed network issues, regardless which network device is used Wi-Fi, LAN, it does not matter....
Read more >
m1启动gateway Unable to load io.netty.resolver.dns.macos ...
m1启动gateway Unable to load io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider. 已完成. #I4CRO7. 时间淡忘一切.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found