recon_gen.common.probe

Probe a deployed QuickSight dashboard for visual datasource errors.

QuickSight surfaces datasource errors (Oracle ORA-NNNNN, Postgres syntax errors, connection timeouts, etc.) as a generic “Your database generated a SQL exception” banner in the visual itself — the actual driver message is only visible in the embedded iframe’s JavaScript console as a “Stream error occurred: {…}” payload. That makes the actual cause invisible to the user clicking through the rendered dashboard.

This module walks every sheet of a deployed dashboard via Playwright + the embed-URL flow used by the e2e harness, captures those Stream errors as they fire, parses the JSON payload, and returns a per-sheet summary so a CLI can print the actual driver message (“ORA-00904: “table_count”: invalid identifier”) alongside the sheet that produced it.

Functions

assert_no_datasource_errors(console_messages, *)

Scan a captured-console-message list for QS Stream errors that indicate a per-visual datasource failure (Oracle ORA-NNNNN, Postgres syntax error, etc.) and raise AssertionError listing every distinct (error_class, message) pair found.

format_report(dashboard_id, results)

Render a probe result as a CLI-friendly text block.

probe_dashboard(*, aws_account_id, ...[, ...])

Walk every sheet tab on a deployed dashboard, capture Stream errors per sheet.

Classes

ProbedError(error_class, message)

One QS Stream error captured while a sheet was active.

class recon_gen.common.probe.ProbedError(error_class, message)[source]

Bases: NamedTuple

One QS Stream error captured while a sheet was active.

Parameters:
  • error_class (str)

  • message (str)

error_class: str

Alias for field number 0

message: str

Alias for field number 1

recon_gen.common.probe.assert_no_datasource_errors(console_messages, *, context='')[source]

Scan a captured-console-message list for QS Stream errors that indicate a per-visual datasource failure (Oracle ORA-NNNNN, Postgres syntax error, etc.) and raise AssertionError listing every distinct (error_class, message) pair found.

Designed for the e2e harness’s run_dashboard_check_with_retry capture sink — every Playwright session that walks a dashboard accumulates [<type>] <text> console lines, and this turns “QuickSight rendered the page but visuals threw datasource errors” from a silent-pass into a hard failure with the actual driver message.

No-op if console_messages is empty or no Stream errors were captured.

Return type:

None

Parameters:
  • console_messages (list[str])

  • context (str)

recon_gen.common.probe.format_report(dashboard_id, results)[source]

Render a probe result as a CLI-friendly text block.

Return type:

str

Parameters:
  • dashboard_id (str)

  • results (dict[str, list[ProbedError]])

recon_gen.common.probe.probe_dashboard(*, aws_account_id, aws_region, dashboard_id, initial_settle_ms=8000, sheet_settle_ms=8000)[source]

Walk every sheet tab on a deployed dashboard, capture Stream errors per sheet.

Returns a dict keyed by sheet display name. Sheets with no errors map to an empty list.

Return type:

dict[str, list[ProbedError]]

Parameters:
  • aws_account_id (str)

  • aws_region (str)

  • dashboard_id (str)

  • initial_settle_ms (int)

  • sheet_settle_ms (int)