{"record":{"id":"bb347ffacb70ce97","repo":"affaan-m/ECC","slug":"connector-name-required-unless-all-is-set","errorCode":null,"errorMessage":"connector name required unless --all is set","messagePattern":"connector name required unless --all is set","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"ecc2/src/main.rs","lineNumber":2493,"sourceCode":"                    );\n                }\n            }\n            GraphCommands::ConnectorSync {\n                name,\n                all,\n                limit,\n                json,\n            } => {\n                if all {\n                    let report = sync_all_memory_connectors(&db, &cfg, limit)?;\n                    if json {\n                        println!(\"{}\", serde_json::to_string_pretty(&report)?);\n                    } else {\n                        println!(\"{}\", format_graph_connector_sync_report_human(&report));\n                    }\n                } else {\n                    let name = name.as_deref().ok_or_else(|| {\n                        anyhow::anyhow!(\"connector name required unless --all is set\")\n                    })?;\n                    let stats = sync_memory_connector(&db, &cfg, name, limit)?;\n                    if json {\n                        println!(\"{}\", serde_json::to_string_pretty(&stats)?);\n                    } else {\n                        println!(\"{}\", format_graph_connector_sync_stats_human(&stats));\n                    }\n                }\n            }\n            GraphCommands::Connectors { json } => {\n                let report = memory_connector_status_report(&db, &cfg)?;\n                if json {\n                    println!(\"{}\", serde_json::to_string_pretty(&report)?);\n                } else {\n                    println!(\"{}\", format_graph_connector_status_report_human(&report));\n                }\n            }\n            GraphCommands::Recall {","sourceCodeStart":2475,"sourceCodeEnd":2511,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/ecc2/src/main.rs#L2475-L2511","documentation":"This error comes from the memory connector sync command when neither a connector `name` nor the `--all` flag was supplied. The CLI supports syncing one named connector or all configured connectors; calling it in sync mode with no name falls through to the `else` branch, which requires a name via `ok_or_else`. It is pure argument validation before any sync work happens.","triggerScenarios":"Invoking the graph/memory connector sync subcommand without `--connector <name>` and without `--all`, e.g. `ecc memory sync` with no arguments while the command's `--report` mode (which prints sync reports) was not selected.","commonSituations":"Users forget that the subcommand has multiple modes and omit the connector name; scripting the command after reading only the report-mode docs; shell alias drops the argument.","solutions":["Pass the connector name: `... sync --connector <name>`.","Or sync every configured connector with the `--all` flag.","Check `config.toml` `[memory_connectors]` to see valid connector names.","If you intended the report mode, supply the flag that selects report output instead of the sync path."],"exampleFix":"// before\n$ ecc memory sync\nerror: connector name required unless --all is set\n// after\n$ ecc memory sync --all\n# or\n$ ecc memory sync --connector notes-jsonl","handlingStrategy":"validation","validationCode":"# Shell guard before invoking\nif [ -z \"$CONNECTOR\" ] && [ \"$ALL\" != \"1\" ]; then\n  echo \"usage: ecc memory sync --connector <name> | --all\" >&2; exit 2\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember the command has two modes: one connector (`--connector <name>`) or everything (`--all`) — one is mandatory in sync mode.","Validate connector names against `config.toml` `[memory_connectors]` keys before scripting.","Keep shell wrappers that always pass either --all or a name."],"tags":["cli","argument-validation","missing-flag"],"backgroundTag":"missing-required-flag","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}