Azure / blobporter

Highly concurrent data transfer tool for Azure Blob Storage.
Other
85 stars 29 forks source link

Error trying to overwrite page blob with block blob in place. #111

Closed StandBackBurrito closed 4 years ago

StandBackBurrito commented 4 years ago

I am trying to convert some page blobs to block blobs without creating new blobs.

In my case the source and destination container (and blob for that matter) are the same.

The source blob is a page blob my expected outcome is that it is overwritten as a block blob

I get the same error when I attempt to copy a block blob from one container to another if a page blob with the same name already exists. If I delete the page blob I am then able to copy the block blob to the container.

 .\blobporter -f "https://mysourceaccount.blob.core.windows.net/container/myblob" -c container -t blob-blockblob
BlobPorter
Copyright (c) Microsoft Corporation.
Version: 0.6.20
---------------

Files to Transfer (blob-blockblob) :
Source: REDACTED Size:446562304
2019/11/23 01:17:35 -> github.com/Azure/azure-storage-blob-go/azblob.NewResponseError, /home/travis/gopath/pkg/mod/github.com/!azure/azure-storage-blob-go@v0.0.0-20190123011202-457680cc0804/azblob/zz_generated_response_error.go:29
===== RESPONSE ERROR (ServiceCode=InvalidBlobType) =====
Description=The blob type is invalid for this operation.
RequestId:b4d87af8-b01e-00af-1e9b-a1bf3b000000
Time:2019-11-23T01:17:35.9435519Z, Details:
   Code: InvalidBlobType
   PUT REDACTED
   Authorization: REDACTED
   Content-Length: [0]
   User-Agent: [BlobPorter/0.6.20/amd64/Azure-SDK-For-Go/0.0.0 azblob/2018-03-28 Azure-Storage/0.5 (go1.11; Windows_NT)]
   X-Ms-Client-Request-Id: [835fb44e-dcbf-469e-543d-3fe5539d71f1]
   X-Ms-Copy-Source: [REDACTED]
   X-Ms-Date: [Sat, 23 Nov 2019 01:17:35 GMT]
   X-Ms-Source-Range: [bytes=58720256-67108863]
   X-Ms-Version: [2018-03-28]
   --------------------------------------------------------------------------------
   RESPONSE Status: 409 The blob type is invalid for this operation.
   Content-Length: [228]
   Content-Type: [application/xml]
   Date: [Sat, 23 Nov 2019 01:17:35 GMT]
   Server: [Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0]
   X-Ms-Error-Code: [InvalidBlobType]
   X-Ms-Request-Id: [b4d87af8-b01e-00af-1e9b-a1bf3b000000]
   X-Ms-Version: [2018-03-28]
giventocode commented 4 years ago

The Azure Storage API does not support overwriting an existing blob with a blob of a different type.