Skip to content

Spanner "Connection Closed" – env variables recognized but connection fails #2136

@ishatilwani1301

Description

@ishatilwani1301

Prerequisites

  • I've searched the current open issues
  • I've updated to the latest version of Toolbox

Toolbox version

0.22.0

Environment

No response

Client

Expected Behavior

When Spanner environment variables are exported, the Gemini CLI extension for Spanner should initialize the connection successfully. It should allow querying the database (e.g., "list tables") without dropping the connection.

Current Behavior

When the Spanner extension is enabled (either alone or with others):

  1. The CLI reports "Connection closed" for the Spanner database immediately.
  2. Despite this error, if I issue a prompt (e.g., "list tables"), the tool attempts to debug by running an echo command to check environment variables.
  3. The tool successfully reads and displays the correctly exported variables (via the echo check), proving the environment is set up correctly.
  4. However, the actual database connection remains failed, and it does not return the table list.

Testing Metrics:
Spanner Only: Connection closed (Variables verified via echo)
Spanner + AlloyDB + Cloud SQL: Connection closed (Variables verified via echo)

Image Image

Steps to reproduce?

  1. Export valid Spanner environment variables.
  2. Start the Gemini CLI with the Spanner extension enabled.
  3. Observe the immediate "Connection closed" error for Spanner.
  4. Attempt a command like "List tables".
  5. Observe that the tool runs a check (echoing variables) which succeeds, confirming variables are present, yet the connection error persists.

Additional Details

No response

Metadata

Metadata

Labels

priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions