Azure-cli: 'upload-batch' does not work well in 2.10.0

Created on 6 Aug 2020  路  7Comments  路  Source: Azure/azure-cli

I am using azure-cli in Ubuntu 16.04. After I upgrade the azure-cli from 2.9.1 to 2.10.0 this day, I get the following error when I use upload-batch.

FileNotFoundError: [Errno 2] No such file or directory: 'ximing'

in which, ximing is my container name.
But everything works well when I downgrade azure-cli to 2.9.1.
Do I miss something new in the 2.10.0 to correctly use the upload-batch ?

Storage

Most helpful comment

@Juliehzl is hotfixing this issue and will update shortly.

All 7 comments

Hitting this too:

# Fails as follows with azure-cli==2.10.0, does not fail with azure-cli==2.9.1

$ az storage blob upload-batch --source thesource/ --destination thecontainer --account-name theaccount --sas-token "thetoken"
The command failed with an unexpected error. Here is the traceback:
[Errno 2] No such file or directory: 'thecontainer'
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/knack/cli.py", line 215, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 654, in execute
    raise ex
  File "/usr/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 718, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/usr/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 709, in _run_job
    cmd_copy.exception_handler(ex)
  File "/usr/lib/python3.8/site-packages/azure/cli/command_modules/storage/__init__.py", line 325, in new_handler
    raise ex
  File "/usr/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 688, in _run_job
    result = cmd_copy(params)
  File "/usr/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 325, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/azure/cli/core/__init__.py", line 765, in default_command_handler
    return op(**command_args)
  File "/usr/lib/python3.8/site-packages/azure/cli/command_modules/storage/operations/blob.py", line 297, in storage_blob_upload_batch
    include, result = _upload_blob(cmd, client, destination_container_name,
  File "/usr/lib/python3.8/site-packages/azure/cli/command_modules/storage/util.py", line 225, in wrapper
    return True, func(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/azure/cli/command_modules/storage/operations/blob.py", line 281, in _upload_blob
    return upload_blob(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/azure/cli/command_modules/storage/operations/blob.py", line 451, in upload_blob
    return type_func[blob_type]()
  File "/usr/lib/python3.8/site-packages/azure/cli/command_modules/storage/operations/blob.py", line 444, in upload_block_blob
    return client.create_blob_from_path(**create_blob_args)
  File "/usr/lib/python3.8/site-packages/azure/multiapi/storage/v2018_11_09/blob/blockblobservice.py", line 453, in create_blob_from_path
    count = path.getsize(file_path)
  File "/usr/lib/python3.8/genericpath.py", line 50, in getsize
    return os.stat(filename).st_size
FileNotFoundError: [Errno 2] No such file or directory: 'thecontainer'
To open an issue, please run: 'az feedback'
ERROR: Job failed: exit code 1

add to S174

I can confirm. Running into the same issue with 2.10.0.

@Juliehzl is hotfixing this issue and will update shortly.

Hi all,
We just released hotfix version 2.10.1 and please see https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest for installation.
Homebrew for MacOS will be available tomorrow after the PR merged.

@Juliehzl @yonzhan Thank you!

Was this page helpful?
0 / 5 - 0 ratings