{"record":{"id":"3e7ad997c7fe2b77","repo":"Tencent/WeKnora","slug":"errsandboxinventoryunverifiable","errorCode":"ErrSandboxInventoryUnverifiable","errorMessage":"%w: %v","messagePattern":"%w: %v","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/service/tenant_sandbox_config.go","lineNumber":1058,"sourceCode":"func (s *TenantSandboxConfigService) Delete(\n\tctx context.Context, tenantID uint64, id string, force bool,\n) error {\n\tentity, err := s.repo.GetByID(ctx, tenantID, id)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Reporting success for a config that is not there would let the UI drop a\n\t// card the workspace still has, so absence is an explicit 404.\n\tif entity == nil {\n\t\treturn apperrors.NewNotFoundError(\"sandbox config not found\")\n\t}\n\tif types.IsSandboxWorkspacePolicyRow(entity) {\n\t\treturn apperrors.NewBadRequestError(\"workspace policy cannot be deleted here\")\n\t}\n\tsummaries, listErr := s.listSandboxes(ctx, entity.Config, tenantID, id)\n\tif listErr != nil {\n\t\tif !force {\n\t\t\treturn fmt.Errorf(\"%w: %v\", ErrSandboxInventoryUnverifiable, listErr)\n\t\t}\n\t\tlogger.Warnf(ctx,\n\t\t\t\"[sandbox] force-deleting config %s without verifying its sandboxes: %v\",\n\t\t\tid, listErr)\n\t}\n\tif len(summaries) > 0 {\n\t\tinv := s.inventoryFromSummaries(ctx, tenantID, id, summaries)\n\t\treturn &SandboxesStillLiveError{Inventory: inv}\n\t}\n\tif err := s.releaseSkillSnapshots(ctx, entity, tenantID, id, force); err != nil {\n\t\treturn err\n\t}\n\treturn s.repo.SoftDelete(ctx, tenantID, id)\n}\n\nfunc snapshotReleaserFrom(client sandbox.ConfigSandboxClient) (sandboxSnapshotReleaser, bool) {\n\tif client == nil {\n\t\treturn nil, false","sourceCodeStart":1040,"sourceCodeEnd":1076,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/service/tenant_sandbox_config.go#L1040-L1076","documentation":"Generic wrapper in TenantSandboxConfigService.Delete: the underlying error (from listSandboxes) is wrapped with context so the caller knows deletion failed while enumerating active sandboxes that still reference the config. The config is not deleted.","triggerScenarios":"Thrown at internal/application/service/tenant_sandbox_config.go:1058 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error to see why sandbox listing failed","Fix the dependency that blocked listSandboxes (DB, sandbox service)","Retry Delete once the listing dependency recovers"],"exampleFix":null,"handlingStrategy":"try-catch","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-08T15:18:49.778Z"}