Skip to content

az storage fs file list --recursive false error #17205

@Lixad

Description

@Lixad

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug
I am trying to get a list of files in my blob storage with az storage fs file list command, and i dont want to list files from subdirectories, so i am using --recursive false flag and saving it to a file. When it is executing command on azure pipline with azure CLI (version 1, inline script) it says:

2021-03-04T12:14:12.5157760Z ERROR: The command failed with an unexpected error. Here is the traceback:
2021-03-04T12:14:12.5158869Z ERROR: strptime() argument 1 must be str, not None
2021-03-04T12:14:12.5159589Z Traceback (most recent call last):
2021-03-04T12:14:12.5161370Z   File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 233, in invoke
2021-03-04T12:14:12.5162619Z     cmd_result = self.invocation.execute(args)
2021-03-04T12:14:12.5163989Z   File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 660, in execute
2021-03-04T12:14:12.5164836Z     raise ex
2021-03-04T12:14:12.5166102Z   File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 723, in _run_jobs_serially
2021-03-04T12:14:12.5167316Z     results.append(self._run_job(expanded_arg, cmd_copy))
2021-03-04T12:14:12.5168689Z   File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 715, in _run_job
2021-03-04T12:14:12.5169567Z     return cmd_copy.exception_handler(ex)
2021-03-04T12:14:12.5170886Z   File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/storage/__init__.py", line 352, in new_handler
2021-03-04T12:14:12.5171701Z     raise ex
2021-03-04T12:14:12.5172906Z   File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 694, in _run_job
2021-03-04T12:14:12.5173728Z     result = cmd_copy(params)
2021-03-04T12:14:12.5174992Z   File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 331, in __call__
2021-03-04T12:14:12.5176036Z     return self.handler(*args, **kwargs)
2021-03-04T12:14:12.5177364Z   File "/opt/az/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 808, in default_command_handler
2021-03-04T12:14:12.5178239Z     return op(**command_args)
2021-03-04T12:14:12.5179629Z   File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/storage/operations/fs_file.py", line 76, in list_fs_files
2021-03-04T12:14:12.5180502Z     result = next(pages)
2021-03-04T12:14:12.5181661Z   File "/opt/az/lib/python3.6/site-packages/azure/core/paging.py", line 84, in __next__
2021-03-04T12:14:12.5182605Z     self.continuation_token, self._current_page = self._extract_data(self._response)
2021-03-04T12:14:12.5184148Z   File "/opt/az/lib/python3.6/site-packages/azure/multiapi/storagev2/filedatalake/v2020_02_10/_list_paths_helper.py", line 61, in _extract_data_cb
2021-03-04T12:14:12.5185205Z     self.current_page = [self._build_item(item) for item in self.path_list]
2021-03-04T12:14:12.5186801Z   File "/opt/az/lib/python3.6/site-packages/azure/multiapi/storagev2/filedatalake/v2020_02_10/_list_paths_helper.py", line 61, in <listcomp>
2021-03-04T12:14:12.5187881Z     self.current_page = [self._build_item(item) for item in self.path_list]
2021-03-04T12:14:12.5189488Z   File "/opt/az/lib/python3.6/site-packages/azure/multiapi/storagev2/filedatalake/v2020_02_10/_list_paths_helper.py", line 70, in _build_item
2021-03-04T12:14:12.5191017Z     path = PathProperties._from_generated(item)  # pylint: disable=protected-access
2021-03-04T12:14:12.5192587Z   File "/opt/az/lib/python3.6/site-packages/azure/multiapi/storagev2/filedatalake/v2020_02_10/_models.py", line 215, in _from_generated
2021-03-04T12:14:12.5193853Z     path_prop.last_modified = datetime.strptime(generated.last_modified, "%a, %d %b %Y %H:%M:%S %Z")
2021-03-04T12:14:12.5194849Z TypeError: strptime() argument 1 must be str, not None

it was working until 10am (gmt+1) 4th march.

To Reproduce
create blob storage, create directory and subdirectory inside with some files, go to azure pipline create azure CLI task verion 1.0, inline script run command az storage fs file list --account-name xxx --account-key yyy -f dir --recursive false>list.txt

az storage blob upload --account-name xxx --account-key yyy -f list.txt -c dir -n list.txt

Expected behavior
It should save a list of files and directories inside dir directory in a file called list.txt

Environment summary
Azure pipline release,
agent job: ubuntu 16.04
task: azure CLI veriosn 1.0 inline script

Additional context
it was working until 10am (gmt+1) 4th march

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions