gastownhall/beads · error

backend %q cannot be created by bd init; it can only open an

Error message

backend %q cannot be created by bd init; it can only open an existing workspace (bd init provisions "dolt", the default)

What it means

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.

Source

Thrown at cmd/bd/init.go:550

		}

		// Backend selection: Dolt is the only supported backend.
		if !configfile.IsSupportedBackend(backendFlag) {
			switch backendFlag {
			case configfile.BackendPostgres, configfile.BackendMySQL:
				return fmt.Errorf("storage backend %q is no longer supported: %s; the supported backend is \"dolt\" (default)", backendFlag, configfile.RemovedBackendRationale)
			case configfile.BackendSQLite:
				return fmt.Errorf("storage backend %q is no longer supported: %s; the supported backend is \"dolt\" (default)", backendFlag, configfile.RemovedSQLiteRationale)
			}
			return fmt.Errorf("unknown backend %q: the supported backend is \"dolt\" (default)", backendFlag)
		}
		// A registered extension backend passes IsSupportedBackend so its
		// existing workspaces can be opened, but init provisions Dolt only and
		// would otherwise create the workspace and persist backend: dolt. Reject
		// it here rather than silently creating the wrong workspace; downstream
		// registrants supply their own workspace-creation path.
		if backends.Registered(backendFlag) {
			return fmt.Errorf("backend %q cannot be created by bd init; it can only open an existing workspace (bd init provisions \"dolt\", the default)", backendFlag)
		}
		for _, legacyFlag := range removedBackendInitFlags {
			if cmd.Flags().Changed(legacyFlag.name) {
				return fmt.Errorf("--%s belonged to %s: %s; use --backend=dolt (the default)", legacyFlag.name, legacyFlag.origin, legacyFlag.rationale)
			}
		}
		// Validate --database format early, before any side effects.
		if database != "" {
			if err := dolt.ValidateDatabaseName(database); err != nil {
				return fmt.Errorf("invalid database name %q: %v", database, err)
			}
		}

		// Resolve non-interactive mode: flag > env var > terminal detection.
		// This must be computed before any interactive prompts.
		nonInteractive := isNonInteractiveInit(nonInteractiveFlag)

		// Validate --role flag value

View on GitHub (pinned to 71377f2769)

Solutions

  1. Use the extension backend's own workspace-creation command/path instead of bd init
  2. Run plain `bd init` (dolt) if you just need a standard workspace
  3. Check the extension's documentation for its supported creation flow
Defensive patterns

Strategy: validation

Validate before calling

if isExtensionBackend(backend) {
    return fmt.Errorf("use the extension's own creation path, not bd init")
}

Try / catch

if err := bdInit("--backend=" + ext); err != nil {
    if strings.Contains(err.Error(), "cannot be created by bd init") {
        // call the extension's own workspace-creation command
    }
}

Prevention

When it happens

Trigger: `bd init --backend=<extension>` where backends.Registered(backendFlag) is true for a third-party registered backend.

Common situations: 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.

Related errors


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/ea1f0f70e6b68c42. Report an issue: GitHub.