CloudWatch Synthetics Troubleshooter
What this skill does
Diagnoses CloudWatch Synthetics canary failures via a symptom-to-cause
decision tree spanning all five canary types, runtime exceptions, Visual
Monitoring baseline mismatches, authentication failures, timeouts, and
blue/green deployment artifact issues. Emits a deterministic verdict
with the specific failure type, evidence, and a concrete fix.
Quick navigation
| Section |
What it covers |
When to read it |
| Quick reference |
Symptom-to-failure-type lookup table |
Start here for fast triage |
| STRICT output contract |
Mandatory output block format |
Before emitting any response |
| Mindset |
Canary-vs-target distinction, the five canary types |
Understanding the diagnostic model |
| Expert heuristic |
Non-obvious canary failure behaviours |
Review before complex diagnosis |
| Process |
Ordered diagnostic walk (Steps 0-9) |
When running the full diagnosis |
| NEVER |
Top 5 anti-patterns that cause misdiagnosis |
Review before risky recommendations |
| Recent AWS features |
2024-2026 Synthetics updates |
Reference for latest capabilities |
Quick reference — symptom to failure type
| Observed signal |
Failure type |
First probe |
Run FAILED, Duration at/near TimeoutInSeconds |
TIMEOUT |
Check timeout vs run Duration; last step in log |
| Error contains 401/403, "Unauthorized", "Login failed" |
AUTH_FAILURE |
Check Secrets Manager rotation, token expiry |
VisualMonitoringBaselineMismatch |
VISUAL_MONITORING_MISMATCH |
Compare screenshot to baseline; check UI deploy |
SyntaxError, TypeError, ReferenceError, Exception |
RUNTIME_EXCEPTION |
Inspect canary script stack trace |
| All requests return non-200, target unreachable |
TARGET_ENDPOINT_DOWN |
Verify target independently; Route 53 health |
| DNS resolution failure |
DNS_FAILURE |
VPC DNS settings, Route 53, security groups |
| Artifact zip hash differs post-deployment |
ARTIFACT_MISMATCH |
Compare SHA; check blue/green bucket/IAM |
| 429 from target API |
RATE_LIMITED |
Canary frequency vs target API rate limits |
AccessDenied, NoSuchBucket, PermissionDenied |
INSUFFICIENT_PERMISSIONS |
Canary execution role IAM and bucket policy |
STRICT output contract
Every diagnosis response MUST emit this block. No prose before the
block; the block is the entire actionable output.
CANARY: <canary name> in <region>
VERDICT: ROOT_CAUSE_FOUND | NEED_MORE_INFO | ESCALATE
ROOT_CAUSE: <failure type name> — <specific root cause>
FAILURE_TYPE: <TIMEOUT | AUTH_FAILURE | VISUAL_MONITORING_MISMATCH |
RUNTIME_EXCEPTION | TARGET_ENDPOINT_DOWN | NETWORK_ERROR |
DNS_FAILURE | ARTIFACT_MISMATCH | RATE_LIMITED |
SCRIPT_BUG | INSUFFICIENT_PERMISSIONS | UNKNOWN>
EVIDENCE:
- <run report signal>: <error string or status>
- <CloudWatch metric signal>: <metric and value>
- <canary config signal>: <field and value>
ROOT_CAUSE_CATALOG: #<N>
REMEDIATION:
1. <specific fix with CLI command>
2. <verification command>
3. <post-apply monitoring>
Do NOT omit any field. If a field is not applicable, write N/A with a
one-line reason.
Mindset
One-line takeaway: A canary failure does not always mean "the target
is down." Synthetics canaries fail for eleven distinct reasons, and the
FAILED state alone is insufficient to distinguish them. The diagnostic
walk combines the run report error, the canary type, the target endpoint
status, Visual Monitoring baseline state, and CloudWatch metrics.
Three-facts deep-dive (canary-side problems, Visual Monitoring vs functional failures, over-diagnosed timeout): Advanced patterns.
Expert heuristic — non-obvious canary failure behaviours
All nine non-obvious behaviours (shared execution role, baseline auto-update, VPC routing, run-frequency overlap, describe-canary limits, blue/green artifacts, unhandled promise rejections, third-party links, canary recording): Advanced patterns.
Process — Diagnostic decision tree (apply in order)
Step 0: Capture the failure signal
Gather these four pieces before proceeding.
| Signal |
Source |
Why required |
| Canary name + region |
User-provided or describe-canaries |
All API and log calls need this |
| Run report error |
get-canary-runs --name <canary> |
Drives the symptom category |
| Canary type + runtime + timeout |
describe-canary --name <canary> |
Determines which diagnostic path applies |
| CloudWatch metric pattern |
get-metric-statistics on CloudWatchSynthetics |
Confirms sustained vs transient failure |
If the canary name or region is unknown, emit NEED_MORE_INFO:
CANARY: <canary name or unknown>
VERDICT: NEED_MORE_INFO
ROOT_CAUSE: UNKNOWN — cannot diagnose without the canary name and region
FAILURE_TYPE: UNKNOWN
EVIDENCE:
- Run report: not available (canary name not provided)
ROOT_CAUSE_CATALOG: #0
REASON: Identify the failing canary from the CloudWatch alarm, the
Synthetics console (filter State: FAILED), or
aws synthetics describe-canaries --query 'Canaries[?State==`ERROR`]'
MISSING:
- Canary name + region
- The run report error string
- The canary type (GUI Selenium, HTTP, API, broken-link, multi-step)
Step 1: Identify the symptom category
| Category |
Signature |
Diagnostic step |
| A. TIMEOUT |
FAILED, Duration >= TimeoutInSeconds, no specific error |
Step 2 |
| B. AUTH_FAILURE |
Error contains 401, 403, "Unauthorized", "Login failed" |
Step 3 |
| C. VISUAL_MONITORING_MISMATCH |
VisualMonitoringBaselineMismatch or screenshot delta |
Step 4 |
| D. RUNTIME_EXCEPTION |
SyntaxError, TypeError, ReferenceError, Exception |
Step 5 |
| E. TARGET_ENDPOINT_DOWN |
All requests non-200, target independently unreachable |
Step 6 |
| F. ARTIFACT/PERMISSIONS |
AccessDenied, NoSuchBucket, artifact hash mismatch |
Step 7 |
| G. NETWORK/DNS/RATE |
429, ECONNREFUSED, ENOTFOUND, ETIMEDOUT |
Step 8 |
Priority: AUTH_FAILURE precedes TARGET_ENDPOINT_DOWN precedes TIMEOUT
precedes VISUAL_MONITORING_MISMATCH precedes RUNTIME_EXCEPTION.
Step 2: TIMEOUT diagnostic
Canary exceeded TimeoutInSeconds (default 60s, max 300s). The key
question: is the slowness target-side, script-side, or network-side?
Canary timeout baselines:
| Canary type |
Typical Duration |
Default timeout |
Common slow-step |
| GUI Selenium |
15-30s |
60s |
Page load, element wait |
| HTTP ping |
2-5s |
20s |
DNS, connection |
| API HTTP |
5-15s |
30s |
OAuth token, API response |
| Broken-link checker |
10-60s |
120s |
Third-party link response |
| Multi-step |
20-90s |
120s |
Step 2+ after login |
Probes (canary config with timeout, last 5 runs with duration, Duration metric trend): Diagnostic commands.
| Sub-symptom |
Root cause |
Probe |
| Duration near timeout consistently, no single slow step |
Target slow or script inefficient |
Check target response time independently |
| Duration jumps after deployment |
Target change increased latency |
Correlate with deploy time; check APM |
| Duration spikes intermittently |
Network path instability (NAT, TGW) |
Check NAT gateway metrics, route tables |
| Duration near timeout, last step never logs |
Script waits for removed selector |
Inspect canary log for last logged step |
Fix patterns: Target slow (investigate target app), stale selector
(update canary script DOM selectors), VPC network (check NAT gateway
ErrorPortAllocation), run frequency too high (reduce from 1 min to
5 min).
Step 3: AUTH_FAILURE diagnostic
Canary cannot authenticate. Common in GUI Selenium and API canaries
testing authenticated endpoints.
- Secrets Manager: if canary reads credentials from Secrets
Manager, verify the secret was not rotated. Canary role needs
secretsmanager:GetSecretValue.
- Token expiry: API canaries using OAuth/JWT may cache a token
that expired. Script must refresh on each run.
- Credential validity: test account may be locked, password
changed, or MFA policy changed.
- Auth service: Cognito, Auth0, or internal IdP may be down.
Probes (canary-log auth-error query, Secrets Manager rotation history, canary-role secret-access simulation): Diagnostic commands.
| Sub-symptom |
Root cause |
Fix |
| 401/403 on all requests |
Credential expired or rotated |
Update secret; verify rotation Lambda |
| "JWT expired" |
Token cached beyond expiry |
Modify script to fetch fresh token per run |
| "Login failed" (GUI) |
Account locked/changed/MFA challenge |
Reset test account; verify MFA policy |
| Auth service timeout |
Auth provider down |
Escalate to auth service team |
Step 4: VISUAL_MONITORING_MISMATCH diagnostic
Step screenshot differs from baseline beyond tolerance. Separate from
functional errors — the canary's actions succeeded but the visual
comparison flagged a delta.
- Check for recent deployment: if UI deployed, baseline is stale
and needs updating, not the application.
- Download screenshot and baseline: compare visually. Look for
dynamic content (banners, popups, clocks, personalized content).
- Check tolerance setting:
VisualTesting.Tolerance (percentage).
- Check capture timing: anti-flicker or loading-state may cause
inconsistent screenshots.
Probes (Visual Monitoring config, failed-run artifact listing, screenshot download): Diagnostic commands.
| Sub-symptom |
Root cause |
Fix |
| Mismatch after known UI deploy |
Baseline is stale |
Update baseline via console or update-canary |
| Mismatch on one step, others pass |
Dynamic content on that step |
Add ignore region or increase tolerance |
| Mismatch intermittently |
Anti-flicker or loading-state timing |
Add explicit await for page-load-complete |
| Large delta on all steps |
Real UI break or wrong page loaded |
Check target URL; escalate to app team |
Step 5: RUNTIME_EXCEPTION diagnostic
Canary script threw an unhandled exception. The run report contains a
stack trace or error string from the Node.js or Python runtime.
| Runtime |
Exception |
Common cause |
| Node.js |
TypeError: Cannot read properties of undefined |
DOM selector returned null |
| Node.js |
UnhandledPromiseRejectionWarning |
Missing .catch() or un-awaited async |
| Node.js |
ReferenceError: <var> is not defined |
Missing import or scope issue |
| Python |
NoSuchElementException (Selenium) |
Web element removed; DOM changed |
| Python |
TimeoutException (WebDriverWait) |
Element did not appear within wait |
| Python |
ImportError: No module named |
Missing dependency in artifact zip |
Probes (canary-log error/stack-trace query, runtime version, available runtime versions): Diagnostic commands.
Fix patterns: DOM change (update selectors, correlate with
deployment), unhandled promise (add .catch(), await all async calls),
missing dependency (rebuild zip with all modules), runtime upgrade
regression (pin version or update script).
Step 6: TARGET_ENDPOINT_DOWN diagnostic
Target is genuinely unreachable or returning errors.
- Verify independently from a different vantage point (curl,
browser, another canary).
- Check Route 53 / DNS health checks and failover records.
- Check ALB / CloudFront target health and distribution status.
- Check AWS Health Dashboard for regional degradation.
Probes (independent curl check, Route 53 test-dns-answer, ALB target health, SuccessPercent trend): Diagnostic commands.
Fix patterns: Application failure (escalate to app team), DNS
failure (fix Route 53 record/health check), network path (fix VPC
routing/NAT/SG), regional outage (AWS-side incident, escalate through
support).
Step 7: ARTIFACT_MISMATCH / INSUFFICIENT_PERMISSIONS diagnostic
Canary cannot access its artifact bucket, execution role, or
dependencies. Canary-side configuration failure.
Probes (execution role and artifact location, IAM permission simulation, artifact zip existence): Diagnostic commands.
| Sub-symptom |
Root cause |
Fix |
AccessDenied on S3 |
Role lacks s3:GetObject |
Add IAM permission to canary role |
NoSuchBucket or NoSuchKey |
Artifact bucket or zip deleted |
Redeploy canary with correct artifact |
Module not found post-deploy |
Blue/green artifact mismatch |
Compare hash; redeploy from correct source |
KMS AccessDenied |
Role lacks kms:Decrypt on CMK |
Add kms:Decrypt to role policy |
Step 8: RATE_LIMITED / NETWORK_ERROR / DNS_FAILURE diagnostic
Network-level failures distinct from target endpoint failures. The
target may be healthy but the canary's network path is blocked.
Probes (canary-log network-error query, VPC config): Diagnostic commands.
| Sub-symptom |
Root cause |
Fix |
429 from target API |
Canary frequency exceeds API rate limit |
Reduce run frequency; or exempt canary |
ECONNREFUSED |
Target port closed or firewall blocking |
Check security groups, service status |
ENOTFOUND (DNS) |
VPC DNS failure or Route 53 record deleted |
Check VPC DHCP options, Route 53 |
ETIMEDOUT (network) |
NAT, NACL, route table, or peering issue |
Check NAT gateway, route tables, NACLs |
Step 9: Map to root-cause catalog and decide verdict
| # |
Root cause |
Category |
| 1 |
Timeout from slow target |
TIMEOUT |
| 2 |
Timeout from stale selector |
TIMEOUT |
| 3 |
Credential expired or rotated |
AUTH_FAILURE |
| 4 |
Visual Monitoring baseline stale after UI deploy |
VISUAL_MONITORING_MISMATCH |
| 5 |
Runtime exception from DOM change |
RUNTIME_EXCEPTION |
| 6 |
Runtime exception from unhandled promise |
RUNTIME_EXCEPTION |
| 7 |
Target endpoint genuinely down |
TARGET_ENDPOINT_DOWN |
| 8 |
Canaries role missing IAM permission |
INSUFFICIENT_PERMISSIONS |
| 9 |
Artifact zip missing or blue/green mismatch |
ARTIFACT_MISMATCH |
| 10 |
VPC canary DNS or network path failure |
DNS_FAILURE / NETWORK_ERROR |
| 11 |
Target API rate-limiting the canary |
RATE_LIMITED |
Verdict decision:
- ROOT_CAUSE_FOUND — specific failure type identified with a
specific cause (credential, selector, IAM policy, baseline, target).
- NEED_MORE_INFO — operator cannot supply evidence (canary name
unknown, run report unavailable).
- ESCALATE — cause outside operator's scope: production outage,
AWS regional degradation, or canary script bug requiring developer
involvement.
Output format
See STRICT output contract above. Worked examples below.
Worked example — Visual Monitoring mismatch after UI deploy
CANARY: checkout-ui-canary in us-east-1
VERDICT: ROOT_CAUSE_FOUND
ROOT_CAUSE: VISUAL_MONITORING_MISMATCH — the checkout page was
redesigned and deployed at 2026-08-09T14:00Z. The Visual Monitoring
baseline was not updated. Step 3 (payment page) shows a 12.4% pixel
delta vs the 1% tolerance: "Pay Now" button moved from right-aligned
to center, and a new trust badge appears below the total.
FAILURE_TYPE: VISUAL_MONITORING_MISMATCH
EVIDENCE:
- Run report: VisualMonitoringBaselineMismatch on step 3, delta 12.4%
- CloudWatch SuccessPercent: dropped 100% to 0% at 2026-08-09T14:02Z
- CloudWatch Duration: 18s (normal) — canary functionally succeeded
- Deployment correlation: checkout-ui deployed at 2026-08-09T14:00Z
ROOT_CAUSE_CATALOG: #4
REMEDIATION:
1. Confirm the UI change is intentional with the frontend team.
2. Update the Visual Monitoring baseline via console or trigger:
aws synthetics start-canary --name checkout-ui-canary
Then update baseline from the new run's screenshots.
3. Optionally increase tolerance to 2% for minor CSS shifts.
4. Monitor SuccessPercent for 10 minutes; expect return to 100%.
Worked example — auth failure from secret rotation (ROOT_CAUSE_FOUND, catalog #3): Worked examples.
Worked example — insufficient context (NEED_MORE_INFO): Worked examples.
Anti-Patterns — NEVER (top 5)
NEVER assume FAILED means "the target endpoint is down." Eleven
distinct root causes produce FAILED. Only one
(TARGET_ENDPOINT_DOWN) is a genuine target outage. Auth failures,
Visual Monitoring mismatches, runtime exceptions, IAM issues, and
network problems all produce FAILED. Always read the run report.
NEVER raise TimeoutInSeconds as the first fix for a timeout.
The timeout is a symptom. The canary is slow because the target is
slow, the script waits for a missing element, VPC networking is
constrained, or run frequency causes overlap. Always identify the
slow step first.
NEVER treat a Visual Monitoring mismatch as a production incident
without checking for a recent deployment. After a confirmed UI
deployment, Visual Monitoring mismatch is EXPECTED — the baseline is
stale. Update the baseline first; only escalate if no deployment
occurred and the delta shows a broken layout.
NEVER diagnose canary failures without reading the run report.
describe-canary shows configuration and last run state, but NOT the
error details. Always use get-canary-runs or describe-canary-runs
to retrieve the actual error message and step results.
NEVER blame the canary script without checking the target
independently. A canary VPC networking issue, NAT gateway failure,
or DNS misconfiguration can make a healthy target appear "down" to
the canary while being reachable everywhere else. Verify the target
from a different vantage point first.
Remediation guidance
Per-failure-type remediation sequences (TIMEOUT, AUTH_FAILURE, VISUAL_MONITORING_MISMATCH, RUNTIME_EXCEPTION, TARGET_ENDPOINT_DOWN): Error handling.
Diagnostic command reference
The eight numbered reference commands (list canaries, canary config, recent runs, SuccessPercent, log query, artifacts, manual run, IAM simulation): Diagnostic commands.
Recent AWS features (2024-2026)
2024-2026 feature notes (canary recording, Visual Monitoring enhancements, Python runtime GA, VPC canary improvements, runtime lifecycle, blue/green deployments): Advanced patterns.
References
See references/canary-type-reference.md for full canary type
specifications (script templates, default timeout, common failure modes
per type), and references/visual-monitoring-guide.md for Visual
Monitoring configuration, tolerance tuning, and baseline management.
References (load on demand)
- Diagnostic commands — per-step probe commands (Steps 2-8) and the eight numbered reference commands
- Error handling — remediation guidance by failure type
- Worked examples — auth-failure and insufficient-context worked examples
- Advanced patterns — mindset facts, expert heuristics, recent AWS features
Domain
AWS CloudOps / CloudWatch Synthetics Canary Reliability and Visual
Monitoring.
AWS documentation
1---2name: cloudwatch-synthetics-troubleshooter3description: Diagnoses CloudWatch Synthetics canary failures via a symptom-to-cause decision tree covering all five canary types (GUI Selenium WebDriver, HTTP ping, API HTTP, broken-link checker, multi-step), runtime exceptions (Node.js and Python), canary timeout (exceeded max duration), Visual Monitoring screenshot comparison baseline mismatch, authentication failures (canary cannot log in), and blue/green deployment artifact mismatches. Walks canary run logs, HAR files, step-level screenshots, CloudWatch metrics (SuccessPercent, Duration), and canary artifact locations to pinpoint the failure type. Emits a deterministic verdict (ROOT_CAUSE_FOUND | NEED_MORE_INFO | ESCALATE) with the specific failure category, evidence from the run report, and a concrete fix. Use when a Synthetics canary transitions to FAILED state, SuccessPercent drops below threshold, Visual Monitoring reports a baseline mismatch, or the canary logs show timeout, auth, or runtime exceptions.4license: Apache-2.05compatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). Offline diagnosis works from pasted canary run reports, error strings, and CloudWatch metric observations. Live-account diagnosis uses aws synthetics describe-canaries, describe-canary-runs, get-canary-runs, aws logs start-query, aws s3 ls on the artifact bucket, and aws cloudwatch get-metric-statistics for CloudWatchSynthetics metrics (AWS CLI v2, SSO or key-based credentials).6metadata:7 source: https://skillmd.com/skills/jhkchan/cloudwatch-synthetics-troubleshooter8 domain: aws-cloudops9 complexity: high10 requires_llm: 'true'11 phase: '2'12 supports_pipeline: 'true'13 entry_point: 'false'14 family: Management15 task_type: troubleshoot16 skill_class: capability17 lifecycle_status: active18 verdict_shape: ROOT_CAUSE_FOUND | NEED_MORE_INFO | ESCALATE19 version: 0.1.020 author: Jacky Chan — AWS Community Builder21 tags: cloudwatch, synthetics, canary, management, troubleshoot, visual-monitoring, selenium22 dependencies: aws-orchestrator23 keywords: CloudWatch Synthetics, canary, GUI Selenium, WebDriver, HTTP canary, API canary, broken-link checker, multi-step canary, Visual Monitoring, screenshot comparison, baseline mismatch, canary timeout, Node.js runtime, Python runtime, authentication failure, blue/green deployment, canary recording, SuccessPercent, troubleshooting24 when_to_use: Diagnosing a CloudWatch Synthetics canary that has transitioned to FAILED state, SuccessPercent below threshold, Visual Monitoring baseline mismatch alerts, canary timeout errors, authentication failures where the canary cannot log in, runtime exceptions in Node.js or Python canary scripts, broken-link checker failures, or blue/green deployment artifact mismatches.25 when_not_to_use: Canary provisioning or script authoring, CloudWatch alarm configuration audits (use cloudwatch-alarm-auditor), IAM policy authoring for the canary execution role. This skill diagnoses canary failures; it does not author canary scripts.26 activation_triggers: CloudWatch Synthetics canary FAILED, Synthetics canary failure, canary SuccessPercent low, Synthetics Visual Monitoring mismatch, canary screenshot comparison failure, canary timeout exceeded max duration, Synthetics canary authentication failure, canary cannot log in, Synthetics canary runtime exception, troubleshoot CloudWatch canary27 invocation_schema: 'Input: either (a) a symptom description (canary name, failure state, observed CloudWatch metric pattern, error string from the run report), optionally paired with describe-canary output, OR (b) a canary name plus caller context for live-account diagnosis. Output: a deterministic CANARY / VERDICT / ROOT_CAUSE / FAILURE_TYPE / EVIDENCE / REMEDIATION block where VERDICT is one of {ROOT_CAUSE_FOUND, NEED_MORE_INFO, ESCALATE} and FAILURE_TYPE is one of {TIMEOUT, AUTH_FAILURE, VISUAL_MONITORING_MISMATCH, RUNTIME_EXCEPTION, TARGET_ENDPOINT_DOWN, NETWORK_ERROR, DNS_FAILURE, ARTIFACT_MISMATCH, RATE_LIMITED, SCRIPT_BUG, INSUFFICIENT_PERMISSIONS, UNKNOWN}.'28---2930# CloudWatch Synthetics Troubleshooter3132## What this skill does3334Diagnoses CloudWatch Synthetics canary failures via a symptom-to-cause35decision tree spanning all five canary types, runtime exceptions, Visual36Monitoring baseline mismatches, authentication failures, timeouts, and37blue/green deployment artifact issues. Emits a deterministic verdict38with the specific failure type, evidence, and a concrete fix.3940## Quick navigation4142| Section | What it covers | When to read it |43|---|---|---|44| **Quick reference** | Symptom-to-failure-type lookup table | Start here for fast triage |45| **STRICT output contract** | Mandatory output block format | Before emitting any response |46| **Mindset** | Canary-vs-target distinction, the five canary types | Understanding the diagnostic model |47| **Expert heuristic** | Non-obvious canary failure behaviours | Review before complex diagnosis |48| **Process** | Ordered diagnostic walk (Steps 0-9) | When running the full diagnosis |49| **NEVER** | Top 5 anti-patterns that cause misdiagnosis | Review before risky recommendations |50| **Recent AWS features** | 2024-2026 Synthetics updates | Reference for latest capabilities |5152## Quick reference — symptom to failure type5354| Observed signal | Failure type | First probe |55|---|---|---|56| Run FAILED, Duration at/near `TimeoutInSeconds` | TIMEOUT | Check timeout vs run Duration; last step in log |57| Error contains 401/403, "Unauthorized", "Login failed" | AUTH_FAILURE | Check Secrets Manager rotation, token expiry |58| `VisualMonitoringBaselineMismatch` | VISUAL_MONITORING_MISMATCH | Compare screenshot to baseline; check UI deploy |59| `SyntaxError`, `TypeError`, `ReferenceError`, `Exception` | RUNTIME_EXCEPTION | Inspect canary script stack trace |60| All requests return non-200, target unreachable | TARGET_ENDPOINT_DOWN | Verify target independently; Route 53 health |61| DNS resolution failure | DNS_FAILURE | VPC DNS settings, Route 53, security groups |62| Artifact zip hash differs post-deployment | ARTIFACT_MISMATCH | Compare SHA; check blue/green bucket/IAM |63| 429 from target API | RATE_LIMITED | Canary frequency vs target API rate limits |64| `AccessDenied`, `NoSuchBucket`, `PermissionDenied` | INSUFFICIENT_PERMISSIONS | Canary execution role IAM and bucket policy |6566## STRICT output contract6768Every diagnosis response MUST emit this block. No prose before the69block; the block is the entire actionable output.7071```text72CANARY: <canary name> in <region>73VERDICT: ROOT_CAUSE_FOUND | NEED_MORE_INFO | ESCALATE74ROOT_CAUSE: <failure type name> — <specific root cause>75FAILURE_TYPE: <TIMEOUT | AUTH_FAILURE | VISUAL_MONITORING_MISMATCH |76 RUNTIME_EXCEPTION | TARGET_ENDPOINT_DOWN | NETWORK_ERROR |77 DNS_FAILURE | ARTIFACT_MISMATCH | RATE_LIMITED |78 SCRIPT_BUG | INSUFFICIENT_PERMISSIONS | UNKNOWN>79EVIDENCE:80 - <run report signal>: <error string or status>81 - <CloudWatch metric signal>: <metric and value>82 - <canary config signal>: <field and value>83ROOT_CAUSE_CATALOG: #<N>84REMEDIATION:85 1. <specific fix with CLI command>86 2. <verification command>87 3. <post-apply monitoring>88```8990Do NOT omit any field. If a field is not applicable, write `N/A` with a91one-line reason.9293## Mindset9495**One-line takeaway:** A canary failure does not always mean "the target96is down." Synthetics canaries fail for eleven distinct reasons, and the97FAILED state alone is insufficient to distinguish them. The diagnostic98walk combines the run report error, the canary type, the target endpoint99status, Visual Monitoring baseline state, and CloudWatch metrics.100101Three-facts deep-dive (canary-side problems, Visual Monitoring vs functional failures, over-diagnosed timeout): [Advanced patterns](references/advanced-patterns.md).102103## Expert heuristic — non-obvious canary failure behaviours104105All nine non-obvious behaviours (shared execution role, baseline auto-update, VPC routing, run-frequency overlap, describe-canary limits, blue/green artifacts, unhandled promise rejections, third-party links, canary recording): [Advanced patterns](references/advanced-patterns.md).106107## Process — Diagnostic decision tree (apply in order)108109### Step 0: Capture the failure signal110111Gather these four pieces before proceeding.112113| Signal | Source | Why required |114|---|---|---|115| **Canary name + region** | User-provided or `describe-canaries` | All API and log calls need this |116| **Run report error** | `get-canary-runs --name <canary>` | Drives the symptom category |117| **Canary type + runtime + timeout** | `describe-canary --name <canary>` | Determines which diagnostic path applies |118| **CloudWatch metric pattern** | `get-metric-statistics` on `CloudWatchSynthetics` | Confirms sustained vs transient failure |119120If the canary name or region is unknown, emit NEED_MORE_INFO:121122```text123CANARY: <canary name or unknown>124VERDICT: NEED_MORE_INFO125ROOT_CAUSE: UNKNOWN — cannot diagnose without the canary name and region126FAILURE_TYPE: UNKNOWN127EVIDENCE:128 - Run report: not available (canary name not provided)129ROOT_CAUSE_CATALOG: #0130REASON: Identify the failing canary from the CloudWatch alarm, the131 Synthetics console (filter State: FAILED), or132 aws synthetics describe-canaries --query 'Canaries[?State==`ERROR`]'133MISSING:134 - Canary name + region135 - The run report error string136 - The canary type (GUI Selenium, HTTP, API, broken-link, multi-step)137```138139### Step 1: Identify the symptom category140141| Category | Signature | Diagnostic step |142|---|---|---|143| **A. TIMEOUT** | FAILED, Duration >= `TimeoutInSeconds`, no specific error | Step 2 |144| **B. AUTH_FAILURE** | Error contains 401, 403, "Unauthorized", "Login failed" | Step 3 |145| **C. VISUAL_MONITORING_MISMATCH** | `VisualMonitoringBaselineMismatch` or screenshot delta | Step 4 |146| **D. RUNTIME_EXCEPTION** | `SyntaxError`, `TypeError`, `ReferenceError`, `Exception` | Step 5 |147| **E. TARGET_ENDPOINT_DOWN** | All requests non-200, target independently unreachable | Step 6 |148| **F. ARTIFACT/PERMISSIONS** | `AccessDenied`, `NoSuchBucket`, artifact hash mismatch | Step 7 |149| **G. NETWORK/DNS/RATE** | 429, `ECONNREFUSED`, `ENOTFOUND`, `ETIMEDOUT` | Step 8 |150151Priority: AUTH_FAILURE precedes TARGET_ENDPOINT_DOWN precedes TIMEOUT152precedes VISUAL_MONITORING_MISMATCH precedes RUNTIME_EXCEPTION.153154### Step 2: TIMEOUT diagnostic155156Canary exceeded `TimeoutInSeconds` (default 60s, max 300s). The key157question: is the slowness target-side, script-side, or network-side?158159**Canary timeout baselines:**160161| Canary type | Typical Duration | Default timeout | Common slow-step |162|---|---|---|---|163| GUI Selenium | 15-30s | 60s | Page load, element wait |164| HTTP ping | 2-5s | 20s | DNS, connection |165| API HTTP | 5-15s | 30s | OAuth token, API response |166| Broken-link checker | 10-60s | 120s | Third-party link response |167| Multi-step | 20-90s | 120s | Step 2+ after login |168169Probes (canary config with timeout, last 5 runs with duration, Duration metric trend): [Diagnostic commands](references/diagnostic-commands.md).170171| Sub-symptom | Root cause | Probe |172|---|---|---|173| Duration near timeout consistently, no single slow step | Target slow or script inefficient | Check target response time independently |174| Duration jumps after deployment | Target change increased latency | Correlate with deploy time; check APM |175| Duration spikes intermittently | Network path instability (NAT, TGW) | Check NAT gateway metrics, route tables |176| Duration near timeout, last step never logs | Script waits for removed selector | Inspect canary log for last logged step |177178**Fix patterns:** Target slow (investigate target app), stale selector179(update canary script DOM selectors), VPC network (check NAT gateway180`ErrorPortAllocation`), run frequency too high (reduce from 1 min to1815 min).182183### Step 3: AUTH_FAILURE diagnostic184185Canary cannot authenticate. Common in GUI Selenium and API canaries186testing authenticated endpoints.1871881. **Secrets Manager:** if canary reads credentials from Secrets189 Manager, verify the secret was not rotated. Canary role needs190 `secretsmanager:GetSecretValue`.1912. **Token expiry:** API canaries using OAuth/JWT may cache a token192 that expired. Script must refresh on each run.1933. **Credential validity:** test account may be locked, password194 changed, or MFA policy changed.1954. **Auth service:** Cognito, Auth0, or internal IdP may be down.196197Probes (canary-log auth-error query, Secrets Manager rotation history, canary-role secret-access simulation): [Diagnostic commands](references/diagnostic-commands.md).198199| Sub-symptom | Root cause | Fix |200|---|---|---|201| 401/403 on all requests | Credential expired or rotated | Update secret; verify rotation Lambda |202| "JWT expired" | Token cached beyond expiry | Modify script to fetch fresh token per run |203| "Login failed" (GUI) | Account locked/changed/MFA challenge | Reset test account; verify MFA policy |204| Auth service timeout | Auth provider down | Escalate to auth service team |205206### Step 4: VISUAL_MONITORING_MISMATCH diagnostic207208Step screenshot differs from baseline beyond tolerance. Separate from209functional errors — the canary's actions succeeded but the visual210comparison flagged a delta.2112121. **Check for recent deployment:** if UI deployed, baseline is stale213 and needs updating, not the application.2142. **Download screenshot and baseline:** compare visually. Look for215 dynamic content (banners, popups, clocks, personalized content).2163. **Check tolerance setting:** `VisualTesting.Tolerance` (percentage).2174. **Check capture timing:** anti-flicker or loading-state may cause218 inconsistent screenshots.219220Probes (Visual Monitoring config, failed-run artifact listing, screenshot download): [Diagnostic commands](references/diagnostic-commands.md).221222| Sub-symptom | Root cause | Fix |223|---|---|---|224| Mismatch after known UI deploy | Baseline is stale | Update baseline via console or `update-canary` |225| Mismatch on one step, others pass | Dynamic content on that step | Add ignore region or increase tolerance |226| Mismatch intermittently | Anti-flicker or loading-state timing | Add explicit `await` for page-load-complete |227| Large delta on all steps | Real UI break or wrong page loaded | Check target URL; escalate to app team |228229### Step 5: RUNTIME_EXCEPTION diagnostic230231Canary script threw an unhandled exception. The run report contains a232stack trace or error string from the Node.js or Python runtime.233234| Runtime | Exception | Common cause |235|---|---|---|236| Node.js | `TypeError: Cannot read properties of undefined` | DOM selector returned null |237| Node.js | `UnhandledPromiseRejectionWarning` | Missing `.catch()` or un-awaited async |238| Node.js | `ReferenceError: <var> is not defined` | Missing import or scope issue |239| Python | `NoSuchElementException` (Selenium) | Web element removed; DOM changed |240| Python | `TimeoutException` (WebDriverWait) | Element did not appear within wait |241| Python | `ImportError: No module named` | Missing dependency in artifact zip |242243Probes (canary-log error/stack-trace query, runtime version, available runtime versions): [Diagnostic commands](references/diagnostic-commands.md).244245**Fix patterns:** DOM change (update selectors, correlate with246deployment), unhandled promise (add `.catch()`, `await` all async calls),247missing dependency (rebuild zip with all modules), runtime upgrade248regression (pin version or update script).249250### Step 6: TARGET_ENDPOINT_DOWN diagnostic251252Target is genuinely unreachable or returning errors.2532541. **Verify independently** from a different vantage point (curl,255 browser, another canary).2562. **Check Route 53 / DNS** health checks and failover records.2573. **Check ALB / CloudFront** target health and distribution status.2584. **Check AWS Health Dashboard** for regional degradation.259260Probes (independent curl check, Route 53 test-dns-answer, ALB target health, SuccessPercent trend): [Diagnostic commands](references/diagnostic-commands.md).261262**Fix patterns:** Application failure (escalate to app team), DNS263failure (fix Route 53 record/health check), network path (fix VPC264routing/NAT/SG), regional outage (AWS-side incident, escalate through265support).266267### Step 7: ARTIFACT_MISMATCH / INSUFFICIENT_PERMISSIONS diagnostic268269Canary cannot access its artifact bucket, execution role, or270dependencies. Canary-side configuration failure.271272Probes (execution role and artifact location, IAM permission simulation, artifact zip existence): [Diagnostic commands](references/diagnostic-commands.md).273274| Sub-symptom | Root cause | Fix |275|---|---|---|276| `AccessDenied` on S3 | Role lacks `s3:GetObject` | Add IAM permission to canary role |277| `NoSuchBucket` or `NoSuchKey` | Artifact bucket or zip deleted | Redeploy canary with correct artifact |278| `Module not found` post-deploy | Blue/green artifact mismatch | Compare hash; redeploy from correct source |279| `KMS AccessDenied` | Role lacks `kms:Decrypt` on CMK | Add `kms:Decrypt` to role policy |280281### Step 8: RATE_LIMITED / NETWORK_ERROR / DNS_FAILURE diagnostic282283Network-level failures distinct from target endpoint failures. The284target may be healthy but the canary's network path is blocked.285286Probes (canary-log network-error query, VPC config): [Diagnostic commands](references/diagnostic-commands.md).287288| Sub-symptom | Root cause | Fix |289|---|---|---|290| `429` from target API | Canary frequency exceeds API rate limit | Reduce run frequency; or exempt canary |291| `ECONNREFUSED` | Target port closed or firewall blocking | Check security groups, service status |292| `ENOTFOUND` (DNS) | VPC DNS failure or Route 53 record deleted | Check VPC DHCP options, Route 53 |293| `ETIMEDOUT` (network) | NAT, NACL, route table, or peering issue | Check NAT gateway, route tables, NACLs |294295### Step 9: Map to root-cause catalog and decide verdict296297| # | Root cause | Category |298|---|---|---|299| 1 | Timeout from slow target | TIMEOUT |300| 2 | Timeout from stale selector | TIMEOUT |301| 3 | Credential expired or rotated | AUTH_FAILURE |302| 4 | Visual Monitoring baseline stale after UI deploy | VISUAL_MONITORING_MISMATCH |303| 5 | Runtime exception from DOM change | RUNTIME_EXCEPTION |304| 6 | Runtime exception from unhandled promise | RUNTIME_EXCEPTION |305| 7 | Target endpoint genuinely down | TARGET_ENDPOINT_DOWN |306| 8 | Canaries role missing IAM permission | INSUFFICIENT_PERMISSIONS |307| 9 | Artifact zip missing or blue/green mismatch | ARTIFACT_MISMATCH |308| 10 | VPC canary DNS or network path failure | DNS_FAILURE / NETWORK_ERROR |309| 11 | Target API rate-limiting the canary | RATE_LIMITED |310311**Verdict decision:**312- **ROOT_CAUSE_FOUND** — specific failure type identified with a313 specific cause (credential, selector, IAM policy, baseline, target).314- **NEED_MORE_INFO** — operator cannot supply evidence (canary name315 unknown, run report unavailable).316- **ESCALATE** — cause outside operator's scope: production outage,317 AWS regional degradation, or canary script bug requiring developer318 involvement.319320## Output format321322See STRICT output contract above. Worked examples below.323324### Worked example — Visual Monitoring mismatch after UI deploy325326```text327CANARY: checkout-ui-canary in us-east-1328VERDICT: ROOT_CAUSE_FOUND329ROOT_CAUSE: VISUAL_MONITORING_MISMATCH — the checkout page was330 redesigned and deployed at 2026-08-09T14:00Z. The Visual Monitoring331 baseline was not updated. Step 3 (payment page) shows a 12.4% pixel332 delta vs the 1% tolerance: "Pay Now" button moved from right-aligned333 to center, and a new trust badge appears below the total.334FAILURE_TYPE: VISUAL_MONITORING_MISMATCH335EVIDENCE:336 - Run report: VisualMonitoringBaselineMismatch on step 3, delta 12.4%337 - CloudWatch SuccessPercent: dropped 100% to 0% at 2026-08-09T14:02Z338 - CloudWatch Duration: 18s (normal) — canary functionally succeeded339 - Deployment correlation: checkout-ui deployed at 2026-08-09T14:00Z340ROOT_CAUSE_CATALOG: #4341REMEDIATION:342 1. Confirm the UI change is intentional with the frontend team.343 2. Update the Visual Monitoring baseline via console or trigger:344 aws synthetics start-canary --name checkout-ui-canary345 Then update baseline from the new run's screenshots.346 3. Optionally increase tolerance to 2% for minor CSS shifts.347 4. Monitor SuccessPercent for 10 minutes; expect return to 100%.348```349350Worked example — auth failure from secret rotation (ROOT_CAUSE_FOUND, catalog #3): [Worked examples](references/worked-examples.md).351352Worked example — insufficient context (NEED_MORE_INFO): [Worked examples](references/worked-examples.md).353354## Anti-Patterns — NEVER (top 5)355356- **NEVER assume FAILED means "the target endpoint is down."** Eleven357 distinct root causes produce FAILED. Only one358 (TARGET_ENDPOINT_DOWN) is a genuine target outage. Auth failures,359 Visual Monitoring mismatches, runtime exceptions, IAM issues, and360 network problems all produce FAILED. Always read the run report.361362- **NEVER raise `TimeoutInSeconds` as the first fix for a timeout.**363 The timeout is a symptom. The canary is slow because the target is364 slow, the script waits for a missing element, VPC networking is365 constrained, or run frequency causes overlap. Always identify the366 slow step first.367368- **NEVER treat a Visual Monitoring mismatch as a production incident369 without checking for a recent deployment.** After a confirmed UI370 deployment, Visual Monitoring mismatch is EXPECTED — the baseline is371 stale. Update the baseline first; only escalate if no deployment372 occurred and the delta shows a broken layout.373374- **NEVER diagnose canary failures without reading the run report.**375 `describe-canary` shows configuration and last run state, but NOT the376 error details. Always use `get-canary-runs` or `describe-canary-runs`377 to retrieve the actual error message and step results.378379- **NEVER blame the canary script without checking the target380 independently.** A canary VPC networking issue, NAT gateway failure,381 or DNS misconfiguration can make a healthy target appear "down" to382 the canary while being reachable everywhere else. Verify the target383 from a different vantage point first.384385## Remediation guidance386387Per-failure-type remediation sequences (TIMEOUT, AUTH_FAILURE, VISUAL_MONITORING_MISMATCH, RUNTIME_EXCEPTION, TARGET_ENDPOINT_DOWN): [Error handling](references/error-handling.md).388389## Diagnostic command reference390391The eight numbered reference commands (list canaries, canary config, recent runs, SuccessPercent, log query, artifacts, manual run, IAM simulation): [Diagnostic commands](references/diagnostic-commands.md).392393## Recent AWS features (2024-2026)3943952024-2026 feature notes (canary recording, Visual Monitoring enhancements, Python runtime GA, VPC canary improvements, runtime lifecycle, blue/green deployments): [Advanced patterns](references/advanced-patterns.md).396397## References398399See `references/canary-type-reference.md` for full canary type400specifications (script templates, default timeout, common failure modes401per type), and `references/visual-monitoring-guide.md` for Visual402Monitoring configuration, tolerance tuning, and baseline management.403404## References (load on demand)405406- [Diagnostic commands](references/diagnostic-commands.md) — per-step probe commands (Steps 2-8) and the eight numbered reference commands407- [Error handling](references/error-handling.md) — remediation guidance by failure type408- [Worked examples](references/worked-examples.md) — auth-failure and insufficient-context worked examples409- [Advanced patterns](references/advanced-patterns.md) — mindset facts, expert heuristics, recent AWS features410411## Domain412413AWS CloudOps / CloudWatch Synthetics Canary Reliability and Visual414Monitoring.415416## AWS documentation417418- **CloudWatch Synthetics User Guide** — https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html419- **Canary types** — https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html#canary-types420- **Visual Monitoring** — https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/synthetics-visual-monitoring.html421- **Synthetics API Reference** — https://docs.aws.amazon.com/synthetics/latest/APIReference/422- **Synthetics CLI Reference** — https://docs.aws.amazon.com/cli/latest/reference/synthetics/