zeroclaw-labs/zeroclaw · error · anyhow::Error

OpenClaw workspace not found at {}. Pass --source <path> if

Error message

OpenClaw workspace not found at {}. Pass --source <path> if needed.

What it means

migrate_openclaw_memory is the entry point for importing an OpenClaw workspace into ZeroClaw. It first resolves the source (the --source argument, else the default OpenClaw location via resolve_openclaw_workspace) and immediately bails if that path does not exist on disk. This is a pre-flight check before any database or memory file is opened.

Source

Thrown at crates/zeroclaw-runtime/src/migration.rs:34

#[derive(Debug, Default)]
struct MigrationStats {
    from_sqlite: usize,
    from_markdown: usize,
    imported: usize,
    skipped_unchanged: usize,
    renamed_conflicts: usize,
}

pub async fn migrate_openclaw_memory(
    config: &Config,
    source_workspace: Option<PathBuf>,
    dry_run: bool,
    reindex: bool,
) -> Result<()> {
    let source_workspace = resolve_openclaw_workspace(source_workspace)?;
    if !source_workspace.exists() {
        bail!(
            "OpenClaw workspace not found at {}. Pass --source <path> if needed.",
            source_workspace.display()
        );
    }

    if paths_equal(&source_workspace, &config.data_dir) {
        bail!("Source workspace matches current ZeroClaw workspace; refusing self-migration");
    }

    let mut stats = MigrationStats::default();
    let entries = collect_source_entries(&source_workspace, &mut stats)?;

    if entries.is_empty() {
        println!(
            "No importable memory found in {}",
            source_workspace.display()
        );
        println!("Checked for: memory/brain.db, MEMORY.md, memory/*.md");

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Point at the real workspace: re-run with --source /path/to/openclaw/workspace
  2. Verify the path: ls the directory you are passing and confirm it is the OpenClaw workspace root (the one containing its data files)
  3. If OpenClaw is installed at a non-default location, always pass --source explicitly
  4. If you never used OpenClaw, skip this command entirely — there is nothing to migrate

Example fix

# before
zeroclaw migrate-memory

# after
zeroclaw migrate-memory --source /home/user/.openclaw
Defensive patterns

Strategy: validation

Validate before calling

let src = resolve_openclaw_workspace(source_workspace.clone())?;
if !src.exists() {
    // prompt the user for --source before invoking migrate_openclaw_memory
    anyhow::bail!("no OpenClaw workspace at {} — pass --source", src.display());
}

Try / catch

match migrate_openclaw_memory(&config, source.clone(), dry_run, reindex) {
    Err(e) if e.to_string().contains("workspace not found") => {
        // ask for the correct path; do not retry blindly
    }
    other => other?,
}

Prevention

When it happens

Trigger: Running the migrate command on a machine where OpenClaw was never installed (default path does not exist); --source with a typo, relative path resolved from the wrong cwd, or quoting error; OpenClaw workspace moved or deleted after install.

Common situations: Trying the migration feature out of curiosity on a clean box; migrating from a backup copy but passing the backup's parent directory instead of the workspace root; scripts assuming ~/.openclaw exists on a new server.

Related errors


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/b71139e683b6a726. Report an issue: GitHub.