Tencent/WeKnora · error

ErrSkillSnapshotReleaseFailed

ErrSkillSnapshotReleaseFailed

Error message

%w: list snapshots: %v

What it means

Raised in releaseSkillSnapshots when ListSnapshotsByConfig fails during a non-forced config delete; ErrSkillSnapshotReleaseFailed is wrapped so the delete aborts rather than orphaning skill snapshots. In force mode the same failure is only logged and deletion proceeds.

Source

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

	}
	return row.ID
}

func (s *TenantSandboxConfigService) releaseSkillSnapshots(
	ctx context.Context,
	entity *types.TenantSandboxConfigEntity,
	tenantID uint64,
	configID string,
	force bool,
) error {
	if s.skills == nil {
		return nil
	}

	rows, err := s.skills.ListSnapshotsByConfig(ctx, tenantID, configID)
	if err != nil {
		if !force {
			return fmt.Errorf("%w: list snapshots: %v", ErrSkillSnapshotReleaseFailed, err)
		}
		logger.Warnf(ctx,
			"[sandbox] force-deleting config %s without listing skill snapshots: %v",
			configID, err)
	}

	pending := pendingSkillSnapshots(rows)
	remaining := s.destroyPendingSnapshots(ctx, entity, pending)
	if len(remaining) > 0 && !force {
		return &SkillSnapshotReleaseFailedError{Remaining: remaining}
	}
	if len(remaining) > 0 {
		logger.Warnf(ctx,
			"[sandbox] force-deleting config %s with unreleased snapshots %s",
			configID, strings.Join(remaining, ", "))
	}

	s.cleanupSkillMetadata(ctx, tenantID, configID)

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Fix the skills service/backend so snapshots can be listed
  2. Retry the delete without force once listing works
  3. Use force only if orphaned snapshots are acceptable; clean them up manually
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at internal/application/service/tenant_sandbox_config.go:1177 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/e0c65a2fdbe8bc5f. Report an issue: GitHub.