gemini-cli - 💡(How to fix) Fix unexpected error during remote create file and write task [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#25746Fetched 2026-04-22 08:03:39
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
labeled ×1

Error Message

After a long conversation I asked the AI to write a series of markdown documents in a remote (same filesystem, but outside the repo folder) using the @path/to/folder and I got a "This is an unexpected error." message, I attached both the chatlog and a copy of the debug console.

Code Example

"security": {
    "auth": {
      "selectedType": "oauth-personal"
    },
    "toolSandboxing": false,
    "enableConseca": false
  },
  "tools": {
    "sandboxAllowedPaths": [
      "/home/michael/.cache",
      "/home/michael/.cache/mise",
      "/home/michael/.config/mise",
      "/home/michael/.local/share/mise",
      "/home/michael/.local/bin",
      "/home/michael/.semgrep",
      "/run/user/1000",
      "/tmp"
    ],
    "sandboxNetworkAccess": false
  },
  "terminal.integrated.env.linux": {
    "DOCKER_HOST": "unix:///run/user/1000/podman/podman.sock",
    "CONTAINER_HOST": "unix:///run/user/1000/podman/podman.sock"
  },
  "ui": {
    "theme": "ANSI",
    "footer": {
      "items": [
        "workspace",
        "git-branch",
        "model-name",
        "quota",
        "context-used",
        "token-count",
        "auth"
      ],
RAW_BUFFERClick to expand / collapse

What happened?

After a long conversation I asked the AI to write a series of markdown documents in a remote (same filesystem, but outside the repo folder) using the @path/to/folder and I got a "This is an unexpected error." message, I attached both the chatlog and a copy of the debug console.

Earlier today I added this to my global settings.json:

  "security": {
    "auth": {
      "selectedType": "oauth-personal"
    },
    "toolSandboxing": false,
    "enableConseca": false
  },
  "tools": {
    "sandboxAllowedPaths": [
      "/home/michael/.cache",
      "/home/michael/.cache/mise",
      "/home/michael/.config/mise",
      "/home/michael/.local/share/mise",
      "/home/michael/.local/bin",
      "/home/michael/.semgrep",
      "/run/user/1000",
      "/tmp"
    ],
    "sandboxNetworkAccess": false
  },
  "terminal.integrated.env.linux": {
    "DOCKER_HOST": "unix:///run/user/1000/podman/podman.sock",
    "CONTAINER_HOST": "unix:///run/user/1000/podman/podman.sock"
  },
  "ui": {
    "theme": "ANSI",
    "footer": {
      "items": [
        "workspace",
        "git-branch",
        "model-name",
        "quota",
        "context-used",
        "token-count",
        "auth"
      ],

I dont know if it could be related debug.console.log

bug-report-history-1776781134775.json

[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?

I expected it to create and write the documents, but it only wrote the document that had an existing *.md file, it did not create any new ones

Client information

  • CLI Version: 0.38.2
  • Git Commit: b0ed611a0
  • Session ID: 448e830f-4386-4986-a669-b21f984b24d1
  • Operating System: linux v25.9.0
  • Sandbox Environment: no sandbox
  • Model Version: gemini-3-flash-preview
  • Auth Type: oauth-personal
  • Memory Usage: 714.1 MB
  • Terminal Name: Konsole 25.04.2
  • Terminal Background: #232627
  • Kitty Keyboard Protocol: Unsupported

Login information

oauth to [email protected] - no API key

Anything else we need to know?

No response

extent analysis

TL;DR

The issue might be related to the sandboxAllowedPaths configuration, which may not include the target directory for writing markdown documents.

Guidance

  • Review the sandboxAllowedPaths list in the settings.json file to ensure it includes the /path/to/folder where the AI is trying to write the markdown documents.
  • Verify that the target directory has the necessary permissions for writing files.
  • Check the debug console log for any specific error messages related to file system access or permissions.
  • Consider adding the target directory to the sandboxAllowedPaths list as a potential workaround.

Example

No code snippet is provided as it's not clearly supported by the issue.

Notes

The issue may be related to the toolSandboxing setting being disabled, which could affect the AI's ability to write files outside the repository folder. However, without more information, it's difficult to determine the exact cause.

Recommendation

Apply workaround: Add the target directory to the sandboxAllowedPaths list, as this may resolve the issue with writing markdown documents to the specified location.

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 unexpected error during remote create file and write task [1 participants]