Google cloud filestore log troubleshooting

From vaila-multimodaltoolbox/vaila · View interactive version

Google cloud filestore log troubleshooting is an AI agent skill from the GitHub repository vaila-multimodaltoolbox/vaila. Diagnoses and resolves Google Cloud Filestore client mount failures, permission errors (EACCES), and network timeouts (ETIMEDOUT). Use when an NFS mount hangs or fails from a Compute Engine VM, GKE pod, Cloud Run service, or Vertex AI workload, when `mount.nfs` reports "Connection timed out" or "acc

How to use this skill

Skill file

<!-- disableFinding(LINE_OVER_80) -->

Google Cloud Filestore Log-Based Troubleshooting

Diagnoses, troubleshoots, and remediates Google Cloud Filestore client mount failures, permission errors (EACCES), and network timeouts (ETIMEDOUT) across projects.

Prerequisites & Quick Start

Required IAM roles on target project(s) (and Shared VPC host project if applicable):

Authenticate, verify billing/APIs, and configure your environment:

gcloud auth login && gcloud auth application-default login
gcloud billing projects describe {project_id} --format="value(billingEnabled)"
gcloud services enable file.googleapis.com compute.googleapis.com logging.googleapis.com --quiet
gcloud config set project {project_id} && gcloud config set compute/region {region}

Attribution

Prefix every gcloud command provided or executed with the skill metrics environment:

CLOUDSDK_METRICS_ENVIRONMENT="gcs-skills gcs-skills/1.0 (skill:google-cloud-filestore-log-troubleshooting)" \
gcloud filestore instances describe ...

On direct REST API calls, append HTTP header: User-Agent: gcs-skills/1.0 (skill:google-cloud-filestore-log-troubleshooting).

Conceptual & Informational Queries (CRITICAL)

For purely conceptual, architectural, or educational questions (e.g., "What causes EACCES on Filestore?", "Why does GKE Node IP appear instead of Pod IP?", "What ports does Filestore require?", "Explain root squash"):

Handling "No-Command" Constraints (CRITICAL)

If the user prompt contains constraints like "Do not execute commands", "without executing", or "read-only":

1. First, check if Filestore MCP tools (get_instance, list_instances) are available and use them (API calls, not command executions).

2. If MCP tools are unavailable, read references/mock-fleet-data.md only if the requested instance matches one of the evaluation scenarios (finance-share, shared-nfs, ml-data, data-hub, prod-share). Never report mock data as live production state. If the instance is not listed there, state that live access is required and provide the exact commands for the user to run.

3. Fast-Path Stop Rule: Once you locate the target instance in references/mock-fleet-data.md, stop reading additional files immediately and formulate your response. Do NOT read scripts/quick_diagnose.py, scripts/diagnose_lib.py, _internal/quick_diagnose_test.py, or EVAL.* files when command execution is disabled, as inspecting code/test files wastes turns and triggers timeouts.

4. Explain the required diagnostic steps and output the exact attributed commands for manual execution.

Multi-Runtime Execution Options

Option 1: Bundled Python CLI Script (Recommended for CLI / Terminal Agents)

# Single instance diagnosis
python3 scripts/quick_diagnose.py --instance="<INSTANCE_ID>" --location="<LOCATION_OR_ZONE>" \
    [--project="<PROJECT_ID>"] [--client-ip="<CLIENT_IP>"] [--client-subnet="<CLIENT_SUBNET_CIDR>"]

# Bulk project-wide fleet diagnosis
python3 scripts/quick_diagnose.py --all --project="<PROJECT_ID>" [--json]

| Flag | Purpose |

| :--- | :--- |

| --instance, --location | Filestore instance ID and region/zone (--zone is a legacy alias). Required unless --all. |

| --project | GCP project ID (defaults to active gcloud project). |

| --client-ip / --client-subnet | Client IP or CIDR to evaluate against export ACLs and ingress firewall rules. |

