{"record":{"id":"9a66d35dc3c41396","repo":"AlistGo/alist","slug":"failed-to-add-delete-operation-for-s-w","errorCode":null,"errorMessage":"failed to add delete operation for %s: %w","messagePattern":"failed to add delete operation for (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/azure_blob/util.go","lineNumber":105,"sourceCode":"\tif len(blobPaths) == 0 {\n\t\treturn nil\n\t}\n\n\t// Process in batches of MaxBatchSize\n\tfor i := 0; i < len(blobPaths); i += MaxBatchSize {\n\t\tend := min(i+MaxBatchSize, len(blobPaths))\n\t\tcurrentBatch := blobPaths[i:end]\n\n\t\t// Create batch builder\n\t\tbatchBuilder, err := d.containerClient.NewBatchBuilder()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to create batch builder: %w\", err)\n\t\t}\n\n\t\t// Add delete operations\n\t\tfor _, blobPath := range currentBatch {\n\t\t\tif err := batchBuilder.Delete(blobPath, nil); err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to add delete operation for %s: %w\", blobPath, err)\n\t\t\t}\n\t\t}\n\n\t\t// Submit batch\n\t\tresponses, err := d.containerClient.SubmitBatch(ctx, batchBuilder, nil)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"batch delete request failed: %w\", err)\n\t\t}\n\n\t\t// Check responses\n\t\tfor _, resp := range responses.Responses {\n\t\t\tif resp.Error != nil && !isNotFoundError(resp.Error) {\n\t\t\t\t// 获取 blob 名称以提供更好的错误信息\n\t\t\t\tblobName := \"unknown\"\n\t\t\t\tif resp.BlobName != nil {\n\t\t\t\t\tblobName = *resp.BlobName\n\t\t\t\t}\n\t\t\t\treturn fmt.Errorf(\"failed to delete blob %s: %v\", blobName, resp.Error)","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/AlistGo/alist/blob/843d9dc8149126976b2625911e45a4d3ffd6f2f5/drivers/azure_blob/util.go#L87-L123","documentation":"Error \"failed to add delete operation for %s: %w\" thrown in AlistGo/alist.","triggerScenarios":"Thrown at drivers/azure_blob/util.go:105 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the underlying error details in the message, fix the indicated cause (credentials, network, or provider-side failure), and retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"843d9dc8149126976b2625911e45a4d3ffd6f2f5","analyzedAt":"2026-08-15T12:14:11.722Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}