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.

copy blob status never changes from pending to success

See original GitHub issue

When trying to copy a blob from one container to another, the copy property status never changes from pending to success, even though blob gets correctly copied.

I’m using arafato/azurite:2.6.5 docker container, and here’s a simple Python script illustrating the problem:

import time

import azure.storage.blob


def main():

    azure_blob_config = {
        "account_name": "devstoreaccount1",
        "is_emulated": True,
        "account_key": 'Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=='
    }

    block_blob_service = azure.storage.blob.BlockBlobService(**azure_blob_config)

    source_container = "source"
    destination_container = "destination"
    blob_name = "some_blob.txt"

    block_blob_service.create_container(source_container)
    block_blob_service.create_container(destination_container)

    block_blob_service.create_blob_from_text(
        container_name="source", blob_name=blob_name, text="foo")

    source_blob_url = block_blob_service.make_blob_url(source_container, blob_name)
    copy_property = block_blob_service.copy_blob(destination_container, blob_name, source_blob_url)

    time.sleep(1)

    while copy_property.status != "success":

        print("Waiting for blob {} copy to finish...".format(blob_name))
        copy_property = block_blob_service.copy_blob(destination_container, blob_name, source_blob_url)
        time.sleep(1)

        print(copy_property.status)

    print(copy_property.status)


if __name__ == "__main__":
    main()

This code outputs a continuous stream of

Waiting for blob some_blob.txt copy to finish...
pending
Waiting for blob some_blob.txt copy to finish...
pending
Waiting for blob some_blob.txt copy to finish...
pending
Waiting for blob some_blob.txt copy to finish...
pending

when used with Azurite. The same code works without problems when changing azure_blob_config to point to a real azure storage container.

Here’s a sample Azurite’s output when running above code:

PUT /devstoreaccount1/destination/some_blob.txt 202 3.806 ms - 0
PUT /devstoreaccount1/destination/some_blob.txt 202 2.168 ms - 0
PUT /devstoreaccount1/destination/some_blob.txt 202 1.181 ms - 0
PUT /devstoreaccount1/destination/some_blob.txt 202 3.024 ms - 0
PUT /devstoreaccount1/destination/some_blob.txt 202 2.798 ms - 0
PUT /devstoreaccount1/destination/some_blob.txt 202 2.576 ms - 0
PUT /devstoreaccount1/destination/some_blob.txt 202 2.749 ms - 0

Is there some problem with my approach? Am I running into a limitation of the emulator?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
edwin-hubercommented, Oct 1, 2018

hi @kuba-lilz ,

thanks for reporting! There are still some features of the APIs which we have not implemented. We are currently looking at better options to address the API coverage.

I’ll mark this as an issue which we will hopefully get around to addressing.

0reactions
XiaoningLiucommented, Aug 7, 2019

Close this for legacy Azurite V2. Please use Azurite V3.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get Blob Properties (REST API) - Azure Storage
- success : Copy completed successfully. - pending : Copy is in progress. Check x-ms-copy-status-description if intermittent, non-fatal errors ...
Read more >
How to get updated copy state of azure blob when using blob ...
It can be one of the following: pending: Copy operation is pending. success: Copy operation completed successfully. aborted: Copy operation ...
Read more >
BlobGetPropertiesHeaders | @azure/storage-blob - NET
This header does not appear if a copy is pending, if this blob has never been the destination in a Copy Blob operation,...
Read more >
Introducing Asynchronous Cross-Account Copy Blob
When the copy operation is pending, any writes to the destination blob is disallowed and the write operation will fail with HTTP status...
Read more >
Copy Blobs With StartCopyFromBlob and Track its ...
When blobs fail to copy, they are usually listed in the destination container with a length of zero and a failed CopyState status....
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