Bug 985623 - unable to add to an AD domain (Exception message is: Comparison method violates its general contract!)
Summary: unable to add to an AD domain (Exception message is: Comparison method violat...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-config
Version: 3.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.3.0
Assignee: Yair Zaslavsky
QA Contact: Pavel Stehlik
URL:
Whiteboard: infra
: 1034798 (view as bug list)
Depends On:
Blocks: 1019461
TreeView+ depends on / blocked
 
Reported: 2013-07-17 23:23 UTC by Vagner Farias
Modified: 2016-02-10 19:08 UTC (History)
6 users (show)

Fixed In Version: is10
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-21 22:16:17 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
sample dns zone to trigger error (3.12 KB, text/plain)
2013-07-17 23:37 UTC, Vagner Farias
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 17047 0 None None None Never
oVirt gerrit 17048 0 None None None Never
oVirt gerrit 17049 0 None None None Never

Description Vagner Farias 2013-07-17 23:23:30 UTC
Description of problem:

When trying to add an AD domain to RHEV Manager configuration, the following error is being printed:

# rhevm-manage-domains -action=add -domain=customer.com.br -user=rhev -provider=ActiveDirectory -interactive 
No LDAP servers can be obtained for domain customer.com.br

engine-manage-domains.log has:

2013-07-17 18:18:53,068 ERROR [org.ovirt.engine.core.utils.dns.DnsSRVLocator] Error: could not find DNS SRV record name: _ldap._tcp.customer.com.br.
Exception message is: Comparison method violates its general contract!
Possible causes: missing DNS entries in the DNS server or DNS resolving issues from engine-core machine.
Please Ensure correct DNS entries exist in the DNS server and ensure the DNS server is reachable from the engine-core machine.
2013-07-17 18:18:53,070 ERROR [org.ovirt.engine.core.utils.kerberos.ManageDomains] No LDAP servers can be obtained for domain customer.com.br

DNS seems to be properly configured, as forward and reverse records are present. However this DNS domain has several _ldap._tcp, _kerberos._tcp and _kerberos._udp  SRV records. 

Version-Release number of selected component (if applicable):
rhevm-config-3.2.0-11.33.el6ev.noarch.rpm

How reproducible:
Tests have shown it is always reproducible with the DNS zone that will be attached to this bz.


Steps to Reproduce:
1. Configure bind to use the zone file provided
2. Run "rhevm-manage-domains -action=add -domain=customer.com.br -provider=ActiveDirectory -user=rhev -interactive" (actually, provider can be any supported option)

Actual results:
No LDAP servers can be obtained for domain customer.com.br

Expected results:
User should be asked to enter password and the domain should be properly added to Manager configuration

Additional info:
I don't have customer actual zone files, but I could reproduce the issue with the configuration attached to this bz. 

It's not required to create a complete IDM or AD domain to raise this error. Having only the SRV records is sufficient.

Comment 1 Vagner Farias 2013-07-17 23:37:06 UTC
Created attachment 775013 [details]
sample dns zone to trigger error

Dirty and ugly zone file. It's incomplete from a DNS perspective, but it triggers the error.

If any of the following records are changed, the error is not triggered:

* removal of any of the records with priority == 10
* change of any priority == 5 to priority == 10

If there's only one record with priority == 0 and one with priority == 5, all the others may have priority == 10 and it'll work properly.

I couldn't understand the complete logic, though.

Comment 2 Vagner Farias 2013-07-18 01:30:13 UTC
A coworker suggested the issue may be related to the way compareTo(SrvRecord other) is implemented in DnsSRVLocator class.

        @Override
        public int compareTo(SrvRecord other) {
                ...
                if (weight == 0 && other.weight != 0) {
                        return -1;
                }
                if (weight != 0) {
                        return 1;
                }
                return 0;
        }

He said that when weight is different from 0, it's not possible to correctly order the records, raising an exception.

I modified my zone file setting weight to 0 on every SRV record and the exception wasn't triggered.

Comment 5 Yair Zaslavsky 2013-12-09 22:26:13 UTC
*** Bug 1034798 has been marked as a duplicate of this bug. ***

Comment 6 Itamar Heim 2014-01-21 22:16:17 UTC
Closing - RHEV 3.3 Released

Comment 7 Itamar Heim 2014-01-21 22:23:09 UTC
Closing - RHEV 3.3 Released


Note You need to log in before you can comment on or make changes to this bug.