{"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/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but/src/setup.rs#L182-L218","documentation":"In the legacy single-branch flow (feature flag single_branch), init_ctx interactively offers project setup via prompt_project_setup. When the user declines (SetupPromptResult::Declined) at the initial project-lookup site, initialization aborts and directs the user to run `but setup` explicitly.","triggerScenarios":"Answering no to the interactive setup prompt of any workspace command while the single_branch feature flag is enabled and the worktree is not yet registered as a legacy project.","commonSituations":"First run on a new clone with legacy mode enabled, declining a keychain/permission prompt, scripted runs where a stray 'n' on stdin answers the prompt.","solutions":["Run `but setup` and complete the configuration","Re-run the original command and accept the setup prompt this time"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match run_but(args) {\n    Err(e) if e.to_string().contains(\"Setup required\") => {\n        run_but([\"setup\"])?; // complete configuration\n        run_but(args)          // retry once\n    }\n    r => r,\n}","preventionTips":["Run `but setup` as an explicit first step in onboarding scripts","Do not pipe stdin into commands that may prompt - a stray 'n' declines setup","Check that the worktree is registered as a project before scripted commands"],"tags":["setup","interactive","legacy","project","onboarding"],"backgroundTag":"first-run-setup-required","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}