Azure / azure-cli

Azure Command-Line Interface
MIT License
4.02k stars 2.99k forks source link

'NoneType' object has no attribute 'lower' #18445

Open yorek opened 3 years ago

yorek commented 3 years ago

Describe the bug

Got the following error while using the az sql db update command

Command Name az sql db update

Errors:

The command failed with an unexpected error. Here is the traceback:
'NoneType' object has no attribute 'lower'
Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 657, in execute
    raise ex
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 720, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 699, in _run_job
    result = transform_op(result)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/sql/_format.py", line 56, in __call__
    return self._transform_func(result)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/sql/_format.py", line 156, in db_transform
    result.backupStorageRedundancy = _get_external_backup_storage_redundancy(result.storage_account_type)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/sql/_format.py", line 406, in _get_external_backup_storage_redundancy
    }.get(self.lower(), 'Invalid')
AttributeError: 'NoneType' object has no attribute 'lower'

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

Expected Behavior

Environment Summary

Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-debian-bullseye-sid
Python 3.6.10
Installer: DEB

azure-cli 2.24.0 *

Extensions:
interactive 0.4.4
db-up 0.2.2

Additional Context

ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @azureSQLGitHub.

Issue Details
## Describe the bug Got the following error while using the az sql db update command **Command Name** `az sql db update` **Errors:** ``` The command failed with an unexpected error. Here is the traceback: 'NoneType' object has no attribute 'lower' Traceback (most recent call last): File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke cmd_result = self.invocation.execute(args) File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 657, in execute raise ex File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 720, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 699, in _run_job result = transform_op(result) File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/sql/_format.py", line 56, in __call__ return self._transform_func(result) File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/sql/_format.py", line 156, in db_transform result.backupStorageRedundancy = _get_external_backup_storage_redundancy(result.storage_account_type) File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/sql/_format.py", line 406, in _get_external_backup_storage_redundancy }.get(self.lower(), 'Invalid') AttributeError: 'NoneType' object has no attribute 'lower' ``` ## To Reproduce: Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information. - `az sql db update -g {} -n {} -s {} --ha-replicas {} --debug` ## Expected Behavior ## Environment Summary ``` Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-debian-bullseye-sid Python 3.6.10 Installer: DEB azure-cli 2.24.0 * Extensions: interactive 0.4.4 db-up 0.2.2 ``` ## Additional Context
Author: yorek
Assignees: -
Labels: `SQL`, `Service Attention`, `needs-triage`
Milestone: -
yonzhan commented 3 years ago

route to service team