azure-cli: AZ Storage Blob copy show fails on azurestack

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az storage blob show

Errors:

There is currently a pending copy operation.ErrorCode: PendingCopyOperation
<?xml version="1.0" encoding="utf-8"?><Error><Code>PendingCopyOperation</Code><Message>There is currently a pending copy operation.
RequestId:b7bc4247-4367-0190-64d5-81944a675031
Time:2019-08-06T04:44:05.8281636Z</Message></Error>
Traceback (most recent call last):
cli/command_modules/storage/__init__.py, ln 240, in new_handler
    handler(ex)
cli/command_modules/storage/__init__.py, ln 180, in handler
    if isinstance(ex, t_error) and ex.status_code == 409 and ex.error_code == 'NoPendingCopyOperation':
AttributeError: 'AzureConflictHttpError' object has no attribute 'error_code'

...

<?xml version="1.0" encoding="utf-8"?><Error><Code>PendingCopyOperation</Code><Message>There is currently a pending copy operation.
RequestId:b7bc4247-4367-0190-64d5-81944a675031
Time:2019-08-06T04:44:05.8281636Z</Message></Error>

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here…
  • Start a storage blob copy from azure to AzureStack
  • az storage blob show --account-name {} --container-name {} --name {} --output {}

Expected Behavior

Environment Summary

Darwin-18.7.0-x86_64-i386-64bit
Python 3.7.3
Shell: bash

azure-cli 2.0.67 *

Additional Context

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 17 (5 by maintainers)

Commits related to this issue

Most upvoted comments

Not fixed, latest version using Azure CLI (from azure portal), I am getting something like the below:

There is currently a pending copy operation. RequestId:733e7141-b01e-002b-76f9-7b3689000000 Time:2024-03-22T01:36:43.8769772Z ErrorCode:PendingCopyOperation

This is a cross region copy just for reference. This error is intermittent, sometimes it returns the status and info, sometimes it doesn’t and throws the above.

I have multiple copies running so checking status is vital.

Problem here is that I need to query the ongoing status for AzureStack deployed Systems where need to copy blobs from Azure to Azurestack.

Expected Behaviour, verified on Azure

az storage blob show --account-name opsmanagerimage --container-name images --name ops-manager-2.6.6-build-test.179.vhd --query '[properties.copy.status]'
[
  "pending"
]

Actual Behaviour on AzureStack:

az storage blob show --account-name opsmanagerimage --container-name images --name ops-manager-2.6.6-build-test.179.vhd --query '[properties.copy.status]'
The command failed with an unexpected error. Here is the traceback:

There is currently a pending copy operation.ErrorCode: PendingCopyOperation
<?xml version="1.0" encoding="utf-8"?><Error><Code>PendingCopyOperation</Code><Message>There is currently a pending copy operation.
RequestId:badf56da-0a7c-0712-4c03-1f600259469f
Time:2019-08-06T08:26:45.6761485Z</Message></Error>
Traceback (most recent call last):
  File "/usr/local/Cellar/azure-cli/2.0.70/libexec/lib/python3.7/site-packages/azure/cli/command_modules/storage/__init__.py", line 248, in new_handler
    handler(ex)
  File "/usr/local/Cellar/azure-cli/2.0.70/libexec/lib/python3.7/site-packages/azure/cli/command_modules/storage/__init__.py", line 188, in handler
    if isinstance(ex, t_error) and ex.status_code == 409 and ex.error_code == 'NoPendingCopyOperation':
AttributeError: 'AzureConflictHttpError' object has no attribute 'error_code'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/azure-cli/2.0.70/libexec/lib/python3.7/site-packages/knack/cli.py", line 206, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/local/Cellar/azure-cli/2.0.70/libexec/lib/python3.7/site-packages/azure/cli/core/commands/__init__.py", line 603, in execute
    raise ex
  File "/usr/local/Cellar/azure-cli/2.0.70/libexec/lib/python3.7/site-packages/azure/cli/core/commands/__init__.py", line 661, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/usr/local/Cellar/azure-cli/2.0.70/libexec/lib/python3.7/site-packages/azure/cli/core/commands/__init__.py", line 652, in _run_job
    cmd_copy.exception_handler(ex)
  File "/usr/local/Cellar/azure-cli/2.0.70/libexec/lib/python3.7/site-packages/azure/cli/command_modules/storage/__init__.py", line 252, in new_handler
    first(ex)
  File "/usr/local/Cellar/azure-cli/2.0.70/libexec/lib/python3.7/site-packages/azure/cli/core/commands/arm.py", line 750, in show_exception_handler
    raise ex
  File "/usr/local/Cellar/azure-cli/2.0.70/libexec/lib/python3.7/site-packages/azure/cli/core/commands/__init__.py", line 631, in _run_job
    result = cmd_copy(params)
  File "/usr/local/Cellar/azure-cli/2.0.70/libexec/lib/python3.7/site-packages/azure/cli/core/commands/__init__.py", line 305, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/local/Cellar/azure-cli/2.0.70/libexec/lib/python3.7/site-packages/azure/cli/core/__init__.py", line 485, in default_command_handler
    return op(**command_args)
  File "/usr/local/Cellar/azure-cli/2.0.70/libexec/lib/python3.7/site-packages/azure/cli/command_modules/storage/operations/blob.py", line 375, in show_blob
    if_unmodified_since=if_unmodified_since, if_match=if_match, if_none_match=if_none_match, timeout=timeout)
  File "/usr/local/Cellar/azure-cli/2.0.70/libexec/lib/python3.7/site-packages/azure/multiapi/storage/v2017_11_09/blob/pageblobservice.py", line 558, in get_page_ranges
    return self._perform_request(request, _convert_xml_to_page_ranges)
  File "/usr/local/Cellar/azure-cli/2.0.70/libexec/lib/python3.7/site-packages/azure/multiapi/storage/v2017_11_09/common/storageclient.py", line 370, in _perform_request
    raise ex
  File "/usr/local/Cellar/azure-cli/2.0.70/libexec/lib/python3.7/site-packages/azure/multiapi/storage/v2017_11_09/common/storageclient.py", line 305, in _perform_request
    raise ex
  File "/usr/local/Cellar/azure-cli/2.0.70/libexec/lib/python3.7/site-packages/azure/multiapi/storage/v2017_11_09/common/storageclient.py", line 291, in _perform_request
    HTTPError(response.status, response.message, response.headers, response.body))
  File "/usr/local/Cellar/azure-cli/2.0.70/libexec/lib/python3.7/site-packages/azure/multiapi/storage/v2017_11_09/common/_error.py", line 111, in _http_error_handler
    raise AzureHttpError(message, http_error.status)
azure.common.AzureConflictHttpError: There is currently a pending copy operation.ErrorCode: PendingCopyOperation
<?xml version="1.0" encoding="utf-8"?><Error><Code>PendingCopyOperation</Code><Message>There is currently a pending copy operation.
RequestId:badf56da-0a7c-0712-4c03-1f600259469f
Time:2019-08-06T08:26:45.6761485Z</Message></Error>

To open an issue, please run: 'az feedback'

this brings a whole burden on scrtipting, as i need o query for until “success”, wich may never come back when status is like “connection reset by peer” or “failed”