#9162 RFE: Improve error message with more detail for ipa-replica-install command
Closed: fixed by frenaud. Opened by mpolovka.

Ticket was cloned from Red Hat Bugzilla (product Red Hat Enterprise Linux 8): Bug 2004646

Please note that this Bug is private and may not be accessible as it contains confidential Red Hat customer information.

Description of problem:
The use case is the documented RHEL7 -> RHEL8 migration that means adding 2 new replicas first.
The error happened during the RHEL8 replica installation.
Reproducer to get into such error situation:
- Use external DNS server (we use Windows AD based DNS servers) and not the internal DNS servers of IPA
- Install a RHEL7 IPA server and have it working (we have it also AD connected, but for this case it does not matter)
- Confirm the SRV records point to RHEL7
- Install a RHEL8 server
- Switch on the external DNS the SRV records already tp point to RHEL8 server
- Install RHEL8 IPA server without the --server option to have it using the SRV records (that already point the the RHEL8 server that is  being installed)
- Run on RHEL8 ipa-server-install -uninstall to prepare to try again
- Install RHEL8 IPA server now with the --server=RHEL7-fqdn
- Now you have the failure that the replica-agreement already exists from the first intstallion that was failing because the SRV records were point to the not yet install RHEL8 IPA server
In our installation i found out that mentioned command on replica-agreement had to be executed on the RHEL7-IPA server where the agreement was also already created.
That means that the error is missing important information that the replica-agreement has to be deleteed from the other end of the agreement.
Expected error my real-world use case, the information missing i added in <<...>>:
~~~
The ipa-replica-install command failed, exception: ScriptError: A replication agreement for this host <<fqdn> already exists <<on fqdn>>.
Run this command <<on fqdn to remove the replication agreement>>:
    %% ipa-replica-manage del fqdn --force
~~~

Metadata Update from @mpolovka:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=2004646
- Issue assigned to ftrivino
- Issue tagged with: rfe, tests

Test PR: https://github.com/freeipa/freeipa/pull/6272

Metadata Update from @mpolovka:
- Custom field test_coverage adjusted to https://github.com/freeipa/freeipa/pull/6272

Metadata Update from @ftrivino:
- Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/6273

master:

  • 5457fb7f7efef368b4e6db44f644b909d14c3f44 Update ipa-replica-install replication agreement error message

ipa-4-9:

  • c03a8c3c06562c128aac6be506274995cea74948 Update ipa-replica-install replication agreement error message

master:

  • ce50d2255f9f7adaebd221e462f75cbe79366d75 ipatests: RFE: Improve ipa-replica-install error message
  • 94dd9ef1d69e30f687686d8584b6b79880a098f3 ipatests: tasks: add ipactl start, stop and restart

ipa-4-9:

  • 352b9dfb49bdf1c70a8de9ed7287387417580c86 ipatests: RFE: Improve ipa-replica-install error message
  • 58ddcffc412f7dd5cc762bd6f80faa07fcedf7ec ipatests: tasks: add ipactl start, stop and restart

Metadata Update from @frenaud:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

Metadata