Skip to content

Unable to upload file using "az batch file upload" on windows #135

@huiyee1

Description

@huiyee1

I was unable to upload file using az batch file upload. Below are the error message. What has I done wrong?

Describe the bug

Command Name
az batch file upload Extension Name: azure-batch-cli-extensions. Version: 6.0.0.

Errors:

The command failed with an unexpected error. Here is the traceback:
'NoneType' object has no attribute 'format'
Traceback (most recent call last):
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 658, in execute
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 713, in _run_job
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/batch/_exception_handler.py", line 28, in batch_exception_handler
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 692, in _run_job
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 328, in __call__
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
  File "C:\Users\Yong Hui Yee\.azure\cliextensions\azure-batch-cli-extensions\azext_batch\custom.py", line 205, in upload_file
    client.file.upload(local_path, file_group, remote_path=remote_path, flatten=flatten)
  File "C:\Users\Yong Hui Yee\.azure\cliextensions\azure-batch-cli-extensions\azext\batch\operations\file_operations.py", line 70, in upload
    file_utils.upload_blob(f, file_group, file_name, self.get_storage_client(),
  File "C:\Users\Yong Hui Yee\.azure\cliextensions\azure-batch-cli-extensions\azext\batch\batch_extensions_client.py", line 187, in _storage_account
    keys = storage_client.storage_accounts.list_keys(storage_resource_group, storage_account)
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/core/tracing/decorator.py", line 83, in wrapper_use_tracer
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/mgmt/storage/v2021_08_01/operations/_storage_accounts_operations.py", line 1197, in list_keys
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/core/pipeline/transport/_base.py", line 582, in format_url
AttributeError: 'NoneType' object has no attribute 'format'

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...
  • az batch file upload --local-path {} --file-group {} --account-name {} --account-endpoint {}

Expected Behavior

Environment Summary

Windows-10-10.0.18362-SP0
Python 3.8.9
Installer: MSI

azure-cli 2.34.1

Extensions:
azure-batch-cli-extensions 6.0.0

Dependencies:
msal 1.16.0
azure-mgmt-resource 20.0.0

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions