{"record":{"id":"b71139e683b6a726","repo":"zeroclaw-labs/zeroclaw","slug":"openclaw-workspace-not-found-at-pass-source","errorCode":null,"errorMessage":"OpenClaw workspace not found at {}. Pass --source <path> if needed.","messagePattern":"OpenClaw workspace not found at (.+?)\\. Pass --source <path> if needed\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-runtime/src/migration.rs","lineNumber":34,"sourceCode":"\n#[derive(Debug, Default)]\nstruct MigrationStats {\n    from_sqlite: usize,\n    from_markdown: usize,\n    imported: usize,\n    skipped_unchanged: usize,\n    renamed_conflicts: usize,\n}\n\npub async fn migrate_openclaw_memory(\n    config: &Config,\n    source_workspace: Option<PathBuf>,\n    dry_run: bool,\n    reindex: bool,\n) -> Result<()> {\n    let source_workspace = resolve_openclaw_workspace(source_workspace)?;\n    if !source_workspace.exists() {\n        bail!(\n            \"OpenClaw workspace not found at {}. Pass --source <path> if needed.\",\n            source_workspace.display()\n        );\n    }\n\n    if paths_equal(&source_workspace, &config.data_dir) {\n        bail!(\"Source workspace matches current ZeroClaw workspace; refusing self-migration\");\n    }\n\n    let mut stats = MigrationStats::default();\n    let entries = collect_source_entries(&source_workspace, &mut stats)?;\n\n    if entries.is_empty() {\n        println!(\n            \"No importable memory found in {}\",\n            source_workspace.display()\n        );\n        println!(\"Checked for: memory/brain.db, MEMORY.md, memory/*.md\");","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-runtime/src/migration.rs#L16-L52","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Point at the real workspace: re-run with --source /path/to/openclaw/workspace","Verify the path: ls the directory you are passing and confirm it is the OpenClaw workspace root (the one containing its data files)","If OpenClaw is installed at a non-default location, always pass --source explicitly","If you never used OpenClaw, skip this command entirely — there is nothing to migrate"],"exampleFix":"# before\nzeroclaw migrate-memory\n\n# after\nzeroclaw migrate-memory --source /home/user/.openclaw","handlingStrategy":"validation","validationCode":"let src = resolve_openclaw_workspace(source_workspace.clone())?;\nif !src.exists() {\n    // prompt the user for --source before invoking migrate_openclaw_memory\n    anyhow::bail!(\"no OpenClaw workspace at {} — pass --source\", src.display());\n}","typeGuard":null,"tryCatchPattern":"match migrate_openclaw_memory(&config, source.clone(), dry_run, reindex) {\n    Err(e) if e.to_string().contains(\"workspace not found\") => {\n        // ask for the correct path; do not retry blindly\n    }\n    other => other?,\n}","preventionTips":["Always pass --source explicitly in scripts rather than relying on the default location","Verify the path with a filesystem check before running migration","Document where OpenClaw stores its workspace for the OS you support"],"tags":["rust","zeroclaw","migration","openclaw","filesystem","cli"],"backgroundTag":"directory-not-found","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}