gemini-cli - 💡(How to fix) Fix Keychain initialization encountered an error [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
google-gemini/gemini-cli#25084Fetched 2026-04-10 03:44:45
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Error Message

Debug Console (F12 to close) │ │ │ │ ℹ Keychain initialization encountered an error: Cannot find module '../build/Release/keytar.node' │ │ Require stack: │ │ - /opt/homebrew/Cellar/gemini-cli/0.37.1/libexec/lib/node_modules/@google/gemini-cli/node_modules/keytar/lib/keytar.js │ │ │ │ ℹ Using FileKeychain fallback for secure storage. │ │ │ │ ℹ Loaded cached credentials. │ │ │ │ ℹ Detected terminal background color: #212734 │ │ │ │ ⚠ [STARTUP] Phase 'load_builtin_commands' was started but never ended. Skipping metrics. │ │ ℹ Authenticated via "oauth-personal". │ │ ℹ │ │ ✖ ========================================= │ │ This is an unexpected error. Please file a bug report using the /bug tool. │ │ CRITICAL: Unhandled Promise Rejection! │ │ ========================================= │ │ Reason: RangeError: Maximum call stack size exceeded │ │ Stack trace: │ │ RangeError: Maximum call stack size exceeded │ │ at handleAtCommand (file:///opt/homebrew/Cellar/gemini-cli/0.37.1/libexec/lib/node_modules/@google/gemini-cli/bundle/chunk-MODIYMRW.js:74433:25) │ │ at async file:///opt/homebrew/Cellar/gemini-cli/0.37.1/libexec/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-25PTL36A.js:43737:35 │ │ at async file:///opt/homebrew/Cellar/gemini-cli/0.37.1/libexec/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-25PTL36A.js:44224:50 │ │ at async file:///opt/homebrew/Cellar/gemini-cli/0.37.1/libexec/lib/node_modules/@google/gemini-cli/bundle/chunk-2P3YD5SP.js:254636:23

Code Example

Debug Console (F12 to close)│                                                                                                                                                         │
│ ℹ  Keychain initialization encountered an error: Cannot find module '../build/Release/keytar.node'Require stack:- /opt/homebrew/Cellar/gemini-cli/0.37.1/libexec/lib/node_modules/@google/gemini-cli/node_modules/keytar/lib/keytar.js│                                                                                                                                                         │
│ ℹ  Using FileKeychain fallback for secure storage.                                                                                                      
│                                                                                                                                                         │
│ ℹ  Loaded cached credentials.                                                                                                                           
│                                                                                                                                                         │
│ ℹ  Detected terminal background color: #212734│                                                                                                                                                         │
│ ⚠  [STARTUP] Phase 'load_builtin_commands' was started but never ended. Skipping metrics.                                                               
│ ℹ  Authenticated via "oauth-personal".                                                                                                                  
│ ℹ                                                                                                                                                       │
│ ✖  =========================================This is an unexpected error. Please file a bug report using the /bug tool.                                                                           
CRITICAL: Unhandled Promise Rejection!=========================================Reason: RangeError: Maximum call stack size exceeded                                                                                                 │
Stack trace:RangeError: Maximum call stack size exceeded                                                                                                         │
│        at handleAtCommand (file:///opt/homebrew/Cellar/gemini-cli/0.37.1/libexec/lib/node_modules/@google/gemini-cli/bundle/chunk-MODIYMRW.js:74433:25) │
│        at async file:///opt/homebrew/Cellar/gemini-cli/0.37.1/libexec/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-25PTL36A.js:43737:35    │
│        at async file:///opt/homebrew/Cellar/gemini-cli/0.37.1/libexec/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-25PTL36A.js:44224:50    │
│        at async file:///opt/homebrew/Cellar/gemini-cli/0.37.1/libexec/lib/node_modules/@google/gemini-cli/bundle/chunk-2P3YD5SP.js:254636:23
RAW_BUFFERClick to expand / collapse

What happened?

I send a prompt and then fail

Debug Console (F12 to close)                                                                                                                            │
│                                                                                                                                                         │
│ ℹ  Keychain initialization encountered an error: Cannot find module '../build/Release/keytar.node'                                                      │
│    Require stack:                                                                                                                                       │
│    - /opt/homebrew/Cellar/gemini-cli/0.37.1/libexec/lib/node_modules/@google/gemini-cli/node_modules/keytar/lib/keytar.js                               │
│                                                                                                                                                         │
│ ℹ  Using FileKeychain fallback for secure storage.                                                                                                      │
│                                                                                                                                                         │
│ ℹ  Loaded cached credentials.                                                                                                                           │
│                                                                                                                                                         │
│ ℹ  Detected terminal background color: #212734                                                                                                          │
│                                                                                                                                                         │
│ ⚠  [STARTUP] Phase 'load_builtin_commands' was started but never ended. Skipping metrics.                                                               │
│ ℹ  Authenticated via "oauth-personal".                                                                                                                  │
│ ℹ                                                                                                                                                       │
│ ✖  =========================================                                                                                                            │
│    This is an unexpected error. Please file a bug report using the /bug tool.                                                                           │
│    CRITICAL: Unhandled Promise Rejection!                                                                                                               │
│    =========================================                                                                                                            │
│    Reason: RangeError: Maximum call stack size exceeded                                                                                                 │
│    Stack trace:                                                                                                                                         │
│    RangeError: Maximum call stack size exceeded                                                                                                         │
│        at handleAtCommand (file:///opt/homebrew/Cellar/gemini-cli/0.37.1/libexec/lib/node_modules/@google/gemini-cli/bundle/chunk-MODIYMRW.js:74433:25) │
│        at async file:///opt/homebrew/Cellar/gemini-cli/0.37.1/libexec/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-25PTL36A.js:43737:35    │
│        at async file:///opt/homebrew/Cellar/gemini-cli/0.37.1/libexec/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-25PTL36A.js:44224:50    │
│        at async file:///opt/homebrew/Cellar/gemini-cli/0.37.1/libexec/lib/node_modules/@google/gemini-cli/bundle/chunk-2P3YD5SP.js:254636:23

What did you expect to happen?

valid response about my prompt

Client information

  • CLI Version: 0.37.1
  • Git Commit: 3b2d4f100
  • Session ID: 463e5cc9-5a84-48d0-96af-2b9e0640d869
  • Operating System: darwin v24.12.0
  • Sandbox Environment: no sandbox
  • Model Version: auto-gemini-3
  • Auth Type: oauth-personal
  • Memory Usage: 2.22 GB
  • Terminal Name: Unknown
  • Terminal Background: #212734
  • Kitty Keyboard Protocol: Unsupported

Login information

Google account

Anything else we need to know?

No response

extent analysis

TL;DR

The issue is likely caused by a maximum call stack size exceeded error, which may be related to the handleAtCommand function, and a workaround could be to update the CLI version or modify the code to handle recursive calls.

Guidance

  • Verify the error by checking the stack trace and identifying the recursive function call that is causing the maximum call stack size exceeded error.
  • Check if there are any known issues or fixes in newer versions of the CLI, as the current version is 0.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING