{"record":{"id":"4f33b2e0cb6cefff","repo":"weaviate/weaviate","slug":"can-t-pass-empty-shard-name","errorCode":null,"errorMessage":"can't pass empty shard name","messagePattern":"can't pass empty shard name","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/offload-s3/module.go","lineNumber":401,"sourceCode":"\t\t\treturn nil\n\t\t}\n\t}\n\treturn err\n}\n\n// Delete deletes content of a shard assigned to specific node in\n// cloud provider (S3, Azure Blob storage, Google cloud storage)\n// Careful: if shardName and nodeName is passed empty it will delete all class frozen shards in cloud storage\n// {cloud_provider}://{configured_bucket}/{className}/{shardName}/{nodeName}/{shard content}\nfunc (m *Module) Delete(ctx context.Context, className, shardName, nodeName string) error {\n\tstart := time.Now()\n\n\tif className == \"\" {\n\t\treturn fmt.Errorf(\"can't pass empty class name\")\n\t}\n\n\tif shardName == \"\" && nodeName != \"\" {\n\t\treturn fmt.Errorf(\"can't pass empty shard name\")\n\t}\n\n\tif nodeName == \"\" && shardName != \"\" {\n\t\treturn fmt.Errorf(\"can't pass empty node name\")\n\t}\n\n\tctx, cancel := context.WithTimeout(ctx, m.timeout)\n\tdefer cancel()\n\n\tcloudPath := fmt.Sprintf(\"s3://%s/%s/%s/%s/*\", m.Bucket, strings.ToLower(className), shardName, nodeName)\n\n\t// update cloud path on deleting a class\n\tif shardName == \"\" && nodeName == \"\" {\n\t\tcloudPath = fmt.Sprintf(\"s3://%s/%s/*\", m.Bucket, strings.ToLower(className))\n\t}\n\n\tcmd := []string{\n\t\tfmt.Sprintf(\"--endpoint-url=%s\", m.Endpoint),","sourceCodeStart":383,"sourceCodeEnd":419,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/modules/offload-s3/module.go#L383-L419","documentation":"Argument guard in Module.Delete: shardName is empty while nodeName is non-empty. That combination is ambiguous — deleting one node's copy of an unspecified shard — so it is rejected. (An empty shardName with an empty nodeName is the supported 'delete all frozen shards for the class' mode; this guard only fires when exactly the shard is missing.)","triggerScenarios":"Thrown at modules/offload-s3/module.go:401 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the shard name together with the node name to delete a specific node's shard copy","If deleting all frozen shards for the class is intended, leave both shardName and nodeName empty"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}