gemini-cli - 💡(How to fix) Fix Issue with /security:analyze [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#25503Fetched 2026-04-16 07:05:29
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

Error Message

│ This is an unexpected error. Please file a bug report using the /bug tool. │

RAW_BUFFERClick to expand / collapse

What happened?

Sorry but I'm not 100% sure what the actual bug is. I asked gemini to /security:analyze @file.html which contained automation scripts and I was attempting to get a review to see where the potential issues were. It "thought" about it for a few minutes and then the following messages appeared. It told me to log a bug using /bug and here I am :) Hope it help.

ℹ Scheduling MCP context refresh... │ │ ℹ Executing MCP context refresh... │ │ ℹ MCP context refresh complete. │ │ ℹ Registering notification handlers for server 'stitch'. Capabilities: { tools: { listChanged: false } } │ │ ℹ Server 'stitch' has tools but did not declare 'listChanged' capability. Listening anyway for robustness... │ │ ℹ Scheduling MCP context refresh... │ │ ℹ Executing MCP context refresh... │ │ ℹ MCP context refresh already in progress, queuing trailing execution. (x4) │ │ ℹ MCP context refresh complete. │ │ ℹ Coalescing burst refresh requests (300ms delay)... │ │ ℹ Executing MCP context refresh... │ │ ℹ MCP context refresh complete. │ │ ✖ ========================================= │ │ This is an unexpected error. Please file a bug report using the /bug tool. │ │ CRITICAL: Unhandled Promise Rejection! │ │ ========================================= │ │ Reason: RangeError: Invalid count value: -1 │ │ Stack trace: │ │ RangeError: Invalid count value: -1 │ │ at String.repeat (<anonymous>) │ │ at renderBorder (file:///home/user/.nvm/versions/node/v20.19.4/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37307:89) │ │ at handleContainerNode (file:///home/user/.nvm/versions/node/v20.19.4/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37360:5) │ │ at renderNodeToOutput (file:///home/user/.nvm/versions/node/v20.19.4/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37784:5) │ │ at handleContainerNode (file:///home/user/.nvm/versions/node/v20.19.4/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37469:9) │ │ at renderNodeToOutput (file:///home/user/.nvm/versions/node/v20.19.4/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37784:5) │ │ at handleContainerNode (file:///home/matt/.nvm/versions/node/v20.19.4/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37469:9) │ │ at renderNodeToOutput (file:///home/matt/.nvm/versions/node/v20.19.4/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37784:5) │ │ at handleContainerNode (file:///home/matt/.nvm/versions/node/v20.19.4/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37469:9) │ │ at renderNodeToOutput (file:///home/matt/.nvm/versions/node/v20.19.4/lib/node_modules/@google/gemini-cli/bundle/chunk-C3HWPYQ6.js:37784:5) │ │ (x17) │

What did you expect to happen?

The system to output a security analysis of the file I asked it to evaluate

Client information

  • CLI Version: 0.38.1
  • Git Commit: 7f5580034
  • Session ID: c44244fa-0df7-4567-8f98-6639c68bf554
  • Operating System: linux v20.19.4
  • Sandbox Environment: no sandbox
  • Model Version: auto-gemini-3
  • Auth Type: oauth-personal
  • Memory Usage: 272.5 MB
  • Terminal Name: VTE(7600)
  • Terminal Background: #000000
  • Kitty Keyboard Protocol: Unsupported

Login information

No response

Anything else we need to know?

No response

extent analysis

TL;DR

The issue is likely caused by an invalid count value in the String.repeat function, which is called during the rendering process, and a workaround may involve updating the gemini-cli package or reporting the bug to the developers.

Guidance

  • The error message indicates a RangeError: Invalid count value: -1 at the String.repeat function, which suggests that the issue is related to the rendering process.
  • The stack trace points to the renderBorder function in the @google/gemini-cli package, which may be the source of the problem.
  • To mitigate the issue, you can try updating the gemini-cli package to the latest version or reporting the bug to the developers with the provided stack trace and session ID.
  • Additionally, you can try running the command with a different file or input to see if the issue is specific to the current file.

Example

No code snippet is provided as the issue is related to a third-party package and the exact code change is not clear.

Notes

The issue may be specific to the current version of the gemini-cli package (0.38.1) or the Node.js version (v20.19.4), and updating or downgrading these versions may resolve the issue.

Recommendation

Apply workaround: Report the bug to the developers with the provided stack trace and session ID, as the issue is likely related to the @google/gemini-cli package and requires their attention.

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