gastownhall/beads · error

list remotes: %w

Error message

list remotes: %w

What it means

In configureProxiedInitDoltRemote, bd lists existing Dolt remotes before creating 'origin'. This wrapper fires when DoltRemoteUseCase().ListRemotes fails, aborting remote setup during proxied-server init. The wrapped error (driver/connection/storage) carries the real cause.

Source

Thrown at cmd/bd/init_proxied_server.go:395

			}
		}
		if err := cfg.SetMetadata(ctx, "last_import_time", time.Now().UTC().Format(time.RFC3339)); err != nil {
			return "", fmt.Errorf("record last_import_time: %w", err)
		}
		if err := cfg.SetLocalMetadata(ctx, workapi.MetadataKeyVersion, Version); err != nil {
			return "", fmt.Errorf("record bd_version: %w", err)
		}
		return "bd init", nil
	})
}

// configureProxiedInitDoltRemote adds the sync remote, skipping a name that is
// already taken.
func configureProxiedInitDoltRemote(ctx context.Context, provider uow.UnitOfWorkProvider, remoteURL string) error {
	return uow.RunTx(ctx, provider, func(ctx context.Context, uw uow.UnitOfWork) (string, error) {
		remotes, err := uw.DoltRemoteUseCase().ListRemotes(ctx)
		if err != nil {
			return "", fmt.Errorf("list remotes: %w", err)
		}
		for _, r := range remotes {
			if r.Name == "origin" {
				return "", nil
			}
		}
		if err := uw.DoltRemoteUseCase().CreateRemote(ctx, "origin", remoteURL); err != nil {
			return "", fmt.Errorf("create remote origin: %w", err)
		}
		return "", nil
	})
}

// adoptTeamServerIdentity reads the bts-provisioned identity out of the shared
// database, following the gateway contract: adopt if present, hard error if
// absent — bd never writes identity in team-server mode.
//
// ABSENT means "unprovisioned, tell them to run bts init" and UNREADABLE means

View on GitHub (pinned to 71377f2769)

Solutions

  1. Verify the proxied Dolt server is running and reachable, then retry bd init
  2. Confirm the configured Dolt database name exists (bts init provisions it)
  3. Check bd doctor output and the wrapped driver error for specifics
  4. If the database was healed with 'bts migrate', re-run bd init afterwards

Example fix

// before
err: "list remotes: database dolt_team not found"
// after: provision the shared db first, then init
bts init   # creates and provisions the database
bd init
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-check: the shared database exists and server responds
if err := pingDoltServer(serverAddr, dbName); err != nil {
    return fmt.Errorf("provision db with bts init first: %w", err)
}

Try / catch

if err != nil && strings.Contains(err.Error(), "list remotes:") {
    log.Printf("remote enumeration failed: %v", errors.Unwrap(err))
    // verify server up + db name correct, then retry init
}

Prevention

When it happens

Trigger: bd init in team-server mode where enumerating remotes from the shared Dolt database fails — server unreachable, database missing, or query error on the remotes table.

Common situations: Wrong database name in config pointing at a nonexistent Dolt database; proxied server not yet started when init runs; network partition to the team server.

Related errors


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