{"record":{"id":"9d248f9d1321d971","repo":"gitbutlerapp/gitbutler","slug":"setup-required-message-run-but-setup-to-con","errorCode":null,"errorMessage":"Setup required: {message} - run `but setup` to configure the project","messagePattern":"Setup required: (.+?) - run `but setup` to configure the project","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/setup.rs","lineNumber":200,"sourceCode":"                                    app_settings.clone(),\n                                )?;\n                                let mut guard = ctx.exclusive_worktree_access();\n                                crate::command::legacy::setup::repo(\n                                    &mut ctx,\n                                    &args.current_dir,\n                                    out,\n                                    guard.write_permission(),\n                                )?;\n                                // Retry finding the project after setup\n                                LegacyProject::find_by_worktree_dir(workdir).map_err(|_| {\n                                    anyhow::anyhow!(\n                                        \"Setup completed but project still not found at {}\",\n                                        workdir.display()\n                                    )\n                                })?\n                            }\n                            SetupPromptResult::Declined => {\n                                anyhow::bail!(\n                                    \"Setup required: {message} - run `but setup` to configure the project\"\n                                );\n                            }\n                        }\n                    }\n                };\n\n                // Check project setup, prompt for setup if needed\n                let mut ctx =\n                    Context::new_from_legacy_project_and_settings(&project, app_settings.clone())?;\n                {\n                    let mut guard = ctx.exclusive_worktree_access();\n                    if let Err(e) = check_project_setup(&ctx, guard.read_permission()) {\n                        let message = e.to_string();\n                        match prompt_for_setup(out, &message) {\n                            SetupPromptResult::RunSetup => {\n                                // Run setup to fix the project configuration\n                                crate::command::legacy::setup::repo(","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but/src/setup.rs#L182-L218","documentation":"During init_ctx, project setup validation found a problem (message from the setup check). The CLI surfaced an interactive setup prompt and the user (or a non-interactive environment) declined it, so initialization bails with 'Setup required'. It directs the user to `but setup` to configure the project.","triggerScenarios":"init_ctx detects the project is missing/not configured, shows the SetupPrompt, and SetupPromptResult::Declined is returned — e.g. the user answered no, or the prompt auto-declined in a non-TTY/scripted context.","commonSituations":"Running but in a repo never initialized with `but setup`; CI or piped commands where the interactive prompt cannot render and is declined automatically.","solutions":["Run `but setup` in the repository and follow the prompts.","Re-run the original command and accept the setup prompt when shown.","In CI/scripts, run `but setup` non-interactively as a prior step instead of relying on the inline prompt."],"exampleFix":"// before (CI script)\nbut push\n// after\nbut setup && but push","handlingStrategy":"try-catch","validationCode":"# detect uninitialized project before non-interactive use\n[ -d .git/gitbutler ] || but setup","typeGuard":null,"tryCatchPattern":"if ! but status 2>&1 | grep -q 'Setup required'; then\n  but push\nelse\n  but setup && but push\nfi","preventionTips":["Run `but setup` immediately after cloning","In CI, complete setup as a pre-step since prompts auto-decline","Never dismiss the setup prompt expecting the command to continue"],"tags":["cli","setup","configuration","interactive-prompt"],"backgroundTag":"missing-required-config","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}