{"record":{"id":"043e1e49ccb20a2c","repo":"jdx/mise","slug":"repos-command-failed-in","errorCode":null,"errorMessage":"repos: command failed in {}","messagePattern":"repos: command failed in (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/repos.rs","lineNumber":263,"sourceCode":"            \"$ (cd {} && {})\",\n            status.request,\n            shell_words::join(command)\n        );\n        let result = Command::new(program)\n            .args(args)\n            .current_dir(&status.request.path)\n            .status();\n        let failed = match result {\n            Ok(exit) => !exit.success(),\n            Err(err) => {\n                warn!(\"repos: {}: command failed to start: {err}\", status.request);\n                true\n            }\n        };\n        if failed {\n            failures.push(status.request.to_string());\n            if !continue_on_error {\n                bail!(\"repos: command failed in {}\", status.request);\n            }\n        }\n    }\n    if !failures.is_empty() {\n        bail!(\"repos: command failed in {}\", failures.join(\", \"));\n    }\n    Ok(())\n}\n\nfn status_one(request: &RepoRequest) -> Result<RepoStatus> {\n    if !request.path.exists() {\n        return Ok(missing_status(request));\n    }\n    if !request.path.is_dir() {\n        return Ok(conflict_status(\n            request,\n            \"path exists and is not a directory\".to_string(),\n        ));","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/repos.rs#L245-L281","documentation":"The `mise repos exec` command runs a shell command in each configured repository. When a command exits non-zero in one of those repos and `--continue-on-error` is not set, exec aborts immediately with this error naming the offending repo request. It exists so a failing per-repo command surfaces the repo it failed in rather than failing silently.","triggerScenarios":"Running `mise repos exec -- <cmd>` where <cmd> exits non-zero in any repo (build failure, missing script, test failure) with continue_on_error disabled; also raised from the final bail listing all failed repos when failures accumulated despite continue-on-error.","commonSituations":"Bulk-running tests or builds across many cloned repos where one repo's script fails; a repo missing the target script (e.g. no package.json 'test'); PATH/tooling differences inside one repo's directory.","solutions":["Check the named repo from the message, cd into it, and run the command manually to see the full failure output.","Fix the failing command in that repo (install missing deps, fix the script) or skip/adjust the RepoRequest in mise.toml.","Re-run with --continue-on-error to let other repos proceed and get a full list of failing repos at the end.","Use exec's dry-run/list output first to confirm the command will succeed per repo before running it everywhere."],"exampleFix":"// before: one failing repo aborts everything\nmise repos exec -- npm test\n// after: continue past failures and review the summary\nmise repos exec --continue-on-error -- npm test","handlingStrategy":"try-catch","validationCode":"// Preview which repos will run the command first\nmise repos list\n// Verify the command exists in each repo\ngit -C <repo> cat-file -e HEAD:package.json 2>/dev/null && echo has package.json","typeGuard":null,"tryCatchPattern":"// Run with continue-on-error and handle the aggregate failure\nmatch mise_repos_exec(cmd, /*continue_on_error*/ true) {\n    Err(e) if e.to_string().starts_with(\"repos: command failed in\") => {\n        for repo in e.to_string().splitn(2, \"in \").nth(1).unwrap_or(\"\").split(\", \") {\n            eprintln!(\"fix repo: {repo}\");\n        }\n    }\n    Ok(()) => {}\n    Err(e) => return Err(e),\n}","preventionTips":["Use --continue-on-error for bulk operations so one bad repo doesn't mask the rest.","Dry-run or list repos before exec to confirm the command target exists in each.","Keep per-repo scripts (npm test, make) present and committed in every tracked repo.","Pin tool versions mise will use inside repos so exec doesn't fail on tool drift."],"tags":["git","subprocess","cli"],"backgroundTag":"git-command-failed","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}