Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] GetPropertiesAsync fails in Firefox with TypeError: e.body is null #47865

Open
hectorm-bmg opened this issue Jan 16, 2025 · 1 comment
Open
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)

Comments

@hectorm-bmg
Copy link

Library name and version

Azure.Storage.Blobs, Version=12.22.2.0

Describe the bug

From a Blazor Client side project, when I call the following:

var props = await blobClient.GetPropertiesAsync();

Firefox fails with the following error:
TypeError: e.body is null

Other browsers work as expected and I can see the properties for my blob.

Expected behavior

The properties for the blob are returned to be use as needed.

Actual behavior

In Firefox, an exception is generated with the error message :

TypeError: e.body is null

Reproduction Steps

  • Create a SAS write uri for a new blob
  • Get a SAS url for the blob
  • Use the following method to upload the new blob from a blazor client side app running in Firefox. You'll notice that the call to GetPropertiesAsync will fail as described above.

'
public async Task UploadStream(string blobName, Stream stream, Uri sasTokenUri, long totalSize)
{
var containerClient = new BlobContainerClient(sasTokenUri);

var blobClient = containerClient.GetBlockBlobClient(blobName);

var blockIds = new List<string>();

var buffer = new byte[MaxChunkSize];
int bytesRead;
int blockNumber = 0;

var totalChunks = (totalSize / MaxChunkSize) + 1;

while ((bytesRead = await stream.ReadAsync(buffer, 0, buffer.Length)) > 0)
{
    Logger.LogInformation($"Uploading block {blockNumber}/{totalChunks} for {blobName}.");

    string blockId = Convert.ToBase64String(Encoding.UTF8.GetBytes($"{blockNumber:D6}"));
    blockIds.Add(blockId);

    // Upload the block
    using var chunkStream = new MemoryStream(buffer, 0, bytesRead);
    await blobClient.StageBlockAsync(blockId, chunkStream);

    blockNumber++;
}

// Commit the blocks
await blobClient.CommitBlockListAsync(blockIds);

var props = await blobClient.GetPropertiesAsync();

while (props != null && props.Value.ContentLength < totalSize)
{
    // Check that the file has finished uploading.
    await Task.Delay(5000);
    Console.WriteLine($"Waiting for blob {blobName} to finish uploading.");
    props = await blobClient.GetPropertiesAsync();
}

}
'

Environment

Blazor App running in an Azure App Service using .net 8.0
Version 8.0.405

Visual Studio 2022 17.12.3

@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files) labels Jan 16, 2025
Copy link

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

1 participant