| --json | Emit machine-readable JSON on stdout (narrative report goes to stderr). |

| --apply-fix | Execute generated remediation commands. Only pass after explicit user confirmation. |

Option 2: Filestore MCP Tools / REST API / `gcloud` CLI

```bash

CLOUDSDK_METRICS_ENVIRONMENT="gcs-skills gcs-skills/1.0 (skill:google-cloud-filestore-log-troubleshooting)" \

gcloud filestore instances describe {instance_id} --location={location} --project={project_id} --format=json

```


Core Operational Workflow

Step 1: Parameter Extraction & GKE Node Architecture

Step 2: Instance Metadata & Shared VPC Resolution

  1. Verify instance state is READY (report state blocker if CREATING, DELETING, or ERROR).
  2. Extract primary Filestore IP (networks[0].ipAddresses[0]) and VPC network URI.
  3. If networks[0].network references projects/{host_project}/global/networks/{network}, resolve {host_project} as the Shared VPC host project for firewall queries.

Step 3: Export ACL Evaluation (`EACCES` vs `EROFS`)

  1. Inspect fileShares[0].nfsExportOptions (if empty, default 0.0.0.0/0 READ_WRITE NO_ROOT_SQUASH applies).
  2. EACCES (Permission Denied by Server): Triggered when the client IP or subnet CIDR is not covered by any ipRanges entry.
  1. EROFS (Read-only file system): Triggered when accessMode is READ_ONLY but client writes are attempted.

Step 4: VPC Ingress Firewall Inspection (`ETIMEDOUT`)

  1. Query ingress firewall rules in the VPC network (in the host project if Shared VPC).
  2. ETIMEDOUT (Connection Timed Out): Triggered when priority-sorted ingress rules block or fail to allow TCP port 2049 (NFS) and TCP/UDP port 111 (rpcbind) from the client CIDR.

Step 5: Cloud Audit Logs & Configuration Drift Scanning

Query Cloud Audit Admin Activity logs (file.googleapis.com) over the past 24 hours to check if an UpdateInstance operation modified export ACLs or networks:

CLOUDSDK_METRICS_ENVIRONMENT="gcs-skills gcs-skills/1.0 (skill:google-cloud-filestore-log-troubleshooting)" \
gcloud logging read 'logName="projects/{project_id}/logs/cloudaudit.googleapis.com%2Factivity" AND protoPayload.serviceName="file.googleapis.com" AND protoPayload.resourceName=~".*{instance}.*"' \
    --project="{project_id}" --freshness="1d" --limit=5 --format="json"

Output Format & Mandatory Confirmation Gate

Every diagnostic report MUST include a structured summary table and root cause analysis:

### Filestore Diagnostic Report: `[instance-name]`

| Parameter | Value |
| :--- | :--- |
| **Instance ID** | `[instance-name]` (`[location]`, Tier: `[tier]`, State: `READY`) |
| **Filestore IP & Network** | `[filestore-ip]` on VPC `[network-name]` (Host Project: `[host-project]`) |
| **Port 2049 & Export ACL** | Port 2049: `OPEN / BLOCKED` \| Export ACL: `PASS / REJECTED` |
| **Diagnostic Verdict** | **HEALTHY** or **BLOCKED: [Root Cause]** |

#### Root Cause Analysis & Recommended Remediation
- [Explanation of ETIMEDOUT (missing firewall rule on port 2049) vs EACCES (missing export ACL rule) and any recent UpdateInstance audit drift]

CLOUDSDK_METRICS_ENVIRONMENT="gcs-skills gcs-skills/1.0 (skill:google-cloud-filestore-log-troubleshooting)" \

gcloud compute firewall-rules create ...

Interactive Remediation Confirmation Gate (MANDATORY)

> "Would you like me to proceed with executing this remediation command for you? Please confirm to proceed."

References & Bundled Scripts

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.