Azure / azure-devops-cli-extension

Azure DevOps Extension for Azure CLI
https://docs.microsoft.com/en-us/cli/azure/ext/azure-devops/?view=azure-cli-latest
MIT License
628 stars 241 forks source link

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

Open robunoki-microsoft opened 1 year ago

robunoki-microsoft commented 1 year ago

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az devops invoke Extension Name: azure-devops. Version: 0.26.0.

Errors:

The command failed with an unexpected error. Here is the traceback:
'NoneType' object has no attribute 'lower'
Traceback (most recent call last):
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 663, in execute
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 718, in _run_job
  File "C:\Users\robu\.azure\cliextensions\azure-devops\azext_devops\dev\common\exception_handler.py", line 31, in azure_devops_exception_handler
    reraise(*sys.exc_info())
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\six.py", line 719, in reraise
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 697, in _run_job
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 333, in __call__
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
  File "C:\Users\robu\.azure\cliextensions\azure-devops\azext_devops\dev\team\invoke.py", line 88, in invoke
    if (resource.lower() == resource_location.resource_name.lower() and
AttributeError: 'NoneType' object has no attribute 'lower'

To Reproduce:

I'm trying to run the following GET to return the list of pipelines.

Expected Behavior

Return list of pipelines

Environment Summary

Windows-10-10.0.22621-SP0
Python 3.10.8
Installer: MSI

azure-cli 2.45.0

Extensions:
azure-devops 0.26.0

Dependencies:
msal 1.20.0
azure-mgmt-resource 21.1.0b1

Additional Context

robunoki-microsoft commented 1 year ago

I needed to add --resource pipelines also. The error message was not helpful including the --debug output. Can we get a more informative error message?