Skip to content

[BUG] NullPointerException calling BlobBatchClient.submitBatchWithResponse() #7256

Description

@lightningrob

Describe the bug
When calling BlobBatchClient.submitBatchWithResponse() containing a batch of deletions, throws the NPE below. This does not always happen, maybe 10% of the time.

Exception or Stack Trace
java.lang.NullPointerException
at com.azure.storage.blob.batch.BlobBatch.getContentLength(BlobBatch.java:339)
at com.azure.storage.blob.batch.BlobBatchAsyncClient.submitBatchWithResponse(BlobBatchAsyncClient.java:120)
at com.azure.storage.blob.batch.BlobBatchClient.submitBatchWithResponse(BlobBatchClient.java:87)
at com.github.ambry.cloud.azure.BatchBlobDeletionTest.purgeBlobs(BatchBlobDeletionTest.java:126)
at com.github.ambry.cloud.azure.BatchBlobDeletionTest.testBatchDeletion(BatchBlobDeletionTest.java:113)
at com.github.ambry.cloud.azure.BatchBlobDeletionTest.main(BatchBlobDeletionTest.java:66)

To Reproduce
Run the attached main class (executes in a loop) until the exception occurs.

Code Snippet
BlobBatch blobBatch = blobBatchClient.getBlobBatch();
List responseList = new ArrayList<>();
for (String blobName : blobNames) {
responseList.add(blobBatch.deleteBlob(containerName, blobName));
}
int purgeCount = 0;
blobBatchClient.submitBatchWithResponse(blobBatch, false, Duration.ofHours(1), Context.NONE);

Expected behavior
Expect the call to succeed.

Screenshots
N/A

Setup (please complete the following information):

  • OS: MacOS 10.15.2
  • IDE : IntelliJ
  • Version of the Library used: azure-storage-blob-12.0.0.jar

Additional context
Need to supply program with system property azure.storage.connection.string pointing to your Azure storage account.
Note: The same program sometimes fails with UnsupportedOperationException. (See issue #7255.)

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • [ x] Bug Description Added
  • [ x] Repro Steps Added
  • [x ] Setup information Added

BatchBlobDeletionTest.java.txt

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.StorageStorage Service (Queues, Blobs, Files)customer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions