Skip to content

[Backport 8.x] Fix Resolv regression when querying IPv6 DNS servers#538

Merged
OpenVoxProjectBot merged 2 commits into
8.xfrom
backport-537-to-8.x
Jul 24, 2026
Merged

[Backport 8.x] Fix Resolv regression when querying IPv6 DNS servers#538
OpenVoxProjectBot merged 2 commits into
8.xfrom
backport-537-to-8.x

Conversation

@OpenVoxProjectBot

@OpenVoxProjectBot OpenVoxProjectBot commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Description

Backport of #537 to 8.x.

Fixes #535

Sharpie and others added 2 commits July 24, 2026 23:06
JRuby 9.4.13.0 switched back to using the upstream Ruby `resolv` gem
instead of maintaining an in-tree version that carried JRuby-specific
patches. However, this switch lost a JRuby patch that normalized IPv6
addresses during DNS lookups. The result is that queries to IPv6 DNS
servers are sent using compressed addresses (e.g. `2001:db8::1`), while
responses arrive from un-compressed addresses (e.g. `2001:db8:0:0:0:0:0:1`).
This mis-match means that queries to IPv6 servers are never seen as
"answered" and the library returns an empty `[]` response after waiting
for 160 seconds.

This commit fixes the issue by loading a monkey-patch that re-applies
the lost JRuby fix: responses are normalized through `Addrinfo.ip`,
which compresses the IPv6 address on the answer and ensures a match.

Fixes #535
Ref: jruby/jruby#9550
Ref: jruby/jruby#4496
Ref: ruby/resolv@5c16180

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Charlie Sharpsteen <charlie@overlookinfratech.com>
(cherry picked from commit ddf5188)
This commit updates the CLI entrypoints to load the Resolv IPv6 patch:

  - puppetserver gem
  - puppetserver irb
  - puppetserver ruby

This is done by swapping the existing call to `initialize-and-create-jruby-config`
for a new `initialize-jruby-cli-config` method that calls the old initialize
and then defines an `:initialize-scripting-container` lifecycle method that
adds `puppet/server/patches/resolv_ipv6_normalization` to the default list
of required libraries.

Thus, the CLI entrypoints behave as if the `-rpuppet/server/patches/resolv_ipv6_normalization`
CLI flag was always present.

Signed-off-by: Charlie Sharpsteen <charlie@overlookinfratech.com>
(cherry picked from commit 67225c7)
@github-actions

Copy link
Copy Markdown
Contributor

The rpm/deb packages and the JAR file for openvox-server are available in a zip archive:
https://github.com/OpenVoxProject/openvox-server/actions/runs/30132914221/artifacts/8611839602

@Sharpie Sharpie added the bug Something isn't working label Jul 24, 2026
@Sharpie

Sharpie commented Jul 24, 2026

Copy link
Copy Markdown
Member

Confirmed fixed on AlmaLinux 10, with IPv6 DNS configured, by the test package CI built from this PR:

# dnf downgrade -y openvox-server 8.15.1
# /opt/puppetlabs/bin/puppetserver ruby -rtimeout -rresolv -e 'Timeout.timeout(10) { puts Resolv::DNS.new.getaddresses("voxpupuli.org") }'
Timeout::Error: execution expired
  timeout at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/timeout.rb:199
   <main> at -e:1

# dnf install -y ./openvox-server-8.16.0-0.1SNAPSHOT.2026.07.24T2309.el10.noarch.rpm
# /opt/puppetlabs/bin/puppetserver ruby -rtimeout -rresolv -e 'Timeout.timeout(10) { puts Resolv::DNS.new.getaddresses("voxpupuli.org") }'
2606:4700:3035::ac43:c6e3
2606:4700:3035::6815:54ee
104.21.84.238
172.67.198.227

@OpenVoxProjectBot
OpenVoxProjectBot merged commit c324176 into 8.x Jul 24, 2026
17 checks passed
@OpenVoxProjectBot
OpenVoxProjectBot deleted the backport-537-to-8.x branch July 24, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants