Subchapter 46.1
references/custom-model-logging-debugging.mdMarkdown6 KBView on GitHub
Systematic diagnostic procedure for CloudWatch log publishing failures in Clean Rooms ML custom model training and inference jobs.
You MUST ask for all required parameters upfront.
aws sts get-caller-identityDetermine the resource type by inspecting the ARN: if it contains trained-model-inference-job, use the inference job call; otherwise use the trained model call. If ResourceNotFoundException, try the other.
aws cleanroomsml get-trained-model --membership-identifier ${membership_id} --trained-model-arn ${trained_model_arn} --region ${region}aws cleanroomsml get-trained-model-inference-job --membership-identifier ${membership_id} --trained-model-inference-job-arn ${trained_model_arn} --region ${region}If no ARN provided, list recent resources:
aws cleanroomsml list-trained-models --membership-identifier ${membership_id} --region ${region}aws cleanroomsml list-trained-model-inference-jobs --membership-identifier ${membership_id} --region ${region}If multiple returned, present the list and ask the user to confirm which to investigate.
Extract: logsStatus, logsStatusDetails, configuredModelAlgorithmAssociationArn, job status.
If configuredModelAlgorithmAssociationArn is not in the response, use: aws cleanroomsml list-configured-model-algorithm-associations --membership-identifier ${membership_id} --region ${region}. If multiple associations are returned, present the list and ask the user to confirm which one is relevant to the resource under investigation.
aws cleanroomsml get-configured-model-algorithm-association --membership-identifier ${membership_id} --configured-model-algorithm-association-arn ${configured_model_algorithm_association_arn} --region ${region}privacyConfiguration.policies for:
trainedModels.containerLogs with allowedAccountIds (for training)trainedModelInferenceJobs.containerLogs with allowedAccountIds (for inference)allowedAccountIdscontainerLogs is empty/missing, flag this as a likely root cause — but you MUST continue through all remaining steps before generating the diagnosis, as multiple issues may exist simultaneouslyaws cleanroomsml get-ml-configuration --membership-identifier ${membership_id} --region ${region}defaultOutputLocation.roleArn — this role publishes logsaws iam get-role --role-name ${role_name}aws iam list-role-policies --role-name ${role_name}aws iam list-attached-role-policies --role-name ${role_name}aws iam get-role-policy --role-name ${role_name} --policy-name ${policy_name}aws iam get-policy --policy-arn ${policy_arn} then aws iam get-policy-version --policy-arn ${policy_arn} --version-id ${version_id}logs:CreateLogGroup, logs:CreateLogStream, logs:PutLogEvents on arn:aws:logs:*:*:log-group:/aws/cleanroomsml/*cloudwatch:PutMetricData (requires "Resource": "*") for training metricscleanrooms-ml.amazonaws.comaws logs describe-log-groups --log-group-name-prefix /aws/cleanroomsml/TrainedModels --region ${region}aws logs describe-log-groups --log-group-name-prefix /aws/cleanroomsml/TrainedModelInferenceJobs --region ${region}aws logs describe-log-streams --log-group-name ${log_group_name} --order-by LastEventTime --descending --max-items 5 --region ${region}logs:CreateLogGroup permission. Cross-reference with logsStatus and privacy config.Only if logsStatus is PUBLISH_FAILED:
Identify root cause (typically: missing privacy config, missing CloudWatch permissions, missing ML Configuration, or missing trust policy). Provide exact fix with CLI commands. Reference ML roles docs (opens in a new tab) and LogsConfigurationPolicy API (opens in a new tab). Note that a new job must be run after fixing — existing failed jobs won’t retroactively publish logs.
Expected output format:
## Current Status
- Resource: [name] ([status])
- Logs status: [PUBLISH_FAILED/PUBLISH_SUCCEEDED]
## Diagnostic Results
1. [PASS/FAIL] Privacy Config (containerLogs)
2. [PASS/FAIL] ML Configuration exists
3. [N/A/PASS/FAIL] ML Config Role Permissions
4. [PASS/FAIL] Log Groups
## Root Cause
[One-paragraph explanation]
## Fix
[Exact policy statement + CLI command]