{"record":{"id":"ea1f0f70e6b68c42","repo":"gastownhall/beads","slug":"backend-q-cannot-be-created-by-bd-init-it-can-on","errorCode":null,"errorMessage":"backend %q cannot be created by bd init; it can only open an existing workspace (bd init provisions \"dolt\", the default)","messagePattern":"backend %q cannot be created by bd init; it can only open an existing workspace \\(bd init provisions \"dolt\", the default\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/init.go","lineNumber":550,"sourceCode":"\t\t}\n\n\t\t// Backend selection: Dolt is the only supported backend.\n\t\tif !configfile.IsSupportedBackend(backendFlag) {\n\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","sourceCodeStart":532,"sourceCodeEnd":568,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/init.go#L532-L568","documentation":"A registered extension backend passes IsSupportedBackend, but bd init only provisions dolt. Extension backends can open existing workspaces but cannot be created by init, since downstream registrants supply their own workspace-creation path. This error rejects the attempt instead of silently creating a wrong workspace with backend: dolt persisted.","triggerScenarios":"`bd init --backend=<extension>` where backends.Registered(backendFlag) is true for a third-party registered backend.","commonSituations":"Developers of extension backends or users of plugin backends trying to bootstrap a fresh workspace with bd init instead of the extension's own creation path.","solutions":["Use the extension backend's own workspace-creation command/path instead of bd init","Run plain `bd init` (dolt) if you just need a standard workspace","Check the extension's documentation for its supported creation flow"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if isExtensionBackend(backend) {\n    return fmt.Errorf(\"use the extension's own creation path, not bd init\")\n}","typeGuard":null,"tryCatchPattern":"if err := bdInit(\"--backend=\" + ext); err != nil {\n    if strings.Contains(err.Error(), \"cannot be created by bd init\") {\n        // call the extension's own workspace-creation command\n    }\n}","preventionTips":["Only use bd init for the default dolt backend","Consult the extension's docs for its workspace-creation flow","Gate scripts to run plain bd init only when backend == dolt"],"tags":["cli","backend","init","extension","workspace"],"backgroundTag":"unsupported-backend","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}