gastownhall/beads · error

GetEpicsEligibleForClosure: %w

Error message

GetEpicsEligibleForClosure: %w

What it means

Wrapped error from GetEpicsEligibleForClosure in the issue use-case layer. The repo query for epics whose children are all closed is delegated to issueRepo; any failure is prefixed with "GetEpicsEligibleForClosure: ". It signals a storage-layer failure, not a caller-input problem (the method takes no arguments).

Source

Thrown at internal/storage/domain/issue.go:1873

	out, err := u.issueRepo.IterEvents(ctx, id, limit)
	if err != nil {
		return nil, fmt.Errorf("IterEvents: %w", err)
	}
	return out, nil
}

func (u *issueUseCaseImpl) GetStaleIssues(ctx context.Context, filter types.StaleFilter) ([]*types.Issue, error) {
	out, err := u.issueRepo.GetStaleIssues(ctx, filter)
	if err != nil {
		return nil, fmt.Errorf("GetStaleIssues: %w", err)
	}
	return out, nil
}

func (u *issueUseCaseImpl) GetEpicsEligibleForClosure(ctx context.Context) ([]*types.EpicStatus, error) {
	out, err := u.issueRepo.GetEpicsEligibleForClosure(ctx)
	if err != nil {
		return nil, fmt.Errorf("GetEpicsEligibleForClosure: %w", err)
	}
	return out, nil
}

func (u *issueUseCaseImpl) Unclaim(ctx context.Context, id, actor string, force bool) error {
	if id == "" {
		return fmt.Errorf("Unclaim: id must not be empty")
	}
	if err := u.issueRepo.UnclaimIssue(ctx, id, actor, force); err != nil {
		return fmt.Errorf("Unclaim: %w", err)
	}
	return nil
}

// UnclaimIfAssignee is the compare-and-swap release: it clears the claim only
// while the issue is still assigned to expectedAssignee, and otherwise returns
// storage.ErrAssigneeMismatch having written nothing. It is the conditional
// twin of Unclaim and runs the SAME transition (assignee cleared, status

View on GitHub (pinned to 71377f2769)

Solutions

  1. Unwrap the error to find the underlying repository cause
  2. Check database connectivity and schema integrity
  3. Retry the sweep if the underlying error is transient
Defensive patterns

Strategy: retry

Try / catch

epics, err := uc.GetEpicsEligibleForClosure(ctx)
if err != nil {
	if isTransient(err) {
		return retryWithBackoff(op)
	}
	return err
}

Prevention

When it happens

Trigger: Calling GetEpicsEligibleForClosure(ctx) when the repository query fails: database unavailable, schema/query error, or transaction conflict.

Common situations: Running epic-closure sweeps in scripts or hooks while the Dolt database is down or the schema is being migrated.

Related errors


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