gemini-cli - 💡(How to fix) Fix Unhandled ENAMETOOLONG Error When Processing JSON Data [1 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#25923Fetched 2026-04-25 06:22:19
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
labeled ×1

Error Message

Debug Console (F12 to close) │ │ │ │ │ │ ℹ Detected terminal background color: #212734 │ │ │ │ ℹ Loading extension: caveman │ │ ℹ Scheduling MCP context refresh... │ │ ℹ Executing MCP context refresh... │ │ ⚠ [STARTUP] Cannot start phase 'load_builtin_commands': phase is already active. Call end() before starting again. █│ │ ℹ MCP context refresh complete. █│ │ ℹ █│ │ ℹ Authenticated via "oauth-personal". █│ │ ✖ ========================================= █│ │ This is an unexpected error. Please file a bug report using the /bug tool. █│ │ CRITICAL: Unhandled Promise Rejection! █│ │ ========================================= █│ │ Reason: Error: ENAMETOOLONG: name too long, lstat '/Users/niladriadak/projects/pinggy/app/gmail.com", █│ │ "phone": "", █│ │ "avatar": "", █│ │ "email_verified": false, █│ │ "phone_verified": false, █│ │ "blacklisted": false, █│ │ "first_name": "Suraj", █│ │ "last_name": "Adak", █│ │ "created_at": "2026-01-08T23:49:22.817447+05:30"' █│ │ Stack trace: █│ │ Error: ENAMETOOLONG: name too long, lstat '/Users/niladriadak/projects/pinggy/app/gmail.com", █│ │ "phone": "", █│ │ "avatar": "", █│ │ "email_verified": false, █│ │ "phone_verified": false, █│ │ "blacklisted": false, █│ │ "first_name": "Suraj", █│ │ "last_name": "Adak", █│ │ "created_at": "2026-01-08T23:49:22.817447+05:30"' █│ │ at Module.realpathSync (node:fs:2760:29) █│ │ at robustRealpath (file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/chunk-ETUADTWF.js:41905:16) █│ │ at resolveToRealPath (file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/chunk-ETUADTWF.js:41896:10) █│ │ at checkPermissions (file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/chunk-AQRXALHQ.js:60877:30) █│ │ at file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-XAEPLVZH.js:48651:37 █│ │ at file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-XAEPLVZH.js:37035:7 █│ │ at Object.handleSubmit (file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-XAEPLVZH.js:34562:9) █│ │ at file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-XAEPLVZH.js:37084:20 █│ │ at file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-XAEPLVZH.js:37623:13 █│ │ at file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/chunk-AQRXALHQ.js:51170:15

Code Example

"user": {
            "id": "41cd1913-ec52-4301-b69b-ae0d70a3245f",
            "email": "[email protected]",
            "phone": "",
            "avatar": "",
            "email_verified": false,
            "phone_verified": false,
            "blacklisted": false,
            "first_name": "Suraj",
            "last_name": "Adak",
            "created_at": "2026-01-08T23:49:22.817447+05:30"
        }

---

Debug Console (F12 to close)│                                                                                                                                                                                                                                         │
│                                                                                                                                                                                                                                         │
│ ℹ  Detected terminal background color: #212734│                                                                                                                                                                                                                                         │
│ ℹ  Loading extension: caveman                                                                                                                                                                                                           │
│ ℹ  Scheduling MCP context refresh...│ ℹ  Executing MCP context refresh...│ ⚠  [STARTUP] Cannot start phase 'load_builtin_commands': phase is already active. Call end() before starting again.                                                                                                                    █│
│ ℹ  MCP context refresh complete.                                                                                                                                                                                                       █│
│ ℹ                                                                                                                                                                                                                                      █│
│ ℹ  Authenticated via "oauth-personal".                                                                                                                                                                                                 █│
│ ✖  =========================================                                                                                                                                                                                           █│
This is an unexpected error. Please file a bug report using the /bug tool.                                                                                                                                                          █│
CRITICAL: Unhandled Promise Rejection!                                                                                                                                                                                              █│
=========================================                                                                                                                                                                                           █│
Reason: Error: ENAMETOOLONG: name too long, lstat '/Users/niladriadak/projects/pinggy/app/gmail.com",                                                                                                                               █│
"phone": "",                                                                                                                                                                                                            █│
"avatar": "",                                                                                                                                                                                                           █│
"email_verified": false,                                                                                                                                                                                                █│
"phone_verified": false,                                                                                                                                                                                                █│
"blacklisted": false,                                                                                                                                                                                                   █│
"first_name": "Suraj",                                                                                                                                                                                                  █│
"last_name": "Adak",                                                                                                                                                                                                    █│
"created_at": "2026-01-08T23:49:22.817447+05:30"'                                                                                                                                                                       █│
Stack trace:                                                                                                                                                                                                                        █│
Error: ENAMETOOLONG: name too long, lstat '/Users/niladriadak/projects/pinggy/app/gmail.com",                                                                                                                                       █│
"phone": "",                                                                                                                                                                                                            █│
"avatar": "",                                                                                                                                                                                                           █│
"email_verified": false,                                                                                                                                                                                                █│
"phone_verified": false,                                                                                                                                                                                                █│
"blacklisted": false,                                                                                                                                                                                                   █│
"first_name": "Suraj",                                                                                                                                                                                                  █│
"last_name": "Adak",                                                                                                                                                                                                    █│
"created_at": "2026-01-08T23:49:22.817447+05:30"'                                                                                                                                                                       █│
│        at Module.realpathSync (node:fs:2760:29)                                                                                                                                                                                        █│
│        at robustRealpath (file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/chunk-ETUADTWF.js:41905:16)                                                                                 █│
│        at resolveToRealPath (file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/chunk-ETUADTWF.js:41896:10)                                                                              █│
│        at checkPermissions (file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/chunk-AQRXALHQ.js:60877:30)                                                                               █│
│        at file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-XAEPLVZH.js:48651:37                                                                                         █│
│        at file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-XAEPLVZH.js:37035:7                                                                                          █│
│        at Object.handleSubmit (file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-XAEPLVZH.js:34562:9)                                                                    █│
│        at file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-XAEPLVZH.js:37084:20                                                                                         █│
│        at file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-XAEPLVZH.js:37623:13                                                                                         █│
│        at file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/chunk-AQRXALHQ.js:51170:15
RAW_BUFFERClick to expand / collapse

What happened?

I just started the gemini cli and i submitted my api response to create a type in ts and others taks in frontend but with the api response it crashed. Here is the given input to the cli-

"user": {
            "id": "41cd1913-ec52-4301-b69b-ae0d70a3245f",
            "email": "[email protected]",
            "phone": "",
            "avatar": "",
            "email_verified": false,
            "phone_verified": false,
            "blacklisted": false,
            "first_name": "Suraj",
            "last_name": "Adak",
            "created_at": "2026-01-08T23:49:22.817447+05:30"
        }

Here the Gemini cli output-

 Debug Console (F12 to close)                                                                                                                                                                                                            │
│                                                                                                                                                                                                                                         │
│                                                                                                                                                                                                                                         │
│ ℹ  Detected terminal background color: #212734                                                                                                                                                                                          │
│                                                                                                                                                                                                                                         │
│ ℹ  Loading extension: caveman                                                                                                                                                                                                           │
│ ℹ  Scheduling MCP context refresh...                                                                                                                                                                                                    │
│ ℹ  Executing MCP context refresh...                                                                                                                                                                                                     │
│ ⚠  [STARTUP] Cannot start phase 'load_builtin_commands': phase is already active. Call end() before starting again.                                                                                                                    █│
│ ℹ  MCP context refresh complete.                                                                                                                                                                                                       █│
│ ℹ                                                                                                                                                                                                                                      █│
│ ℹ  Authenticated via "oauth-personal".                                                                                                                                                                                                 █│
│ ✖  =========================================                                                                                                                                                                                           █│
│    This is an unexpected error. Please file a bug report using the /bug tool.                                                                                                                                                          █│
│    CRITICAL: Unhandled Promise Rejection!                                                                                                                                                                                              █│
│    =========================================                                                                                                                                                                                           █│
│    Reason: Error: ENAMETOOLONG: name too long, lstat '/Users/niladriadak/projects/pinggy/app/gmail.com",                                                                                                                               █│
│                "phone": "",                                                                                                                                                                                                            █│
│                "avatar": "",                                                                                                                                                                                                           █│
│                "email_verified": false,                                                                                                                                                                                                █│
│                "phone_verified": false,                                                                                                                                                                                                █│
│                "blacklisted": false,                                                                                                                                                                                                   █│
│                "first_name": "Suraj",                                                                                                                                                                                                  █│
│                "last_name": "Adak",                                                                                                                                                                                                    █│
│                "created_at": "2026-01-08T23:49:22.817447+05:30"'                                                                                                                                                                       █│
│    Stack trace:                                                                                                                                                                                                                        █│
│    Error: ENAMETOOLONG: name too long, lstat '/Users/niladriadak/projects/pinggy/app/gmail.com",                                                                                                                                       █│
│                "phone": "",                                                                                                                                                                                                            █│
│                "avatar": "",                                                                                                                                                                                                           █│
│                "email_verified": false,                                                                                                                                                                                                █│
│                "phone_verified": false,                                                                                                                                                                                                █│
│                "blacklisted": false,                                                                                                                                                                                                   █│
│                "first_name": "Suraj",                                                                                                                                                                                                  █│
│                "last_name": "Adak",                                                                                                                                                                                                    █│
│                "created_at": "2026-01-08T23:49:22.817447+05:30"'                                                                                                                                                                       █│
│        at Module.realpathSync (node:fs:2760:29)                                                                                                                                                                                        █│
│        at robustRealpath (file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/chunk-ETUADTWF.js:41905:16)                                                                                 █│
│        at resolveToRealPath (file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/chunk-ETUADTWF.js:41896:10)                                                                              █│
│        at checkPermissions (file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/chunk-AQRXALHQ.js:60877:30)                                                                               █│
│        at file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-XAEPLVZH.js:48651:37                                                                                         █│
│        at file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-XAEPLVZH.js:37035:7                                                                                          █│
│        at Object.handleSubmit (file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-XAEPLVZH.js:34562:9)                                                                    █│
│        at file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-XAEPLVZH.js:37084:20                                                                                         █│
│        at file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/interactiveCli-XAEPLVZH.js:37623:13                                                                                         █│
│        at file:///opt/homebrew/Cellar/gemini-cli/0.38.2/libexec/lib/node_modules/@google/gemini-cli/bundle/chunk-AQRXALHQ.js:51170:15

[ACTION REQUIRED] 📎 PLEASE ATTACH THE EXPORTED CHAT HISTORY JSON FILE TO THIS ISSUE IF YOU FEEL COMFORTABLE SHARING IT.

What did you expect to happen?

It should normally perform the task I instructed it to do, but occasional issues can occur.

Client information

  • CLI Version: 0.38.2
  • Git Commit: b0ed611a0
  • Session ID: a83e3630-ab67-4ce8-80e9-f1795867cc30
  • Operating System: darwin v25.9.0
  • Sandbox Environment: no sandbox
  • Model Version: auto-gemini-3
  • Auth Type: oauth-personal
  • Memory Usage: 279.6 MB
  • Terminal Name: Unknown
  • Terminal Background: #212734
  • 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 the ENAMETOOLONG error, which occurs when the file path is too long, and can be resolved by shortening the file path or updating the Gemini CLI to handle longer file paths.

Guidance

  • The error message indicates that the issue is related to the file path being too long, specifically the path /Users/niladriadak/projects/pinggy/app/gmail.com.
  • The Gemini CLI is trying to access a file with a name that is too long, which is causing the ENAMETOOLONG error.
  • To resolve this issue, try shortening the file path or renaming the file to a shorter name.
  • Additionally, check the Gemini CLI documentation to see if there are any configuration options to increase the maximum allowed file path length.

Example

No code snippet is provided as the issue is related to the file path and not a specific code snippet.

Notes

The issue may be specific to the Gemini CLI version 0.38.2, and updating to a newer version may resolve the issue. However, without further information, it is difficult to determine the root cause of the issue.

Recommendation

Apply workaround: Shorten the file path or rename the file to a shorter name to resolve the ENAMETOOLONG error. This is a temporary solution until a more permanent fix can be found.

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

gemini-cli - 💡(How to fix) Fix Unhandled ENAMETOOLONG Error When Processing JSON Data [1 participants]