Tencent/WeKnora · error

list configs: %w

Error message

list configs: %w

What it means

Thrown in persistSpawnTemplateID when s.repo.ListByTenant fails while reconciling which sandbox configs reference the old vs new spawn template IDs. It aborts the persistence sweep because the full per-tenant config list is required before any updates are safe.

Source

Thrown at internal/application/service/tenant_sandbox_config.go:779

	tenantID uint64,
	merged *types.TenantSandboxConfig,
	newID string,
	oldIDs []string,
) error {
	newID = strings.TrimSpace(newID)
	if newID == "" || s == nil || s.repo == nil {
		return nil
	}
	old := make(map[string]struct{}, len(oldIDs))
	for _, id := range oldIDs {
		if id = strings.TrimSpace(id); id != "" {
			old[id] = struct{}{}
		}
	}
	identity := sandbox.IdentityOf(merged)
	list, err := s.repo.ListByTenant(ctx, tenantID)
	if err != nil {
		return fmt.Errorf("list configs: %w", err)
	}
	var persistErr error
	for _, entity := range list {
		if entity == nil || entity.Config == nil || types.IsSandboxWorkspacePolicyRow(entity) {
			continue
		}
		if sandbox.IdentityOf(entity.Config) != identity {
			continue
		}
		current := spawnTemplateID(entity.Config)
		if current == newID {
			continue
		}
		if current != "" {
			if _, pointedAtOld := old[current]; !pointedAtOld {
				continue
			}
		}

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Check repo connectivity/DB health for the tenant config store
  2. Retry ListByTenant; transient DB failures resolve on retry
  3. Verify tenantID exists and the tenant scoping is correct
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at internal/application/service/tenant_sandbox_config.go:779 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02). Data as JSON: /api/errors/bc84863e733dcf3f. Report an issue: GitHub.