{"record":{"id":"e0c65a2fdbe8bc5f","repo":"Tencent/WeKnora","slug":"errskillsnapshotreleasefailed","errorCode":"ErrSkillSnapshotReleaseFailed","errorMessage":"%w: list snapshots: %v","messagePattern":"%w: list snapshots: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/service/tenant_sandbox_config.go","lineNumber":1177,"sourceCode":"\t}\n\treturn row.ID\n}\n\nfunc (s *TenantSandboxConfigService) releaseSkillSnapshots(\n\tctx context.Context,\n\tentity *types.TenantSandboxConfigEntity,\n\ttenantID uint64,\n\tconfigID string,\n\tforce bool,\n) error {\n\tif s.skills == nil {\n\t\treturn nil\n\t}\n\n\trows, err := s.skills.ListSnapshotsByConfig(ctx, tenantID, configID)\n\tif err != nil {\n\t\tif !force {\n\t\t\treturn fmt.Errorf(\"%w: list snapshots: %v\", ErrSkillSnapshotReleaseFailed, err)\n\t\t}\n\t\tlogger.Warnf(ctx,\n\t\t\t\"[sandbox] force-deleting config %s without listing skill snapshots: %v\",\n\t\t\tconfigID, err)\n\t}\n\n\tpending := pendingSkillSnapshots(rows)\n\tremaining := s.destroyPendingSnapshots(ctx, entity, pending)\n\tif len(remaining) > 0 && !force {\n\t\treturn &SkillSnapshotReleaseFailedError{Remaining: remaining}\n\t}\n\tif len(remaining) > 0 {\n\t\tlogger.Warnf(ctx,\n\t\t\t\"[sandbox] force-deleting config %s with unreleased snapshots %s\",\n\t\t\tconfigID, strings.Join(remaining, \", \"))\n\t}\n\n\ts.cleanupSkillMetadata(ctx, tenantID, configID)","sourceCodeStart":1159,"sourceCodeEnd":1195,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/service/tenant_sandbox_config.go#L1159-L1195","documentation":"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.","triggerScenarios":"Thrown at internal/application/service/tenant_sandbox_config.go:1177 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the skills service/backend so snapshots can be listed","Retry the delete without force once listing works","Use force only if orphaned snapshots are acceptable; clean them up manually"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}