From 60fe752da468e84a642af51090b27468446606f7 Mon Sep 17 00:00:00 2001 From: Rafael Guterres Jeffman Date: Nov 27 2023 17:17:34 +0000 Subject: ipaserver/dcerpc: avoid logging stack trace in retrieve_anonymously If an error occured when searching foc a DC a stack trace was logged, and execution was aborted. This patch allows execution to continue and log the error message that caused the 'finddc' do fail. Fixes: https://pagure.io/freeipa/issue/9484 Related: https://issues.redhat.com/browse/RHEL-12149 Signed-off-by: Rafael Guterres Jeffman Reviewed-By: Alexander Bokovoy --- diff --git a/ipaserver/dcerpc.py b/ipaserver/dcerpc.py index 675572c..ed9f0c0 100644 --- a/ipaserver/dcerpc.py +++ b/ipaserver/dcerpc.py @@ -935,7 +935,12 @@ class TrustDomainInstance: else: result = netrc.finddc(address=remote_host, flags=flags) except RuntimeError as e: - raise assess_dcerpc_error(e) + dcerpc_error = assess_dcerpc_error(e) + logger.error( + getattr(dcerpc_error, "info", None) + or getattr(dcerpc_error, "reason", str(dcerpc_error)) + ) + return False if not result: return False