How to use Gemini to repair Cloud Run data access
Gemini CLI read Cloud Run logs, diagnosed Firestore 403 errors and edited Terraform permissions; Lester applied the change and restored the portfolio’s data.
Suggested prompt
Suggested prompt written by Agents In Use, not the source author. Replace bracketed inputs and review tool permissions first.
Diagnose why this Cloud Run service cannot read its Firestore data. Inspect deployment logs through the authorized gcloud tools, identify the service account and compare required access with Terraform. Propose the smallest role change with evidence, then pause before infrastructure apply and verify the actual data path afterward.
Reach people exploring AI agents
See placements →What happened
The owner reports restored Firestore access after Gemini diagnosed logs and edited Terraform, followed by a human-run apply; the portfolio remained subject to disclosed cold starts.
Reported by Darren "Dazbo" Lester — DEV CommunityHow the agent did it
- Lester deployed the portfolio and observed that the service could not display Firestore content.
- Gemini CLI read Cloud Run logs through gcloud MCP, identified 403 errors and updated the Terraform service-account roles.
- The owner ran Terraform apply and reports that access was restored, with tests and human checkpoints in the wider build.
Where a person stepped in
Lester supplied architecture requirements, suspected the permission issue and personally applied the Terraform change; runtime tests remained separate from automated PR review.
Darren Lester built and deployed a portfolio application with Gemini CLI, Conductor and other Google tools. One concrete failure appeared only after deployment: the Cloud Run service loaded, but information stored in Firestore was missing.
Lester suspected an omitted service-account permission. Rather than applying the change immediately himself, he asked Gemini CLI to diagnose the problem with its gcloud MCP extension. The agent read the service’s logs, detected HTTP 403 errors and added roles/datastore.user to the Terraform variable defining application service-account roles. Lester then ran the Terraform apply, which he reports resolved access.
The wider build used persisted Conductor plans, tests and human verification checkpoints. Gemini Code Assist reviewed pull requests, but a separate integration-test failure still caught an outdated API endpoint after a review found no additional issues. That distinction prevents code review from being presented as complete runtime verification.
The result was a working Cloud Run portfolio with an evidence-backed IAM repair. The owner supplied product and architecture requirements, understood the probable cause and retained the infrastructure apply. The article also discloses cold starts because minimum instances were zero. It does not establish that this role is the right permission for every application or that its deployment choices are universally appropriate.
Prompt
Suggested prompt (written by Agents In Use, not the author's)
Source: DEV Community · Darren "Dazbo" Lester
Frequently asked questions
How did Gemini find the access failure?
It used gcloud MCP to read Cloud Run logs and detected HTTP 403 responses.
Who applied the infrastructure change?
Lester ran Terraform apply after Gemini edited the service-account role variable.
Did a clean code review replace runtime testing?
No. A later integration test caught an outdated endpoint despite a review reporting no further issues.
More details
About this account
Lester deployed the portfolio and observed that the service could not display Firestore content. Gemini CLI read Cloud Run logs through gcloud MCP, identified 403 errors and updated the Terraform service-account roles.
Primary article and publication datetime opened. Gemini CLI’s log diagnosis and Terraform edit are explicit; the apply stayed human. This source also covers the broader portfolio build, retained as one case. Suggested prompt written by Agents In Use; no original task prompt was found in the verified text.
Credit: Darren "Dazbo" Lester — DEV Community
Source published 25 Jan 2026
Source checked 14 Oct 2026
Tools and topics
Gemini CLI · Conductor · gcloud MCP · Terraform · Cloud Run · Firestore
deployment diagnosis · IAM repair · human apply
Editorial completeness: 100/100. Measures documented fields, not agent performance or verified outcomes.