Azure / Azure/azure-cli

AttributeError: 'AzureStorageJobTaskDetails' object has no attribute 'start_time' when checking Azure Files backup job status

Open
#31,946 4 comments 0 reactions 0 assignees View on GitHub
act-observability-squad Auto-Assign bug customer-reported Recovery Services Backup Service Attention Similar-Issue
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### Describe the bug

When checking the status of an Azure Files backup job using `az backup job show`, the command fails with an AttributeError indicating that 'AzureStorageJobTaskDetails' object has no attribute 'start_time'.

### Related command

az backup job show

### Errors

AttributeError: 'AzureStorageJobTaskDetails' object has no attribute 'start_time'.

Full traceback:
File "/opt/homebrew/Cellar/azure-cli/2.76.0/libexec/lib/python3.12/site-packag
es/azure/cli/command_modules/backup/custom_help.py", line 341, in
replace_min_value_in_subtask
if task.start_time == datetime.min:
^^^^^^^^^^^^^^^
AttributeError: 'AzureStorageJobTaskDetails' object has no attribute
'start_time'

### Issue script & Debug output

The error occurs when monitoring Azure Files backup jobs. The replace_min_value_in_subtask function assumes all task objects have start_time attribute, but AzureStorageJobTaskDetails doesn't.

### Expected behavior

The command should successfully return the backup job status for Azure Files without AttributeError.

### Environment Summary

macOS, azure-cli 2.76.0, Python 3.12 (Homebrew installation)

azure-cli 2.76.0

core 2.76.0
telemetry 1.1.0

Extensions:
dataprotection 1.6.0
k8s-extension 1.6.7

Dependencies:
msal 1.33.0b1
azure-mgmt-resource 23.3.0

Python location '/opt/homebrew/Cellar/azure-cli/2.76.0/libexec/bin/python'
Config directory '/Users/shreyashvaish/.azure'
Extensions directory '/Users/shreyashvaish/.azure/cliextensions'

Python (Darwin) 3.12.11 (main, Jun 3 2025, 15:41:47) [Clang 17.0.0 (clang-1700.0.13.3)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

### Additional context

The code at line 341 in custom_help.py needs to check if the attribute exists before accessing it: if hasattr(task, 'start_time') and task.start_time == datetime.min:

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.