Azure / Azure/Azurite

BlockBlob_StageBlock: Should fail on page blob

Open
#328 1 comment 0 reactions 1 assignee Claimed by @blueww View on GitHub
blob-storage bug NewArch
Dominant language
TypeScript
Stars
2.3k
Forks
393
Avg merge
1d 20h
Merged PRs (30d)
36

Description

### Which service(blob, file, queue, table) does this issue concern?
blob
### Which version of the Azurite was used?
3.3.0-preview
### Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)
VS code
### What's the Node.js version?
v10.15.3
### What problem was encountered?
BlockBlob_StageBlock Should fail on page blob, but now success
### Steps to reproduce the issue?
1. PageBlob_Create: Create a page blob
2. BlockBlob_StageBlock: stage block on the page blob

BlockBlob_StageBlock success, but it should fail
### Have you found a mitigation/solution?
No
Debug Log:
```
2019-12-17T10:11:44.978Z df4a6c8d-ca60-4439-9025-236a43cb9563 info: BlobStorageContextMiddleware: RequestMethod=PUT RequestURL=http://127.0.0.1/devstoreaccount1/testcc2ffa898d7db4954979e6cd4853f5fba/pb21b3ed65-5674-45db-8321-1a55558d64c0 RequestHeaders:{"x-ms-blob-type":"PageBlob","x-ms-blob-content-length":"0","x-ms-client-request-id":"3d041172-c83f-41cd-b0f5-694d1cf61518","user-agent":"Azure-Storage/11.1.1 (.NET Core; Win32NT 6.2.9200.0)","x-ms-version":"2019-02-02","x-ms-date":"Tue, 17 Dec 2019 10:11:44 GMT","authorization":"SharedKey devstoreaccount1:rLWbSJjvuby575mBN/m18jxo30lBJdHiZN4kHtIhVsU=","content-length":"0","host":"127.0.0.1:10000"} ClientIP=127.0.0.1 Protocol=http HTTPVersion=1.1
2019-12-17T10:11:44.978Z df4a6c8d-ca60-4439-9025-236a43cb9563 info: BlobStorageContextMiddleware: Account=devstoreaccount1 Container=testcc2ffa898d7db4954979e6cd4853f5fba Blob=pb21b3ed65-5674-45db-8321-1a55558d64c0
2019-12-17T10:11:44.979Z df4a6c8d-ca60-4439-9025-236a43cb9563 verbose: DispatchMiddleware: Dispatching request...
2019-12-17T10:11:44.980Z df4a6c8d-ca60-4439-9025-236a43cb9563 info: DispatchMiddleware: Operation=PageBlob_Create
2019-12-17T10:11:44.980Z df4a6c8d-ca60-4439-9025-236a43cb9563 verbose: AuthenticationMiddlewareFactory:createAuthenticationMiddleware() Validating authentications.
2019-12-17T10:11:44.981Z df4a6c8d-ca60-4439-9025-236a43cb9563 info: PublicAccessAuthenticator:validate() Start validation against public access.
2019-12-17T10:11:44.981Z df4a6c8d-ca60-4439-9025-236a43cb9563 debug: PublicAccessAuthenticator:validate() Getting account properties...
2019-12-17T10:11:44.982Z df4a6c8d-ca60-4439-9025-236a43cb9563 debug: PublicAccessAuthenticator:validate() Retrieved account name from context: devstoreaccount1, container: testcc2ffa898d7db4954979e6cd4853f5fba, blob: pb21b3ed65-5674-45db-8321-1a55558d64c0
2019-12-17T10:11:44.985Z df4a6c8d-ca60-4439-9025-236a43cb9563 debug: PublicAccessAuthenticator:validate() Skip public access authentication. Cannot get public access type for container testcc2ffa898d7db4954979e6cd4853f5fba
2019-12-17T10:11:44.985Z df4a6c8d-ca60-4439-9025-236a43cb9563 info: BlobSharedKeyAuthenticator:validate() Start validation against account shared key authentication.
2019-12-17T10:11:44.986Z df4a6c8d-ca60-4439-9025-236a43cb9563 info: BlobSharedKeyAuthenticator:validate() [STRING TO SIGN]:"PUT\n\n\n\n\n\n\n\n\n\n\n\nx-ms-blob-content-length:0\nx-ms-blob-type:PageBlob\nx-ms-client-request-id:3d041172-c83f-41cd-b0f5-694d1cf61518\nx-ms-date:Tue, 17 Dec 2019 10:11:44 GMT\nx-ms-version:2019-02-02\n/devstoreaccount1/devstoreaccount1/testcc2ffa898d7db4954979e6cd4853f5fba/pb21b3ed65-5674-45db-8321-1a55558d64c0"
2019-12-17T10:11:44.986Z df4a6c8d-ca60-4439-9025-236a43cb9563 info: BlobSharedKeyAuthenticator:validate() Calculated authentication header based on key1: SharedKey devstoreaccount1:rLWbSJjvuby575mBN/m18jxo30lBJdHiZN4kHtIhVsU=
2019-12-17T10:11:44.986Z df4a6c8d-ca60-4439-9025-236a43cb9563 info: BlobSharedKeyAuthenticator:validate() Signature 1 matched.
2019-12-17T10:11:44.986Z df4a6c8d-ca60-4439-9025-236a43cb9563 verbose: DeserializerMiddleware: Start deserializing...
2019-12-17T10:11:44.987Z df4a6c8d-ca60-4439-9025-236a43cb9563 info: HandlerMiddleware: DeserializedParameters={"options":{"metadata":{},"requestId":"3d041172-c83f-41cd-b0f5-694d1cf61518","blobHTTPHeaders":{},"leaseAccessConditions":{},"cpkInfo":{},"modifiedAccessConditions":{}},"contentLength":0,"blobContentLength":0,"version":"2019-02-02","blobType":"PageBlob"}
2019-12-17T10:11:44.989Z df4a6c8d-ca60-4439-9025-236a43cb9563 verbose: SerializerMiddleware: Start serializing...
2019-12-17T10:11:44.989Z df4a6c8d-ca60-4439-9025-236a43cb9563 info: EndMiddleware: End response. TotalTimeInMS=11 StatusCode=201 StatusMessage=undefined Headers={"server":"Azurite-Blob/3.3.0-preview","etag":"\"d-wEzF6Ix036NFcuG2YCi40XLWVLw\"","last-modified":"Tue, 17 Dec 2019 10:11:44 GMT","x-ms-client-request-id":"3d041172-c83f-41cd-b0f5-694d1cf61518","x-ms-request-id":"df4a6c8d-ca60-4439-9025-236a43cb9563","x-ms-version":"2019-02-02","date":"Tue, 17 Dec 2019 10:11:44 GMT","x-ms-request-server-encrypted":"true"}
2019-12-17T10:11:51.309Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 info: BlobStorageContextMiddleware: RequestMethod=PUT RequestURL=http://127.0.0.1/devstoreaccount1/testcc2ffa898d7db4954979e6cd4853f5fba/pb21b3ed65-5674-45db-8321-1a55558d64c0?comp=block&blockid=ekPikU%2BeqUmvoPmFIEka%2Fg%3D%3D RequestHeaders:{"x-ms-client-request-id":"cfa89ac2-cbaf-4606-a8d1-21450ea02081","user-agent":"Azure-Storage/11.1.1 (.NET Core; Win32NT 6.2.9200.0)","x-ms-version":"2019-02-02","x-ms-date":"Tue, 17 Dec 2019 10:11:51 GMT","authorization":"SharedKey devstoreaccount1:HauCD1yWizN4b8lX6eMdybfEKhNvZJo1gRZI3g77b8c=","content-length":"1","host":"127.0.0.1:10000"} ClientIP=127.0.0.1 Protocol=http HTTPVersion=1.1
2019-12-17T10:11:51.309Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 info: BlobStorageContextMiddleware: Account=devstoreaccount1 Container=testcc2ffa898d7db4954979e6cd4853f5fba Blob=pb21b3ed65-5674-45db-8321-1a55558d64c0
2019-12-17T10:11:51.310Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 verbose: DispatchMiddleware: Dispatching request...
2019-12-17T10:11:51.311Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 info: DispatchMiddleware: Operation=BlockBlob_StageBlock
2019-12-17T10:11:51.311Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 verbose: AuthenticationMiddlewareFactory:createAuthenticationMiddleware() Validating authentications.
2019-12-17T10:11:51.311Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 info: PublicAccessAuthenticator:validate() Start validation against public access.
2019-12-17T10:11:51.312Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 debug: PublicAccessAuthenticator:validate() Getting account properties...
2019-12-17T10:11:51.312Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 debug: PublicAccessAuthenticator:validate() Retrieved account name from context: devstoreaccount1, container: testcc2ffa898d7db4954979e6cd4853f5fba, blob: pb21b3ed65-5674-45db-8321-1a55558d64c0
2019-12-17T10:11:51.316Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 debug: PublicAccessAuthenticator:validate() Skip public access authentication. Cannot get public access type for container testcc2ffa898d7db4954979e6cd4853f5fba
2019-12-17T10:11:51.317Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 info: BlobSharedKeyAuthenticator:validate() Start validation against account shared key authentication.
2019-12-17T10:11:51.317Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 info: BlobSharedKeyAuthenticator:validate() [STRING TO SIGN]:"PUT\n\n\n1\n\n\n\n\n\n\n\n\nx-ms-client-request-id:cfa89ac2-cbaf-4606-a8d1-21450ea02081\nx-ms-date:Tue, 17 Dec 2019 10:11:51 GMT\nx-ms-version:2019-02-02\n/devstoreaccount1/devstoreaccount1/testcc2ffa898d7db4954979e6cd4853f5fba/pb21b3ed65-5674-45db-8321-1a55558d64c0\nblockid:ekPikU+eqUmvoPmFIEka/g==\ncomp:block"
2019-12-17T10:11:51.318Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 info: BlobSharedKeyAuthenticator:validate() Calculated authentication header based on key1: SharedKey devstoreaccount1:HauCD1yWizN4b8lX6eMdybfEKhNvZJo1gRZI3g77b8c=
2019-12-17T10:11:51.318Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 info: BlobSharedKeyAuthenticator:validate() Signature 1 matched.
2019-12-17T10:11:51.318Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 verbose: DeserializerMiddleware: Start deserializing...
2019-12-17T10:11:51.318Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 info: HandlerMiddleware: DeserializedParameters={"blockId":"ekPikU+eqUmvoPmFIEka/g==","options":{"requestId":"cfa89ac2-cbaf-4606-a8d1-21450ea02081","leaseAccessConditions":{},"cpkInfo":{}},"comp":"block","contentLength":1,"version":"2019-02-02","body":"ReadableStream"}
2019-12-17T10:11:51.321Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 debug: OperationQueue.operate() Schedule incoming job 544f16a0-2086-498c-975e-9ed4b06b2705
2019-12-17T10:11:51.321Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 debug: OperationQueue:execute() Current runningConcurrency:0 maxConcurrency:10 operations.length:1
2019-12-17T10:11:51.322Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 info: FSExtentStore:appendExtent() Select extent from idle location for extent append operation. LocationId:1 extentId:ed4afb3d-f78e-42f5-a41c-b8deb9af386b offset:3206176 MAX_EXTENT_SIZE:4194304
2019-12-17T10:11:51.322Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 debug: FSExtentStore:appendExtent() Get fd:4 for extent:ed4afb3d-f78e-42f5-a41c-b8deb9af386b from cache.
2019-12-17T10:11:51.322Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 debug: FSExtentStore:appendExtent() Start writing to extent ed4afb3d-f78e-42f5-a41c-b8deb9af386b
2019-12-17T10:11:51.323Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 debug: FSExtentStore:appendExtent() Write finish, start updating extent metadata. extent:{"id":"ed4afb3d-f78e-42f5-a41c-b8deb9af386b","persistencyId":"Default","path":"ed4afb3d-f78e-42f5-a41c-b8deb9af386b","size":3206177,"lastModifiedInMS":1576577511323}
2019-12-17T10:11:51.323Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 debug: FSExtentStore:appendExtent() Update extent metadata done. Resolve()
2019-12-17T10:11:51.323Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 debug: OperationQueue.operate() Job 544f16a0-2086-498c-975e-9ed4b06b2705 completes callback, resolve.
2019-12-17T10:11:51.326Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 verbose: SerializerMiddleware: Start serializing...
2019-12-17T10:11:51.326Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 info: EndMiddleware: End response. TotalTimeInMS=17 StatusCode=201 StatusMessage=undefined Headers={"server":"Azurite-Blob/3.3.0-preview","x-ms-client-request-id":"cfa89ac2-cbaf-4606-a8d1-21450ea02081","x-ms-request-id":"c20d525f-67d3-4ec5-a50b-c932ca9e2e20","x-ms-version":"2019-02-02","date":"Tue, 17 Dec 2019 10:11:51 GMT","x-ms-request-server-encrypted":"true"}
2019-12-17T10:11:51.327Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 debug: OperationQueue:execute() Current runningConcurrency:0 maxConcurrency:10 operations.length:0
2019-12-17T10:11:51.328Z c20d525f-67d3-4ec5-a50b-c932ca9e2e20 debug: OperationQueue:execute() return. Operation.length === 0

```

Test case:
```
Test Name: CloudBlockBlobMethodsOnPageBlob
Test FullName: Microsoft.Azure.Storage.Blob.CloudBlockBlobTest.CloudBlockBlobMethodsOnPageBlob
Test Source: C:\code\azure-storage-net\Test\ClassLibraryCommon\Blob\CloudBlockBlobTest.cs : line 4532
Test Outcome: Failed
Test Duration: 0:00:14.9095834

Result StackTrace:
at Microsoft.Azure.Storage.TestHelper.ExpectedException(Action operation, String operationDescription, HttpStatusCode expectedStatusCode, String requestErrorCode) in C:\code\azure-storage-net\Test\ClassLibraryCommon\TestHelper.cs:line 55
at Microsoft.Azure.Storage.Blob.CloudBlockBlobTest.CloudBlockBlobMethodsOnPageBlob() in C:\code\azure-storage-net\Test\ClassLibraryCommon\Blob\CloudBlockBlobTest.cs:line 4546
Result Message: Assert.Fail failed. No Storage exception received while expecting Conflict: Block operations should fail on page blobs

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.