Bug #17007

Starting or canceling the build of a host fails if an ipv6 address is configured

Added by Robert Frank about 1 year ago. Updated about 1 year ago.

Status:Closed
Priority:High
Assigned To:Timo Goebel
Category:DNS
Target version:-
Difficulty: Bugzilla link:
Found in release:1.13.0 Pull request:https://github.com/theforeman/foreman/pull/3967
Story points-
Velocity based estimate-
Release1.13.1Release relationshipAuto

Description

If I try to start or cancel the build of a host it fails with the following error:

Failed to save: Conflict IPv6 DNS record <fqdn>/<ipv6 address> already exists

The configured IPv6 address and the conflicting address are the same, but they use different case for the hex letters (configured IPv6 address uses lower case, conflicting address in error message uses upper case.
The source of the error is in the conflicts method in lib/net/dns/forward_record.rb:
@conflicts ||= [dns_lookup(hostname)].delete_if { |c| c == self }.compact

The IPv6 addresses returned by dns_lookup have upper case hex letters which causes c == self to be always false.
Forcing the lookup method in lib/net/dns.rb to return lower case IPv6 addresses solved this particular problem for me:
ip = resolver.getresource(query, Resolv::DNS::Resource::IN::AAAA).address.to_s.downcase

There might be other places which could have similar problems when comparing IPv6 addresses.


Related issues

Duplicated by Foreman - Bug #17075: IPv6 dns records always conflicting Duplicate 10/24/2016

Associated revisions

Revision 0babfc65
Added by Timo Goebel about 1 year ago

fixes #17007 - normalize dns records before comparison

Revision 1be1abec
Added by Timo Goebel about 1 year ago

fixes #17007 - normalize dns records before comparison

(cherry picked from commit 0babfc650c2207ddfb38223928067ee11c6046fb)

History

#1 Updated by Dominic Cleal about 1 year ago

  • Category set to DNS

#2 Updated by Dominic Cleal about 1 year ago

  • Duplicated by Bug #17075: IPv6 dns records always conflicting added

#3 Updated by The Foreman Bot about 1 year ago

  • Status changed from New to Ready For Testing
  • Assigned To set to Timo Goebel
  • Pull request https://github.com/theforeman/foreman/pull/3967 added

#4 Updated by Timo Goebel about 1 year ago

  • Release set to 1.13.1

#5 Updated by Timo Goebel about 1 year ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF