rc/SIENTIAPDE-2165 - fix: read MLflow error message/traceback from status['content'], not the top level

This commit is contained in:
Carla Pinto
2026-10-08 14:10:40 +02:00
parent 2649476571
commit 75b56251ef
2 changed files with 25 additions and 6 deletions

View File

@@ -393,14 +393,20 @@ class Gates(SientiaMonitoring):
try:
if mlflow_response_filter_functions[fil](status, filter_config):
triggered_filters.append((fil, policy, filter_config))
comments.append(status.get('message', 'Unknown MLFlow API error'))
# The real error lives one level in, under `content` — `request_transform`/
# `request_predict` nest `message`/`traceback` there on failure (mlflow.py),
# reusing the same `content` key the success path uses for the DataFrame
# (review finding, 2026-10-08: reading `status['message']` directly always
# fell back to the generic default, in every real production occurrence).
error_content = status.get('content') or {}
comments.append(error_content.get('message', 'Unknown MLFlow API error'))
self.send_notification(
metadata=metadata,
notification_id=f'{gate_type.upper()}_GATE_RESPONSE_FILTER__{fil}',
message=status.get('message', 'Unknown MLFlow API error'),
message=error_content.get('message', 'Unknown MLFlow API error'),
block='mlflow_gate',
level=NotificationLevel.ERROR,
attachment_content=status.get('traceback'),
attachment_content=error_content.get('traceback'),
)
except Exception as e:
trace = traceback.format_exc()