{"record":{"id":"4bcb3a42b2a3cc57","repo":"gastownhall/beads","slug":"prefix-q-conflicts-with-issue-prefix-q-provisi","errorCode":null,"errorMessage":"--prefix %q conflicts with issue_prefix %q provisioned in database %q; omit --prefix to adopt the provisioned one","messagePattern":"--prefix %q conflicts with issue_prefix %q provisioned in database %q; omit --prefix to adopt the provisioned one","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/init_proxied_server.go","lineNumber":430,"sourceCode":"//\n// ABSENT means \"unprovisioned, tell them to run bts init\" and UNREADABLE means\n// \"the connection failed, say so\"; keeping those apart is the InitVerifier\n// role's promise. The two markers arrive as ONE snapshot, so the prefix and the\n// project id cannot come from either side of a concurrent write.\nfunc adoptTeamServerIdentity(ctx context.Context, verifier issueops.InitVerifier, dbName, localPrefix string, prefixIsExplicit bool, localProjectID string) (prefix, projectID string, err error) {\n\tidentity, readErr := verifier.VerifyIdentity(ctx, issueops.VerifyIdentityRequest{})\n\tif _, err := resolveInitIssuePrefix(true, identity.Prefix, dbName, localPrefix, readErr); err != nil {\n\t\tif readErr == nil {\n\t\t\treturn \"\", \"\", fmt.Errorf(\n\t\t\t\t\"database %q has no project identity (config.issue_prefix) — provision it with 'bts init' (or heal an older bts database with 'bts migrate')\",\n\t\t\t\tdbName)\n\t\t}\n\t\treturn \"\", \"\", err\n\t}\n\t// An explicit --prefix that disagrees must not be silently ignored; a\n\t// merely derived prefix adopts silently.\n\tif prefixIsExplicit && identity.Prefix != localPrefix {\n\t\treturn \"\", \"\", fmt.Errorf(\n\t\t\t\"--prefix %q conflicts with issue_prefix %q provisioned in database %q; omit --prefix to adopt the provisioned one\",\n\t\t\tlocalPrefix, identity.Prefix, dbName)\n\t}\n\n\tadoptedID, _, err := resolveInitProjectID(true, localProjectID, identity.ProjectID, dbName, readErr)\n\tif err != nil {\n\t\tif readErr == nil {\n\t\t\treturn \"\", \"\", fmt.Errorf(\n\t\t\t\t\"database %q has no project identity (metadata._project_id) — provision it with 'bts init' (or heal an older bts database with 'bts migrate')\",\n\t\t\t\tdbName)\n\t\t}\n\t\treturn \"\", \"\", err\n\t}\n\treturn identity.Prefix, adoptedID, nil\n}\n\ntype proxiedMetadataInputs struct {\n\tdbName     string","sourceCodeStart":412,"sourceCodeEnd":448,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/init_proxied_server.go#L412-L448","documentation":"When the caller passes an explicit --prefix, adoptTeamServerIdentity refuses to silently ignore a disagreement: if the shared database's provisioned issue_prefix differs from the local --prefix, init aborts with this conflict error. A merely derived (non-explicit) local prefix would be adopted silently; only explicit flags conflict.","triggerScenarios":"bd init --prefix XYZ against a team-server database provisioned with a different issue_prefix (e.g. ABC).","commonSituations":"Copy-pasting an init command from another project's docs; the team re-provisioned the shared database with a new prefix while local scripts still pass the old one; two teams sharing one database by mistake.","solutions":["Re-run bd init WITHOUT --prefix to adopt the provisioned prefix (recommended by the error)","If you truly need a different prefix, provision a separate database with 'bts init' using that prefix — don't fight the shared one","Update local scripts/docs to the provisioned prefix"],"exampleFix":"// before\nbd init --prefix OLD\n// error: --prefix \"OLD\" conflicts with issue_prefix \"NEW\"\n// after\nbd init   # omit --prefix; adopts the provisioned prefix","handlingStrategy":"validation","validationCode":"// read the provisioned prefix before passing --prefix\nident, _ := verifier.VerifyIdentity(ctx, issueops.VerifyIdentityRequest{})\nif prefixFlag != \"\" && ident.Prefix != \"\" && prefixFlag != ident.Prefix {\n    return fmt.Errorf(\"drop --prefix %q; database is provisioned with %q\", prefixFlag, ident.Prefix)\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"conflicts with issue_prefix\") {\n    // re-run bd init without --prefix to adopt the provisioned prefix\n}","preventionTips":["Omit --prefix in team-server mode and adopt the provisioned one","Only pass --prefix for a brand-new database you provision yourself","Keep team scripts in sync when the shared prefix changes","Never share one database across teams wanting different prefixes"],"tags":["init","identity","prefix-conflict","team-server","cli-flag"],"backgroundTag":"prefix-conflict","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}