{"data":{"slug":"github-google-skills-skills-cloud-gke-ai-troubleshooting-tpu-vbar-oom-4346268021a5","title":"TPU Connection Failure and VBAR OOM Troubleshooting","summary":"Diagnose and prevent vbar_control_agent segfaults and OOM errors on TPU v6e nodes in GKE by analyzing serial console logs and checking for custom metrics collection conflicts.","url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-gke-ai-troubleshooting-tpu-vbar-oom-4346268021a5","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-google-skills-skills-cloud-gke-ai-troubleshooting-tpu-vbar-oom-4346268021a5","markdown_url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-gke-ai-troubleshooting-tpu-vbar-oom-4346268021a5.md","download_url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-gke-ai-troubleshooting-tpu-vbar-oom-4346268021a5\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before executing any `gcloud`, REST API, or MCP command, you MUST read [Usage Attribution](references\/attribution.md). For terminal commands, prefix `gcloud` with `CLOUDSDK_METRICS_REQUEST_ATTRIBUTION=\"agent-skills\/1.0 (skill:gke-ai-troubleshooting-tpu-vbar-oom)\"` and append `agent-skills\/1.0 (skill:gke-ai-troubleshooting-tpu-vbar-oom)` to `User-Agent` headers.","instructions":"---\nname: gke-ai-troubleshooting-tpu-vbar-oom\ndescription: >-\n  Diagnoses and prevents vbar_control_agent segfaults, out-of-memory (OOM) errors,\n  and TPU device initialization failures on TPU v6e nodes in GKE caused by race\n  conditions during TPU device resets or high-frequency metrics polling. Use when\n  troubleshooting vbar_control_agent crashes, memory cgroup OOMs in serial console\n  logs, tpu-device-plugin metrics checksum corruption errors, or custom TPU metrics\n  collection conflicts on GKE TPU v6e nodes. Don't use for general non-TPU container\n  OOM troubleshooting or standard GKE node lifecycle operations.\nmetadata:\n  version: \"1.0.1\"\n  category: CloudObservabilityAndMonitoring\n---\n\n# TPU Connection Failure and VBAR OOM Troubleshooting\n\nUse this skill to systematically diagnose and prevent `vbar_control_agent`\nsegfaults and Out-Of-Memory (OOM) errors on TPU v6e nodes.\n\n## Attribution\n\n**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you\nMUST read [Usage Attribution](references\/attribution.md). For commands executed\ndirectly in the terminal (never in generated scripts, Terraform, or user code),\nprefix `gcloud` with\n`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION=\"agent-skills\/1.0 (skill:gke-ai-troubleshooting-tpu-vbar-oom)\"`\nand append `agent-skills\/1.0 (skill:gke-ai-troubleshooting-tpu-vbar-oom)` to `User-Agent` headers.\n\n## \u26a0\ufe0f Prerequisites\n\n-   Cloud Logging must be enabled for the project.\n-   Access to the project and cluster via `gcloud` or equivalent tool.\n\n## \ud83d\udd0d Diagnostic Workflow\n\n### Step 0: Context Acquisition & Time Window Definition\n\nIndependently gather required context using available GCP\/GKE tools or use the\nprovided `{variable}` placeholders:\n\n-   `{project_id}`: The GCP Project ID (e.g., `customer-ai-project-123`).\n-   `{cluster_name}`: The GKE Cluster Name (e.g., `tpu-cluster-prod`).\n-   `{node_name}`: The Node Name or Instance ID (e.g., `tpu-node-1`).\n-   `{workload_name}`: The Workload Name \/ JobSet Name (e.g.,\n    `my-training-job-456`).\n-   `{namespace}`: The Workload Namespace.\n-   `{issue_time}`: The timestamp of the issue (e.g., `2026-04-14T20:00:00Z`).\n\n#### Time Handling & Execution Rules\n\n1.  **Window Calculation**: If an issue timestamp `{issue_time}` is provided,\n    calculate the query time window as `[{issue_time} - 30m]` to\n    `[{issue_time} + 30m]`.\n    -   Let `{start_time}` = `{issue_time} - 30m`\n    -   Let `{end_time}` = `{issue_time} + 30m`\n2.  **Informational vs. Live Execution**: If the user request is informational\n    or query-formulation (e.g. \"How can I check...\", \"How do I determine...\"),\n    or if live GCP project resources are not actively targetable, directly\n    output the calculated time window, log names, and Cloud Logging filter\n    templates without attempting live log execution commands.\n\n### Step 1: Check for `vbar_control_agent` OOMs\n\nLook for specific `out of memory` messages from `vbar_control_agent` in serial\nconsole logs (`serialconsole.googleapis.com%2fserial_port_1_output`).\n\n-   **Tool to use**: `query_logs` (for live diagnostics)\n-   **Filter Templates**:\n\n**Serial Console Logs (OOMs):**\n\n```sql\nlogName=\"projects\/{project_id}\/logs\/serialconsole.googleapis.com%2fserial_port_1_output\"\nAND labels.\"compute.googleapis.com\/resource_name\"=\"{node_name}\"\nAND SEARCH(text_payload, \"Memory cgroup out of memory: Killed process .* (vbar_control_ag)\")\nAND timestamp >= \"{start_time}\"\nAND timestamp <= \"{end_time}\"\n```\n\n-   **Logic**: Presence of `Memory cgroup out of memory` messages related to\n    `vbar_control_agent`. Stack traces pointing to\n    `libtpu::tpunetd::VBARControlHelper::MetricsReadFromVBAR` are a strong\n    indicator.\n-   **Automation**: Proceed to next step automatically after reporting findings.\n-   **Reference**: See `references\/failure_signatures.md` for example log\n    patterns.\n\n### Step 2: Investigate `tpu-device-plugin` Metrics Fetch Failures [Low Risk]\n\nCheck if `tpu-device-plugin` is reporting metric fetch failures.\n\n-   **Tool to use**: `query_logs`\n-   **Filter Template**:\n\n```sql\nresource.type=\"k8s_container\"\nAND resource.labels.project_id=\"{project_id}\"\nAND resource.labels.cluster_name=\"{cluster_name}\"\nAND resource.labels.container_name=\"tpu-device-plugin\"\nAND severity=ERROR\nAND textPayload:\"metrics fetch failed for .* deviceID and .* device path with error: checksum didn't match with the metrics data. Corrupt data found\"\nAND timestamp >= \"{start_time}\"\nAND timestamp <= \"{end_time}\"\n```\n\n-   **Logic**: Errors indicating \"metrics fetch failed\" with \"checksum didn't\n    match\" suggest vBAR memory corruption.\n-   **Automation**: Proceed to next step automatically after reporting findings.\n\n### Step 3: Check for Custom Metrics Collection Usage [Low Risk]\n\nInspect cluster configurations, workloads, or container specs to determine if\ncustom TPU metrics collection mechanisms are deployed.\n\n-   **Action**: Check if custom scripts or agents (e.g., using\n    `libtpu.sdk.tpumonitoring`) are deployed that frequently query\n    `GetHostMetrics` from `vBAR Control Agent`.\n-   **Verification Commands**:\n\n    -   **Kubectl Search (Inspect workload env\/specs)**:\n\n    ```bash\n    kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}{\"\/\"}{.metadata.name}{\"\\t\"}{.spec.containers[*].image}{\"\\n\"}{end}'\n    ```\n\n    -   **Log Search Filter (`query_logs`)**:\n\n    ```sql\n    resource.type=\"k8s_container\"\n    AND resource.labels.project_id=\"{project_id}\"\n    AND resource.labels.cluster_name=\"{cluster_name}\"\n    AND textPayload:\"libtpu.sdk.tpumonitoring\"\n    AND timestamp >= \"{start_time}\"\n    AND timestamp <= \"{end_time}\"\n    ```\n\n-   **Logic**: Confirmation of custom metrics collection helps confirm the race\n    condition hypothesis.\n\n## \ud83d\udee0\ufe0f Resolution Workflow\n\n### Resolution 1: Temporarily Disable Custom Metrics Collection [High Risk]\n\nIf a custom metrics collection agent is identified, recommend disabling it.\n\n-   **Action**: Recommend disabling the custom metrics collector.\n-   **Justification**: Prevents reads from vBAR during device resets, stopping\n    crashes and OOMs.\n\n### Resolution 2: Await `vbar_control_agent` Resiliency Update [Low Risk]\n\nAdvise that a permanent fix will be available in a future GKE version.\n\n-   **Action**: Recommend upgrading GKE when the fix is available.\n-   **Justification**: The updated agent will be resilient to memory corruption\n    and gracefully handle reads from unbound vBARs.\n\n## \ud83d\udccb copypaste checklist\n\n-   [ ] Acquire context and compute `[{start_time}, {end_time}]` window.\n-   [ ] Check for `vbar_control_agent` segfaults and OOMs using `query_logs`.\n-   [ ] Investigate `tpu-device-plugin` failures using `query_logs`.\n-   [ ] Inspect for custom metrics collection usage.\n-   [ ] Advise disabling custom metrics collection if applicable.\n-   [ ] Advise awaiting resiliency update.\n","use_cases":["Troubleshoot vbar_control_agent segfaults during TPU device resets","Investigate OOM errors in serial console logs for TPU v6e nodes","Detect and resolve tpu-device-plugin metrics fetch failures"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/google\/skills\/blob\/e3c591afe426ea585e4c21799e5199d6d47cd1be\/skills\/cloud\/gke-ai-troubleshooting-tpu-vbar-oom\/SKILL.md","source_commit":"e3c591afe426ea585e4c21799e5199d6d47cd1be","license":null,"version":null,"listing_approved_at":"2026-11-17","created_at":"2026-11-16T15:24:59.000000Z","updated_at":"2026-11-17T10:20:00.000000Z","seo_title":"TPU VBAR OOM Troubleshooting Guide","seo_description":"Diagnose and resolve vbar_control_agent segfaults and OOM errors on GKE TPU v6e nodes with step-by-step guidance.","seo_keywords":["TPU OOM troubleshooting","vbar_control_agent segfault diagnosis","GKE TPU v6e node issues","tpu-device-plugin metrics errors","Cloud Logging TPU diagnostics"]}}