openclaw - ✅(Solved) Fix [Bug]: OPENCLAW_CONFIG_DIR cannot contain whitespace [3 pull requests, 4 comments, 3 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
openclaw/openclaw#44599Fetched 2026-04-08 00:44:44
View on GitHub
Comments
4
Participants
3
Timeline
24
Reactions
0
Timeline (top)
referenced ×14cross-referenced ×5commented ×3labeled ×2

I tried to install openclaw with docker as this instruction (https://www.youtube.com/watch?v=V8nKksknXxg) but faced the error: OPENCLAW_CONFIG_DIR cannot contain whitespace when running .\docker-setup.sh.

Error Message

I tried to install openclaw with docker as this instruction (https://www.youtube.com/watch?v=V8nKksknXxg) but faced the error: OPENCLAW_CONFIG_DIR cannot contain whitespace when running .\docker-setup.sh.

Root Cause

I tried to install openclaw with docker as this instruction (https://www.youtube.com/watch?v=V8nKksknXxg) but faced the error: OPENCLAW_CONFIG_DIR cannot contain whitespace when running .\docker-setup.sh.

Fix Action

Fixed

PR fix notes

PR #44608: fix(docker): allow whitespace in config and workspace paths

Description (problem / solution / changelog)

Windows usernames with spaces (e.g. C:\Users\John Doe) cause docker-setup.sh to bail with "OPENCLAW_CONFIG_DIR cannot contain whitespace". These are perfectly valid paths.

Problem

validate_mount_path_value rejected any path containing whitespace. On Windows with Git Bash, $HOME often resolves to a path with spaces when the Windows username contains them.

Root cause

The whitespace check was overly broad. The actual concern is YAML structure injection in the generated docker-compose file, but that only requires rejecting colons, commas, and control characters -- not spaces.

Fix

  • Remove the blanket [[:space:]] rejection from validate_mount_path_value (control characters like tabs/newlines are still caught by contains_disallowed_chars)
  • Relax validate_mount_spec regex to allow spaces in source/target segments (colons and commas still blocked)
  • Quote volume mount strings in generated YAML so Docker Compose parses spaced paths correctly

Testing

bash -n docker-setup.sh passes. The quoting matches Docker Compose documented YAML string handling.

Fixes #44599

Changed files

  • docker-setup.sh (modified, +11/-13)

PR #44612: fix(docker): allow whitespace in OPENCLAW_CONFIG_DIR path

Description (problem / solution / changelog)

Fixes #44599 - OPENCLAW_CONFIG_DIR cannot contain whitespace

Root Cause

The validate_mount_path_value() function in docker-setup.sh rejected any path containing whitespace. This was overly restrictive, as Docker Compose and YAML handle quoted paths correctly.

Problem

Users on Windows with spaces in their home directory (e.g., C:\Users\John Doe) could not use the default config directory path.

Fix

Remove the whitespace check from validate_mount_path_value(). The check for control characters (newlines, tabs) is retained as those can cause parsing issues.

Test plan

  • Script syntax validated
  • Users can now set OPENCLAW_CONFIG_DIR to paths with spaces
  • Test with path containing spaces (Windows home directory)

Changed files

  • docker-setup.sh (modified, +14/-14)
  • src/browser/pw-ai.ts (modified, +0/-1)
  • src/browser/routes/agent.act.ts (modified, +52/-498)

PR #44626: fix(docker): allow whitespace in OPENCLAW_CONFIG_DIR/WORKSPACE

Description (problem / solution / changelog)

Fixes #44599.

Summary

Allow OPENCLAW_CONFIG_DIR / OPENCLAW_WORKSPACE_DIR to contain whitespace in docker-setup.sh.

What changed

  • Permit whitespace in validate_mount_path_value (still rejects control chars).
  • Quote generated volume entries in docker-compose.extra.yml using YAML single-quote escaping so whitespace is preserved.
  • Relax validate_mount_spec to allow whitespace while still rejecting control chars / commas and enforcing source:target[:options] shape.
  • Add e2e coverage that runs docker-setup.sh with config/workspace directories containing spaces and asserts the extra compose file contains quoted mounts.

Notes

This is intended to address Windows/macOS home paths that commonly include spaces.

Changed files

  • docker-setup.sh (modified, +24/-13)
  • src/docker-setup.e2e.test.ts (modified, +22/-0)
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Summary

I tried to install openclaw with docker as this instruction (https://www.youtube.com/watch?v=V8nKksknXxg) but faced the error: OPENCLAW_CONFIG_DIR cannot contain whitespace when running .\docker-setup.sh.

Steps to reproduce

  1. git clone https://github.com/openclaw/openclaw.git
  2. cd openclaw
  3. ./docker-setup.sh

Expected behavior

Successfully install.

Actual behavior

OPENCLAW_CONFIG_DIR cannot contain whitespace showed in the git bash shell.

OpenClaw version

git clone from main branch

Operating system

Windows 11

Install method

docker

Model

gemini

Provider / routing chain

openclaw

Config file / key location

No response

Additional provider/model setup details

Image

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

Fix Plan

The fix is to remove whitespace from the OPENCLAW_CONFIG_DIR path.

  • Check your current working directory and ensure it does not contain any whitespace.
  • If it does, move the cloned repository to a path without whitespace.
  • Update the OPENCLAW_CONFIG_DIR environment variable to point to the new location.

Example:

# Move the repository to a new location without whitespace
mv openclaw /c/openclaw

# Update the environment variable
export OPENCLAW_CONFIG_DIR=/c/openclaw/config

Alternatively, you can also modify the docker-setup.sh script to handle paths with whitespace by wrapping the path in quotes:

# In docker-setup.sh
OPENCLAW_CONFIG_DIR="/path/with whitespace/config"

becomes

# In docker-setup.sh
OPENCLAW_CONFIG_DIR="/path/with whitespace/config"
docker run -v "${OPENCLAW_CONFIG_DIR}":/config ...

Verification

Run the ./docker-setup.sh script again to verify that the installation is successful.

Extra Tips

  • Always ensure that environment variables and file paths do not contain whitespace to avoid similar issues in the future.
  • Consider using a consistent naming convention for directories and files to avoid whitespace-related problems.

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…

FAQ

Expected behavior

Successfully install.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING