smt-e2e-dataflow-debugging
Skill1.3k starsChanged 6 months agoApache-2.0View on GitHub
Debugs logical errors and data discrepancies in Dataflow templates by launching jobs via Terraform and comparing source (e.g. Cloud SQL) vs destination (e.g. Spanner) data. Use ONLY when the pipeline launches and runs to completion (terminal state) but exhibits data discrepancies or logical issues. Do NOT use for debugging template startup/runtime crashes or staging/building new templates.
Trending
More talk lately.about the whole repository
Who's talking about GoogleCloudPlatform/DataflowTemplates
- apache/beam“Enforce binary-only constraints during early requirements cache attempts”GitHub · May 26, 2026 · 1 reactions
- apache/beam“Revert gcsio 3 upgrades”GitHub · May 21, 2026 · 1 reactions
- rsamborski/google-skills“Link Checker Report”GitHub · Oct 2, 2026
- gsbingo17/mongodb-to-new“Faster canonical BSON type discovery for _id”GitHub · Sep 22, 2026
- neo4j/docs-dataflow-connector“docs: update launcher VM phase description”GitHub · Sep 22, 2026
The biggest 5 of 34 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 34
Talked about on GitHub (34 times).
On GitHub · 34
- May 26, 2026Enforce binary-only constraints during early requirements cache attempts — apache/beam1 reaction · 6 comments
- May 21, 2026Revert gcsio 3 upgrades — apache/beam1 reaction · 1 comment
- Oct 2, 2026Link Checker Report — rsamborski/google-skills0 reactions
- Sep 22, 2026Faster canonical BSON type discovery for _id — gsbingo17/mongodb-to-new0 reactions
- Sep 22, 2026docs: update launcher VM phase description — neo4j/docs-dataflow-connector0 reactions · 2 comments
29 more on GitHub
- Jul 7, 2026[Task]: Update mheap version to include Node 24 support — apache/beam0 reactions · 1 comment
- May 8, 2026Enhancing counters for MongoDbToMongoDb template — michaeltle-goog/DataflowTemplates0 reactions
- Apr 24, 2026docs: mention import-spec upgrade — neo4j/docs-dataflow-connector0 reactions · 1 comment
- Jan 30, 2026Spanner is hanging when DCP is enabled — apache/beam0 reactions · 4 comments
- Jan 16, 2026[Bug]: Remove Spanner exclusion once bug is fixed — apache/beam0 reactions · 4 comments
- Jan 16, 2026Fix spanner io hang by closing connections — apache/beam0 reactions · 3 comments
- Jan 15, 2026Pin spanner version, not just spanner bom — apache/beam0 reactions · 2 comments
- Jan 14, 2026Update neo4j resource manager — apache/beam0 reactions · 4 comments
- Jan 14, 2026Revert spanner version — apache/beam0 reactions · 4 comments
- Dec 29, 2025Documentation update on RetryDLQ flow — GoogleCloudPlatform/spanner-migration-tool0 reactions · 1 comment
- Oct 20, 2025Fix BigQueryIO File load validate runtime value provider — apache/beam0 reactions · 2 comments
- Aug 28, 2025update the changes.md for upgrading MongoDB Java driver — apache/beam0 reactions · 1 comment
- Apr 16, 2025[Task]: Add Validates Runner Yaml Suite (or add to existing suites) — apache/beam0 reactions
- Apr 6, 2025Fix flaky test for greedy allocator — SurenSK/alluxio_WLTest0 reactions
- Mar 28, 2025Support Time Partitioned Test Tables in BigqueryResourceManager — apache/beam0 reactions · 3 comments
- Mar 28, 2025[Feature Request]: Support Time Partitioned Test Tables in BigqueryResourceManager — apache/beam0 reactions · 1 comment
- Feb 20, 2025Update SpannerSchema to support postgres tokenlist — apache/beam0 reactions · 2 comments
- Nov 15, 2024[Bug]: Certain nullable type resolved to not null coder after #32705 — apache/beam0 reactions · 8 comments
- Nov 3, 2024Fixing Google DataflowTemplates test — TestingResearchIllinois/idoft0 reactions
- Nov 3, 2024Marking PR opened for DataflowTemplates — TestingResearchIllinois/idoft0 reactions
- Sep 10, 2024Fixed flaky test DataStoreConvertersTest.testCheckSameKey() — mihirgune/DataflowTemplates0 reactions
- Mar 13, 2024[Bug] Annotation processor generated duplicated classes from dependency that also used autovalue — google/auto0 reactions · 3 comments
- Feb 8, 2024[Bug]: DualInputNestedValueProvider is not able to get Value properly if input is RuntimeValueProvider. — apache/beam0 reactions · 4 comments
- Feb 3, 2024[Task]: Reverse it component migration — apache/beam0 reactions · 1 comment
- Oct 27, 2023The project DataflowTemplates can't be parsed when opened by VSCode from WSL — redhat-developer/vscode-java0 reactions
- Aug 20, 2023Increase Elasticsearch wait time from 1 to 2 minutes, make it configurable — testcontainers/testcontainers-java0 reactions · 4 comments
- Jun 5, 2023[Bug]: Possible data loss in BigtableIO r/w if timestamp not set (default to epoch) — apache/beam0 reactions · 8 comments
- Jul 6, 2022Introduce support for RECORD type in TextIOToBigQuery template — chmurakrajowa/OChKDataflowTemplates0 reactions
- Jun 10, 2022Add OutputProject option to PubSubCDC etc. — 1st-penguin/DataflowTemplates0 reactions
In this repository11 other files it gives its agents.
- smt-functional-testingSkill
- add-integ-tests-datastream-to-spannerSkill
- add-source-datastream-to-spannerSkill
- add-integ-tests-gcs-spanner-dvSkill
- add-integ-tests-sourcedb-to-spannerSkill
- add-source-sourcedb-to-spannerSkill
- add-source-datatype-integ-testSkill
- add-source-functional-integ-testSkill
- meta-test-orchestratorSkill
- add-integ-tests-spanner-to-sourcedbSkill
- add-source-spanner-to-sourcedbSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 8 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 56
Fail-Fast Protocol: If any executed terminal command returns an error or non-zero exit code, STOP IMMEDIATELY.
- Distinctive: line 57
Data Privacy: Ensure no real PII, credentials, or production connection details are exposed in logs or command outputs.
- Very specific: line 72
Monitor Status: Wait for the job to reach a terminal state (Succeeded or Failed).
- Distinctive: line 86
Inspect Worker Logs: Check worker execution logs for specific exceptions or stack traces:
- Distinctive: line 122
Row Counts: Do source and destination row counts match?
- Distinctive: line 124
Value Assertions: Check NULL values, string encoding, timestamps, and precision.
- Distinctive: line 137
Clean Destination Table: Delete destination records to prepare for a clean run:
- Distinctive: line 147
Idempotency: Ensure clean test tables before re-running to avoid duplicate count errors.
- Distinctive: line 149
Terraform State: Avoid modifying resources manually outside of Terraform to prevent state drift.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill: Dataflow Template Logical Error Debugging
Trigger
/smt-e2e-dataflow-debugging <FILE_NAME>.tfvars
Scope
This skill is STRICTLY restricted to testing the following templates:
gcs-spanner-dvsourcedb-to-spannerdatastream-to-spannerspanner-to-sourcedb
Goal
To debug logical errors and data discrepancies by comparing source data (e.g., Cloud SQL) with destination data (e.g., Spanner).
Prerequisites
- The Dataflow job must be able to launch and run to a terminal state (Succeeded, Failed) using the provided
.tfvarsfile. This skill is NOT for debugging startup/runtime crashes. terraformCLI installed and configured.gcloudCLI installed and authenticated (gcloud auth login).mvn(Maven) and a compatible JDK installed.gitinstalled.- Access to the source database (e.g., Cloud SQL) instance, database, and credentials.
- Access to the destination Spanner instance and database.
- Appropriate IAM permissions for Dataflow, Cloud SQL, Spanner, GCS, and Cloud Logging.
- Database client tools installed (e.g.,
psql,mysqlclient, or willingness to usegcloud sql connect).
Variables
<FILE_NAME>.tfvars: The Terraform variables file.<YOUR_PROJECT_ID>: The target Google Cloud Project ID.<YOUR_REGION>: The Google Cloud region for the Dataflow job.<JOB_ID>: The Dataflow Job ID.<JOB_NAME>: The name of the Dataflow job.- Cloud SQL Connection Info (Extracted from .tfvars):
<CSQL_INSTANCE>: Cloud SQL instance name.<CSQL_DATABASE>: Cloud SQL database name.<CSQL_USER>: Cloud SQL username.<CSQL_PASSWORD>: Cloud SQL password (if applicable).<CSQL_PROJECT>: Project of the Cloud SQL instance.
- Spanner Connection Info (Extracted from .tfvars):
<SPANNER_INSTANCE>: Spanner instance name.<SPANNER_DATABASE>: Spanner database name.<SPANNER_PROJECT>: Project of the Spanner instance.
<MAVEN_MODULE_PATH>: The relative path to the template's maven module (e.g.v2/sourcedb-to-spanner).<TEMPLATE_NAME>: The name of the template.<YOUR_STAGING_BUCKET>: Cloud Storage bucket for staging.
Global Agent Rules
- Fail-Fast Protocol: If any executed terminal command returns an error or non-zero exit code, STOP IMMEDIATELY. Output the error to the user and ask for intervention. Do not attempt autonomous retries.
- Data Privacy: Ensure no real PII, credentials, or production connection details are exposed in logs or command outputs.
Workflow Phases
Phase 1: Deployment & Job Monitoring
- Deploy the Dataflow Job:
- Navigate to the directory containing
<FILE_NAME>.tfvars. - Initialize Terraform:
terraform init - Launch the job:
terraform apply --var-file=<FILE_NAME>.tfvars -auto-approve
- Navigate to the directory containing
- Monitor Status: Wait for the job to reach a terminal state (Succeeded or Failed). Monitor status via Google Cloud Console or
gcloud.
Phase 2: Log Collection & Initial Analysis
- Retrieve Job IDs: Infer
<JOB_ID>and<JOB_NAME>from the Terraform output or by listing active jobs:gcloud dataflow jobs list --project=<YOUR_PROJECT_ID> --region=<YOUR_REGION> - Inspect Job Logs: Retrieve job message logs to identify warnings or non-obvious issues:
gcloud logging read 'resource.type="dataflow_step" AND resource.labels.job_id="<JOB_ID>" AND logName=~"projects/.*/logs/dataflow.googleapis.com%2Fjob-message"' \ --project=<YOUR_PROJECT_ID> \ --limit=200 \ --format="table(timestamp, textPayload, severity)" --order=asc - Inspect Worker Logs: Check worker execution logs for specific exceptions or stack traces:
gcloud logging read 'resource.type="dataflow_step" AND logName=~"projects/.*/logs/dataflow.googleapis.com%2Fworker" AND resource.labels.job_id="<JOB_ID>"' \ --project=<YOUR_PROJECT_ID> \ --limit=500 \ --format="table(timestamp, jsonPayload.message, severity)" --order=asc
Phase 3: Data Inspection & Validation
- Inspect Source Data (Cloud SQL): Connect to the Cloud SQL instance and query source tables:
Execute validation queries:# For PostgreSQL gcloud sql connect <CSQL_INSTANCE> --user=<CSQL_USER> --project=<CSQL_PROJECT> # For MySQL gcloud sql connect <CSQL_INSTANCE> --user=<CSQL_USER> --project=<CSQL_PROJECT>SELECT COUNT(*) FROM your_source_table; SELECT * FROM your_source_table LIMIT 10; - Inspect Destination Data (Spanner): Execute SQL queries on the destination Spanner database:
gcloud spanner databases execute-sql <SPANNER_DATABASE> \ --instance=<SPANNER_INSTANCE> \ --project=<SPANNER_PROJECT> \ --sql="SELECT COUNT(*) FROM your_destination_table" gcloud spanner databases execute-sql <SPANNER_DATABASE> \ --instance=<SPANNER_INSTANCE> \ --project=<SPANNER_PROJECT> \ --sql="SELECT * FROM your_destination_table LIMIT 10"
Phase 4: Discrepancy Verification & Resolution
- Analyze Differences:
- Row Counts: Do source and destination row counts match?
- Schema Mapping: Are column types and names mapped correctly?
- Value Assertions: Check NULL values, string encoding, timestamps, and precision.
- Code Correction: Locate the transformation logic in the
.javafiles under theGoogleCloudPlatform/DataflowTemplatesrepository and fix the bug. - Re-stage Template: Rebuild and upload the updated Flex Template:
mvn clean package -PtemplatesStage -DskipTests \ -DprojectId="<YOUR_PROJECT_ID>" \ -DbucketName="<YOUR_STAGING_BUCKET>" \ -DstagePrefix="templates" \ -DtemplateName="<TEMPLATE_NAME>" \ -pl <MAVEN_MODULE_PATH> -am
Phase 5: Re-testing & Iteration
- Clean Destination Table: Delete destination records to prepare for a clean run:
gcloud spanner databases execute-sql <SPANNER_DATABASE> \ --instance=<SPANNER_INSTANCE> \ --project=<SPANNER_PROJECT> \ --sql="DELETE FROM your_destination_table WHERE true" - Re-run Job: Deploy the job again with the newly built template (Phase 1) and verify the fix.
Important Considerations
- Idempotency: Ensure clean test tables before re-running to avoid duplicate count errors.
- Data Volume: Limit queries to subsets when working with large volumes.
- Terraform State: Avoid modifying resources manually outside of Terraform to prevent state drift.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

