gastownhall/beads · error
record last_import_time: %w
Error message
record last_import_time: %w
What it means
Wraps failure of cfg.SetMetadata(ctx, "last_import_time", ...) in the proxied-init tracking transaction. last_import_time marks when the clone last synced from the shared database; failing to record it aborts the init transaction. The message names the key; the wrapped error is the true cause.
Source
Thrown at cmd/bd/init_proxied_server.go:380
// write, a re-init on a shared database would silently stop recording them.
func recordProxiedInitTrackingState(ctx context.Context, provider uow.UnitOfWorkProvider, repoID, cloneID string) error {
return uow.RunTx(ctx, provider, func(ctx context.Context, uw uow.UnitOfWork) (string, error) {
cfg := uw.ConfigUseCase()
// An absent fingerprint is recorded as nothing rather than as "": an
// empty row reads back to cross-project verification as a clone whose
// fingerprint failed to compute.
if repoID != "" {
if err := cfg.SetMetadata(ctx, "repo_id", repoID); err != nil {
return "", fmt.Errorf("record repo_id: %w", err)
}
}
if cloneID != "" {
if err := cfg.SetMetadata(ctx, "clone_id", cloneID); err != nil {
return "", fmt.Errorf("record clone_id: %w", err)
}
}
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" {View on GitHub (pinned to 71377f2769)
Solutions
- Re-run bd init once the team server is reachable (the whole tracking transaction is retried atomically)
- Check server-side disk space and database health if the wrapped error indicates storage failure
- Inspect the wrapped cause for transaction timeout hints and reduce init duration or increase timeout
Example fix
// before err: "record last_import_time: context deadline exceeded" // after: raise the client timeout / fix latency, then retry bd init
Defensive patterns
Strategy: retry
Validate before calling
// verify server latency budget before a long init ctx, cancel := context.WithTimeout(context.Background(), initTimeout) defer cancel()
Try / catch
if err != nil && strings.Contains(err.Error(), "record last_import_time:") {
if errors.Is(err, context.DeadlineExceeded) {
// raise timeout or fix server latency, retry init
}
} Prevention
- Use generous init timeouts against remote team servers
- Monitor server disk space and database health
- Retry init — all bookkeeping writes happen in one atomic transaction
- Avoid re-running init during server maintenance windows
When it happens
Trigger: bd init in team-server mode where the final bookkeeping write of last_import_time fails — server unreachable, transaction aborted after the earlier writes, or storage error.
Common situations: Long-running init whose transaction expired before this write; transient network blip to the proxied server; disk-full or quota error on the database host.
Related errors
- record repo_id: %w
- record clone_id: %w
- list remotes: %w
- create remote origin: %w
- --team-server requires --proxied-server
AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30).
Data as JSON: /api/errors/5bca378223dbc0fe.
Report an issue: GitHub.