Skip to content

Gemini CLI Failed: API proxy enabled but no API keys found in environment #23655

@doughgle

Description

@doughgle

Log evidence

[WARN] API proxy enabled but no API keys found in environment
Failed to save project registry: Error: ENOENT: no such file or directory, rename '.../projects.json.tmp' -> '.../projects.json'
Please set an Auth method in your settings.json or specify one of the following environment variables before running: GEMINI_API_KEY, GOOGLE_GENAI_USE_VERTEXAI, GOOGLE_GENAI_USE_GCA
[WARN] Command completed with exit code: 41
Process exiting with code: 41

Expected behaviour

  • The Gemini CLI invocation starts and either completes or fails with a clear, documented authentication or filesystem error (distinct, stable exit codes).
  • The CLI does not abort with an ENOENT during startup/initialization when invoked by the workflow.

Actual behaviour

  • The Gemini CLI fails while attempting to write its projects registry (rename returns ENOENT), then reports no authentication configured, and the process exits with code 41.
  • The run log reports the API proxy was enabled but no API keys were present in the environment.

Steps to reproduce (example failing workflow reference)

  • Observe the failing run for the hn-daily-digest workflow on the main branch for repository doughgle/agentic-workflows-workshop. The run invokes the Gemini CLI and exhibits the failure shown above.

Metadata / identifiers

(Only the failing run and repository references are included; local workstation paths and secrets are omitted.)

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions