Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1399680

Summary: two-way trust-add fails intermittently
Product: Red Hat Enterprise Linux 7 Reporter: Varun Mylaraiah <mvarun>
Component: ipaAssignee: Martin Babinsky <mbabinsk>
Status: CLOSED WORKSFORME QA Contact: Kaleem <ksiddiqu>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.3CC: abokovoy, mbabinsk, mvarun, pvoborni, rcritten
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-12 13:48:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
pass.txt
none
fail.txt none

Description Varun Mylaraiah 2016-11-29 14:47:40 UTC
Created attachment 1225881 [details]
pass.txt

Description of problem:
two-way trust-add fails intermittently, not sure what is the potential reason behind that.

Version-Release number of selected component (if applicable):


How reproducible:
Every now and then, Not able to backtrack with proper reproduction steps.

Important note:
===============
Tried running automation scripts multiple times on the same AD environments with different beaker/local vm's and the results are not consistent.
Please find the attached log's for both pass and fail results below.  **Please note that, it is the same AD environment**

Result logs:
============
1. Passed ==> pass.txt
2. Failed ==> fail.txt

Pass Result Snippet:
====================
:: [  BEGIN   ] :: Running 'echo Secret123 | ipa trust-add adtest2.qe --admin Administrator                 --range-type=ipa-ad-trust --password --two-way=True'
---------------------------------------------------
Added Active Directory trust for realm "adtest2.qe"
---------------------------------------------------
  Realm name: adtest2.qe
  Domain NetBIOS name: ADTEST2
  Domain Security Identifier: S-1-5-21-1869981227-3608374679-2281468898
  Trust direction: Two-way trust
  Trust type: Active Directory domain
  Trust status: Established and verified
:: [   PASS   ] :: Command 'echo Secret123 | ipa trust-add adtest2.qe --admin Administrator                 --range-type=ipa-ad-trust --password --two-way=True' (Expected 0, got 0)
....

Fail Result Snippet:
=====================
:: [  BEGIN   ] :: Running 'echo Secret123 | ipa trust-add adtest2.qe --admin Administrator                 --range-type=ipa-ad-trust --password --two-way=True'
ipa: ERROR: AD DC was unable to reach any IPA domain controller. Most likely it is a DNS or firewall issue
:: [   FAIL   ] :: Command 'echo Secret123 | ipa trust-add adtest2.qe --admin Administrator                 --range-type=ipa-ad-trust --password --two-way=True' (Expected 0, got 1)

Comment 1 Varun Mylaraiah 2016-11-29 14:48:12 UTC
Created attachment 1225882 [details]
fail.txt

Comment 2 Martin Babinsky 2016-11-30 09:17:32 UTC
The error message gives a hint why it is failing:

"""
ipa: ERROR: AD DC was unable to reach any IPA domain controller. Most likely it is a DNS or firewall issue
"""

There is probably a DNS misconfiguration at AD side and it can not resolve IPA master SRV records.

You can get more info about the issue by adding `log level = 100` in /usr/share/ipa/sm.conf.empty after ipa-adtrust-install, re-starting smbd.service and looking into apache error log after trust-add.

You can also run nslookup on AD DC to resolve _ldap._tcp SRV records in IPA domain:

> nslookup.exe
> set type=srv
> _ldap._tcp.<IPA-REALM>

Comment 8 Petr Vobornik 2017-01-11 09:49:44 UTC
Bump

Comment 9 Varun Mylaraiah 2017-01-12 13:48:42 UTC
Not able to reproduce this bug now. will reopen if it is reproduced again