Skip to content

Unable to upload files using "az batch file upload" on ubuntu #136

@huiyee1

Description

@huiyee1

This is autogenerated. Please review and update as needed.

Hi, all. I was unable to upload file using "az batch file upload". I got the following error. Do you have solution on this issue?

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 "/opt/az/lib/python3.8/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 658, in execute
    raise ex
  File "/opt/az/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/az/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 713, in _run_job
    return cmd_copy.exception_handler(ex)
  File "/opt/az/lib/python3.8/site-packages/azure/cli/command_modules/batch/_exception_handler.py", line 28, in batch_exception_handler
    raise ex
  File "/opt/az/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 692, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.8/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/home/huiyee/.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 "/home/huiyee/.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 "/home/huiyee/.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 "/opt/az/lib/python3.8/site-packages/azure/core/tracing/decorator.py", line 83, in wrapper_use_tracer
    return func(*args, **kwargs)
  File "/opt/az/lib/python3.8/site-packages/azure/mgmt/storage/v2021_08_01/operations/_storage_accounts_operations.py", line 1197, in list_keys
    request.url = self._client.format_url(request.url)
  File "/opt/az/lib/python3.8/site-packages/azure/core/pipeline/transport/_base.py", line 582, in format_url
    base = self._base_url.format(**kwargs).rstrip("/")
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

Linux-5.13.0-1017-azure-x86_64-with-glibc2.29, Ubuntu 20.04.3 LTS
Python 3.8.12
Installer: DEB

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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions