{"record":{"id":"538175380d338806","repo":"weaviate/weaviate","slug":"get-tenant-status-for-s-s-w","errorCode":null,"errorMessage":"get tenant status for %s/%s: %w","messagePattern":"get tenant status for (.+?)/(.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"adapters/repos/db/export.go","lineNumber":321,"sourceCode":"\t\t\tos.RemoveAll(r.SnapshotDir)\n\t\t}\n\t}\n}\n\n// shouldSkipTenant checks the RAFT-based tenant status and returns a skip\n// reason if the tenant should not be exported. Returns (\"\", nil) if the\n// tenant is exportable. Active and cold/inactive tenants are always\n// exportable (cold tenants are snapshotted from disk without loading).\n// Only offloaded, frozen, and transitional states are skipped.\n//\n// Errors from the status lookup are returned as errors (not skip reasons)\n// so that the caller can fail the export rather than silently skipping\n// the tenant — a transient RAFT failure should not produce an incomplete\n// export.\nfunc (i *Index) shouldSkipTenant(class *models.Class, shardName string) (string, error) {\n\tstatuses, err := i.tenantsManager.TenantsStatus(class.Class, shardName)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"get tenant status for %s/%s: %w\", class.Class, shardName, err)\n\t}\n\tstatus := statuses[shardName]\n\n\tswitch status {\n\tcase models.TenantActivityStatusHOT, models.TenantActivityStatusACTIVE,\n\t\tmodels.TenantActivityStatusCOLD, models.TenantActivityStatusINACTIVE:\n\t\treturn \"\", nil\n\tdefault:\n\t\treturn fmt.Sprintf(\"tenant status is %s\", status), nil\n\t}\n}\n\n// snapshotLocalShardLocked snapshots a shard based on its local state.\n// The caller must hold shardCreateLocks.RLock(shardName) for the duration\n// of the call.\nfunc (i *Index) snapshotLocalShardLocked(\n\tctx context.Context, class *models.Class, isMT bool, shardName string,\n\tsnapshotsRoot, snapshotName string,","sourceCodeStart":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/repos/db/export.go#L303-L339","documentation":"During a multi-tenant collection export, Weaviate checks each tenant's activity status via the RAFT-managed tenantsManager before deciding whether to snapshot it. This error wraps any failure of that TenantsStatus lookup (e.g. RAFT/store errors), because a transient RAFT failure must fail the export rather than silently skipping the tenant and producing an incomplete export.","triggerScenarios":"Exporting (snapshotting) a multi-tenant collection when i.tenantsManager.TenantsStatus(class, shardName) returns an error — e.g. RAFT consensus unavailable, schema store read failure, or shard state store corruption.","commonSituations":"Cluster under RAFT leader election or network partition while running a tenant export; backup/snapshot jobs racing with tenant offload operations; schema store issues after node restart.","solutions":["Check RAFT cluster health (leader present, no elections) and retry the export","Verify the node's schema/tenant state store is readable and not corrupted","Retry the export after the transient cluster issue resolves; the error is deliberately fail-fast to avoid incomplete exports","If persistent, inspect logs of the underlying TenantsStatus error (wrapped via %w) for the root cause"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// before exporting, confirm RAFT health\nstatuses, err := client.Tenants.Get(collectionName)\nif err != nil { /* cluster state unavailable — postpone export */ }","typeGuard":null,"tryCatchPattern":"err := group.Go(func() error {\n  _, err := exportCollection(ctx, class)\n  if strings.Contains(err.Error(), \"get tenant status for\") {\n    // transient RAFT failure: back off and retry the whole export\n    return retryWithBackoff(exportCollection)\n  }\n  return err\n})","preventionTips":["Run exports when the RAFT cluster is stable (no elections, all voters up)","Retry exports automatically with backoff — the fail-fast design prevents incomplete exports","Monitor RAFT leader-change metrics and pause export jobs during churn"],"tags":["raft","multi-tenancy","export","snapshot"],"backgroundTag":"raft-consensus-unavailable","analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}