gastownhall/beads · error

GetForIssueIDs (wisps): %w

Error message

GetForIssueIDs (wisps): %w

What it means

Wraps a failure from depRepo.ListByIssueIDs against the wisps table — but only for errors that are NOT dberrors.IsTableNotExist. A missing wisps table is tolerated (returns empty), so this error means a real failure occurred while reading wisp dependencies.

Source

Thrown at internal/storage/domain/dependency.go:493

func (u *dependencyUseCaseImpl) CountByIssueID(ctx context.Context, issueID string, filter DepListFilter) (int64, error) {
	return u.countByID(ctx, issueID, filter, false)
}

func (u *dependencyUseCaseImpl) GetForIssueIDs(ctx context.Context, ids []string) (map[string][]*types.Dependency, error) {
	if len(ids) == 0 {
		return map[string][]*types.Dependency{}, nil
	}
	issueRes, err := u.depRepo.ListByIssueIDs(ctx, ids, DepListOpts{Direction: DepDirectionOut})
	if err != nil {
		return nil, fmt.Errorf("GetForIssueIDs: %w", err)
	}
	out := issueRes.Outgoing
	if out == nil {
		out = make(map[string][]*types.Dependency)
	}
	wispRes, err := u.depRepo.ListByIssueIDs(ctx, ids, DepListOpts{Direction: DepDirectionOut, UseWispsTable: true})
	if err != nil && !dberrors.IsTableNotExist(err) {
		return nil, fmt.Errorf("GetForIssueIDs (wisps): %w", err)
	}
	for id, deps := range wispRes.Outgoing {
		out[id] = append(out[id], deps...)
	}
	return out, nil
}

func (u *dependencyUseCaseImpl) ListByWispIDs(ctx context.Context, wispIDs []string, filter DepListFilter) (DepBulkResult, error) {
	return u.list(ctx, wispIDs, filter, true)
}

func (u *dependencyUseCaseImpl) ListWispWithIssueMetadata(ctx context.Context, wispID string, filter DepListFilter) ([]*types.IssueWithDependencyMetadata, error) {
	return u.listWithMetadata(ctx, wispID, filter, true)
}

func (u *dependencyUseCaseImpl) IterWispWithIssueMetadata(ctx context.Context, wispID string, filter DepListFilter) (storage.Iter[types.IssueWithDependencyMetadata], error) {
	return u.iterWithMetadata(ctx, wispID, filter, true)
}

View on GitHub (pinned to 71377f2769)

Solutions

  1. Inspect the wrapped error; TableNotExist is intentionally filtered out so this is a genuine failure
  2. Verify wisps table schema matches the expected version
  3. Check DB connectivity and retry
  4. If the deployment should not have wisps, investigate why the table exists but fails
Defensive patterns

Strategy: try-catch

Validate before calling

// no pre-call validation available; ensure the deployment has a consistent wisps table state

Try / catch

out, err := u.GetForIssueIDs(ctx, ids)
if err != nil {
	// TableNotExist is already tolerated; anything here is a real failure
	log.Errorf("wisp dep lookup failed: %v", err)
	return err
}

Prevention

When it happens

Trigger: Calling GetForIssueIDs where the wisps-table ListByIssueIDs returns an error other than TableNotExist (e.g. connection failure, SQL error).

Common situations: Wisp table exists but is corrupt or locked; database connectivity problems; unexpected schema drift between versions where the table exists but columns differ.

Related errors


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