question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Azurite doesn't support Set Blob Tier operation on lease blob and snapshot blob.

See original GitHub issue

Error Description: In Azure, it will return error “BlobNotFound” when use Set Blob Tier operation with invalid leaseId or snapshot. But in Azurite, it will set blob tier successfully in this case. Azure error is shown as following: Screenshot 2020-11-23 112344

To Reproduce

import {
  BlobServiceClient
} from "@azure/storage-blob";
import * as assert from "assert"


async function main() {
  const blobServiceClient = await BlobServiceClient.fromConnectionString("Azurite-https-connectionString");
  const containerClient = await blobServiceClient.getContainerClient("<container-name>");
  const blockBlobClient = await containerClient.getBlockBlobClient("<blob-name>");
  const fakeVersion = "2020-04-23T03:21:50.5338150Z";
  const snapshotBlobClient = blockBlobClient.withSnapshot(fakeVersion);
  try{
    await snapshotBlobClient.setAccessTier("Cool");
  }catch(err){
    console.log(err);
    assert.ok((err as any).response.parsedBody.Code === "BlobNotFound");
  }
}

main();

Error Track: The reason maybe is that the parameter leaseId and snapshot are not be processed in Blob Set Tier handler method in azurite. The code is shown as following: https://github.com/Azure/Azurite/blob/master/src/blob/handlers/BlobHandler.ts#L872 Screenshot 2020-11-18 160216

Expected Behavior When use Set Blob Tier operation with invalid leaseId or snapshot, it doesn’t set blob tier successfully and return the error “BlobNotFound”.

@jongio for notification.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
bluewwcommented, Jan 4, 2021

@dennisdietrich Thanks for the information! We will priority the fix.

We welcome contribution to Azurite. It would be great if you could contribute the the fix of this issue.

0reactions
v-xutocommented, May 17, 2021

azsdk-azurite

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lease Blob (REST API) - Azure Storage | Microsoft Learn
The Lease Blob operation creates and manages a lock on a blob for write and delete operations.
Read more >
azurite - npm
A lightweight server clone of Azure Blob Storage that simulates most of the commands supported by it with minimal dependencies.
Read more >
Azure Blob Storage binding spec - Dapr Docs
This is useful when using the Azurite emulator or when using custom domains for Azure Storage (although this is not officially supported). The...
Read more >
AzureStor.pdf
Operations on an Azure Data Lake Storage Gen2 endpoint. Description ... A service SAS can be used with blob and file storage,.
Read more >
azure.storage.blob package - NET
If the container does not have an active lease, the Blob service creates a ... for the service, then this operation soft deletes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found