{"record":{"id":"21de3d613778e539","repo":"gastownhall/beads","slug":"s-belonged-to-s-s-use-backend-dolt-the-d","errorCode":null,"errorMessage":"--%s belonged to %s: %s; use --backend=dolt (the default)","messagePattern":"--(.+?) belonged to (.+?): (.+?); use --backend=dolt \\(the default\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/init.go","lineNumber":554,"sourceCode":"\t\t\tswitch backendFlag {\n\t\t\tcase configfile.BackendPostgres, configfile.BackendMySQL:\n\t\t\t\treturn fmt.Errorf(\"storage backend %q is no longer supported: %s; the supported backend is \\\"dolt\\\" (default)\", backendFlag, configfile.RemovedBackendRationale)\n\t\t\tcase configfile.BackendSQLite:\n\t\t\t\treturn fmt.Errorf(\"storage backend %q is no longer supported: %s; the supported backend is \\\"dolt\\\" (default)\", backendFlag, configfile.RemovedSQLiteRationale)\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"unknown backend %q: the supported backend is \\\"dolt\\\" (default)\", backendFlag)\n\t\t}\n\t\t// A registered extension backend passes IsSupportedBackend so its\n\t\t// existing workspaces can be opened, but init provisions Dolt only and\n\t\t// would otherwise create the workspace and persist backend: dolt. Reject\n\t\t// it here rather than silently creating the wrong workspace; downstream\n\t\t// registrants supply their own workspace-creation path.\n\t\tif backends.Registered(backendFlag) {\n\t\t\treturn fmt.Errorf(\"backend %q cannot be created by bd init; it can only open an existing workspace (bd init provisions \\\"dolt\\\", the default)\", backendFlag)\n\t\t}\n\t\tfor _, legacyFlag := range removedBackendInitFlags {\n\t\t\tif cmd.Flags().Changed(legacyFlag.name) {\n\t\t\t\treturn fmt.Errorf(\"--%s belonged to %s: %s; use --backend=dolt (the default)\", legacyFlag.name, legacyFlag.origin, legacyFlag.rationale)\n\t\t\t}\n\t\t}\n\t\t// Validate --database format early, before any side effects.\n\t\tif database != \"\" {\n\t\t\tif err := dolt.ValidateDatabaseName(database); err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid database name %q: %v\", database, err)\n\t\t\t}\n\t\t}\n\n\t\t// Resolve non-interactive mode: flag > env var > terminal detection.\n\t\t// This must be computed before any interactive prompts.\n\t\tnonInteractive := isNonInteractiveInit(nonInteractiveFlag)\n\n\t\t// Validate --role flag value\n\t\tif roleFlag != \"\" {\n\t\t\tswitch roleFlag {\n\t\t\tcase \"maintainer\", \"contributor\":\n\t\t\t\t// valid","sourceCodeStart":536,"sourceCodeEnd":572,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/init.go#L536-L572","documentation":"Raised when a removed backend's legacy init flag (from removedBackendInitFlags) is still passed to bd init, e.g. old --sqlite or --postgres style flags. The message names the flag, its origin backend, the removal rationale, and points to --backend=dolt.","triggerScenarios":"Running `bd init` with a legacy removed-backend flag listed in removedBackendInitFlags that cmd.Flags().Changed() reports as set.","commonSituations":"Old shell aliases or wrapper scripts from pre-Dolt beads versions; muscle-memory flags like --sqlite; users following outdated blog posts or docs.","solutions":["Remove the legacy flag from your command/alias","Replace it with --backend=dolt (or omit --backend, dolt is default)","Read the rationale in the message for the origin backend's removal","Search scripts/CI configs for the legacy flag name and clean it up"],"exampleFix":"// before\nbd init --sqlite\n// after\nbd init   # dolt is the default backend","handlingStrategy":"validation","validationCode":"LEGACY_FLAGS=(--sqlite --postgres --mysql)\nfor f in \"${LEGACY_FLAGS[@]}\"; do\n  case \" $ARGS \" in *\" $f \"*) echo \"$f is removed; use --backend=dolt\"; exit 1;; esac\ndone","typeGuard":null,"tryCatchPattern":"if err := bdInit(args...); err != nil {\n    if strings.Contains(err.Error(), \"belonged to\") {\n        // strip the legacy flag and rerun with --backend=dolt\n    }\n}","preventionTips":["Audit shell history/aliases for legacy backend flags","Replace legacy flags with --backend=dolt in wrappers","Read the error's origin/rationale fields when migrating"],"tags":["cli","init","removed-feature","legacy-flag"],"backgroundTag":"removed-cli-flag","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}