Skip to content

sandbox-fs write fails: Syntax error ";" unexpected (moltbot-sandbox-fs) #25868

@krakadilgena

Description

@krakadilgena

Description

When sandbox.mode="all" is enabled for an agent with workspaceAccess: rw, all filesystem operations (read, write, image loading) fail with:

moltbot-sandbox-fs: 1: Syntax error: ";" unexpected

The sandbox FS helper script appears to have a shell compatibility issue — likely uses bash syntax but gets executed with dash or sh inside the Docker container.

Environment

  • OpenClaw: 2026.2.23
  • OS: Ubuntu 24.04 (6.8.0-71-generic)
  • Docker: 28.2.2 (docker.io from Ubuntu repos)
  • Node.js: 22.22.0

Config (relevant)

{
  "id": "rhr-marketing",
  "workspace": "/root/.openclaw/workspace-marketing",
  "sandbox": {
    "mode": "all",
    "workspaceAccess": "rw"
  }
}

Steps to Reproduce

  1. Install Docker via apt install docker.io on Ubuntu 24.04
  2. Configure an agent with sandbox.mode: "all" and sandbox.workspaceAccess: "rw"
  3. Send a message to the agent that triggers a write or read tool call
  4. Tool call fails with moltbot-sandbox-fs: 1: Syntax error: ";" unexpected

Log Excerpt

2026-02-24T22:41:24.643Z error [tools] write failed: moltbot-sandbox-fs: 1: Syntax error: ";" unexpected
2026-02-24T22:41:19.012Z debug Native image: failed to load media/inbound/68b4663b-bd79-4872-98b5-c6009111244b.png: moltbot-sandbox-fs: 1: Syntax error: ";" unexpected

The error affects all FS operations — write, read, and image loading all fail with the same syntax error.

Workaround

Disabled sandbox.mode and using tools.fs.workspaceOnly=true instead to restrict filesystem access at the config level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions