azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

az storage file upload-batch --dryrun - FAILED

Open pp185214 opened this issue 3 years ago • 12 comments
trafficstars

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az storage file upload-batch

Errors:

The command failed with an unexpected error. Here is the traceback:
expected str, bytes or os.PathLike object, not NoneType
Traceback (most recent call last):
  File "/usr/local/Cellar/azure-cli/2.38.0/libexec/lib/python3.10/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/local/Cellar/azure-cli/2.38.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/usr/local/Cellar/azure-cli/2.38.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/usr/local/Cellar/azure-cli/2.38.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/usr/local/Cellar/azure-cli/2.38.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/local/Cellar/azure-cli/2.38.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/usr/local/Cellar/azure-cli/2.38.0/libexec/lib/python3.10/site-packages/azure/cli/command_modules/storage/operations/file.py", line 181, in storage_file_upload_batch
    'dir_name': os.path.dirname(dst),
  File "/usr/local/Cellar/[email protected]/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/posixpath.py", line 152, in dirname
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType

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 storage file upload-batch --dryrun --destination {} --source {} --pattern {}

Expected Behavior

Environment Summary

macOS-12.3.1-x86_64-i386-64bit, Darwin 21.4.0
Python 3.10.5
Installer: HOMEBREW

azure-cli 2.38.0

Extensions:
azure-iot 0.14.1
account 0.2.1
scheduled-query 0.2.2

Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.1.0b1

Additional Context

pp185214 avatar Jul 15 '22 08:07 pp185214

storage

yonzhan avatar Jul 15 '22 09:07 yonzhan

Thank you for your feedback. This has been routed to the support team for assistance.

ghost avatar Jul 15 '22 09:07 ghost

@pp185214 We are unable to reproduce the issue using this command

az storage file upload-batch --destination <baseurl>/issue23216file --source . --account-key <accountkey> --pattern "*"

Can you share the pattern you used, the file type and the some sample names of those files? for us to reproduce the issue.

If possible the debug trace of the same.

RakeshMohanMSFT avatar Jul 15 '22 09:07 RakeshMohanMSFT

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

ghost avatar Jul 22 '22 14:07 ghost

@pp185214 We are unable to reproduce the issue using this command

az storage file upload-batch --destination <baseurl>/issue23216file --source . --account-key <accountkey> --pattern "*"

Can you share the pattern you used, the file type and the some sample names of those files? for us to reproduce the issue.

If possible the debug trace of the same.

I faced same issue and in my case --dryrun seems to be a problem. Author mentioned this parameter but I can't see it in your example.

mic-hnk avatar Aug 03 '22 17:08 mic-hnk

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

ghost avatar Aug 10 '22 20:08 ghost

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

ghost avatar Aug 21 '22 08:08 ghost

I've just encountered this. It is only an issue with --dry-run. The problem seems to be https://github.com/Azure/azure-cli/blob/374336ca6945d70b8caff756eb3e157a16238965/src/azure-cli/azure/cli/command_modules/storage/operations/file.py#L174-L183 as in --dry-run dst is unconditionally None. A quick change of line 179 to be dst = destination fixes this error but the az storage file batch-upload --dry-run command fails later on, so there's more wrong here

benbz avatar Aug 25 '22 08:08 benbz

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

ghost avatar Sep 01 '22 14:09 ghost

FTR this is still an issue for me in 2.40.0. Unsure what further information is required beyond the --dryrun flag is required to reproduce this, e.g. az storage file upload-batch --account-name <account name> --destination <a share name> --source <a local folder> --destination-path <a remote folder> --dryrun

benbz avatar Sep 16 '22 08:09 benbz

Will take a look this release cycle.

calvinhzy avatar Sep 18 '22 02:09 calvinhzy

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

ghost avatar Sep 25 '22 08:09 ghost

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

ghost avatar Oct 07 '22 14:10 ghost