gemini-cli - 💡(How to fix) Fix Unexpected error [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#26144Fetched 2026-04-29 06:35:27
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
labeled ×1mentioned ×1

Error Message

│ This is an unexpected error. Please file a bug report using the /bug tool. │ │ Reason: Error: ENAMETOOLONG: name too long, lstat '/Users/davepar/projects/gatherist/a/gatherist.iam.gserviceaccount.com" (or the resource may not exist). Error: 7 PERMISSION_DENIED: The principal (user or │ │ Error: ENAMETOOLONG: name too long, lstat '/Users/davepar/projects/gatherist/a/gatherist.iam.gserviceaccount.com" (or the resource may not exist). Error: 7 PERMISSION_DENIED: The principal (user or service │

RAW_BUFFERClick to expand / collapse

What happened?

========================================= │ │ 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/davepar/projects/gatherist/a/gatherist.iam.gserviceaccount.com" (or the resource may not exist). Error: 7 PERMISSION_DENIED: The principal (user or │ │ service account) lacks IAM permission "iam.serviceAccounts.actAs" for the resource "[email protected]" (or the resource may not exist). at callErrorFromStatus (' │ │ Stack trace: │ │ Error: ENAMETOOLONG: name too long, lstat '/Users/davepar/projects/gatherist/a/gatherist.iam.gserviceaccount.com" (or the resource may not exist). Error: 7 PERMISSION_DENIED: The principal (user or service │ │ account) lacks IAM permission "iam.serviceAccounts.actAs" for the resource "[email protected]" (or the resource may not exist). at callErrorFromStatus (' │ │ at Module.realpathSync (node:fs:2775:29) │ │ at robustRealpath (file:///Users/davepar/Library/pnpm/global/5/.pnpm/@[email protected]_express@5.2.1/node_modules/@google/gemini-cli-core/dist/src/utils/paths.js:320:19) │ │ at resolveToRealPath (file:///Users/davepar/Library/pnpm/global/5/.pnpm/@[email protected]_express@5.2.1/node_modules/@google/gemini-cli-core/dist/src/utils/paths.js:311:12) │ │ at checkPermissions (file:///Users/davepar/Library/pnpm/global/5/.pnpm/@[email protected]_express@5.2.1/node_modules/@google/gemini-cli/dist/src/ui/hooks/atCommandProcessor.js:89:34) │ │ at file:///Users/davepar/Library/pnpm/global/5/.pnpm/@[email protected]_express@5.2.1/node_modules/@google/gemini-cli/dist/src/ui/AppContainer.js:812:43 │ │ at file:///Users/davepar/Library/pnpm/global/5/.pnpm/@[email protected]_express@5.2.1/node_modules/@google/gemini-cli/dist/src/ui/components/InputPrompt.js:187:9 │ │ at Object.handleSubmit (file:///Users/davepar/Library/pnpm/global/5/.pnpm/@[email protected]_express@5.2.1/node_modules/@google/gemini-cli/dist/src/ui/hooks/useInputHistory.js:24:13) │ │ at file:///Users/davepar/Library/pnpm/global/5/.pnpm/@[email protected]_express@5.2.1/node_modules/@google/gemini-cli/dist/src/ui/components/InputPrompt.js:220:22 │ │ at file:///Users/davepar/Library/pnpm/global/5/.pnpm/@[email protected]_express@5.2.1/node_modules/@google/gemini-cli/dist/src/ui/components/InputPrompt.js:796:21 │ │ at file:///Users/davepar/Library/pnpm/global/5/.pnpm/@[email protected]_express@5.2.1/node_modules/@google/gemini-cli/dist/src/ui/contexts/KeypressContext.js:674:21

What did you expect to happen?

No bug

Client information

  • CLI Version: 0.33.0
  • Git Commit: 6ee19e1f6
  • Session ID: 2c3d9fec-517e-4a0d-be8b-3233ce465aac
  • Operating System: darwin v24.14.0
  • Sandbox Environment: no sandbox
  • Model Version: auto-gemini-3
  • Auth Type: oauth-personal
  • Memory Usage: 401.5 MB
  • Terminal Name: ghostty 1.3.1
  • Terminal Background: #1d2021
  • Kitty Keyboard Protocol: Supported

Login information

Google Account

Anything else we need to know?

No response

extent analysis

TL;DR

The issue is likely due to a permission error with the service account "[email protected]" lacking the "iam.serviceAccounts.actAs" permission.

Guidance

  • Check the IAM permissions for the service account "[email protected]" to ensure it has the "iam.serviceAccounts.actAs" permission.
  • Verify that the service account exists and is correctly configured.
  • Review the stack trace to identify the specific line of code causing the error, which appears to be related to the realpathSync function in the @google/gemini-cli-core module.
  • Consider checking the file path '/Users/davepar/projects/gatherist/a/gatherist.iam.gserviceaccount.com' to ensure it is valid and not too long.

Example

No code example is provided as the issue is related to configuration and permissions rather than code.

Notes

The issue may be specific to the user's environment and configuration, and further investigation may be needed to resolve the issue.

Recommendation

Apply workaround: Grant the "iam.serviceAccounts.actAs" permission to the service account "[email protected]" to resolve the permission error.

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