Skip to main content
Watch: I Built an AI App Without Leaving Databricks

Gemini CLI error

Gemini CLI: Invalid Google Cloud Project ID: "<projectId>"

Error message
Invalid Google Cloud Project ID: "<projectId>". The GOOGLE_CLOUD_PROJECT (or GOOGLE_CLOUD_PROJECT_ID) environment variable must be set to your string-based Project ID (e.g., "my-project-123"), not your numeric Project Number. Please update your environment variables.

Status: By designLast verified 1 documented fix3 sources

What it means

GOOGLE_CLOUD_PROJECT is set to the numeric Project Number instead of the string Project ID, and the CLI rejects it before sign-in.

Causes

  • GOOGLE_CLOUD_PROJECT or GOOGLE_CLOUD_PROJECT_ID contains a numeric Project Number. The check was added in #26532, "fix(core): reject numeric project IDs in GOOGLE_CLOUD_PROJECT (#24695)".

How to fix it

  1. Fix 1.

    Set the variable to the string-based Project ID (for example "my-project-123"), as the error message says.

    Terminal
    export GOOGLE_CLOUD_PROJECT="my-project-123"

More Gemini CLI errors

All 19 Gemini CLI errors

FAQ

What does "Invalid Google Cloud Project ID: "<projectId>"" mean in Gemini CLI?

GOOGLE_CLOUD_PROJECT is set to the numeric Project Number instead of the string Project ID, and the CLI rejects it before sign-in.

How do I fix "Invalid Google Cloud Project ID: "<projectId>""?

Set the variable to the string-based Project ID (for example "my-project-123"), as the error message says.

Is this Gemini CLI error fixed?

Status: By design. Expected behavior, not a bug. The documented fixes change the setup that triggers it. Affected versions: v0.43.0 and later (validation added in #26532)

Sources

Last verified against 3 sources: official docs, maintainer replies and release notes.

Newsletter

Fixes for the tools you use, weekly

One email per week. New coding agent releases, what broke, and how developers are working around it.