Azure / azure-cli

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

Debug log shows: cli.azure.cli.core.extension: Unable to get extension experimental/preview status #17422

Open banibrata opened 3 years ago

banibrata commented 3 years ago

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

Describe the bug We are developing an extension for azure machine learning. It works fine, but while running a command with --debug I see a lot of messages like below: cli.azure.cli.core: Loading extensions: cli.azure.cli.core: Name Load Time Groups Commands Directory cli.azure.cli.core.extension: Unable to get extension preview status: Traceback (most recent call last): File "C:\Users\banide\Miniconda3\envs\py222\lib\site-packages\azure\cli\core\extension__init__.py", line 99, in preview self._preview = bool(self.metadata.get(EXT_METADATA_ISPREVIEW)) AttributeError: 'NoneType' object has no attribute 'get'

cli.azure.cli.core.extension: Unable to get extension experimental status: Traceback (most recent call last): File "C:\Users\banide\Miniconda3\envs\py222\lib\site-packages\azure\cli\core\extension__init__.py", line 112, in experimental self._experimental = bool(self.metadata.get(EXT_METADATA_ISEXPERIMENTAL)) AttributeError: 'NoneType' object has no attribute 'get'

cli.azure.cli.core.extension: Unable to get extension preview status: Traceback (most recent call last): File "C:\Users\banide\Miniconda3\envs\py222\lib\site-packages\azure\cli\core\extension__init__.py", line 99, in preview self._preview = bool(self.metadata.get(EXT_METADATA_ISPREVIEW)) AttributeError: 'NoneType' object has no attribute 'get'

cli.azure.cli.core.extension: Unable to get extension experimental status: Traceback (most recent call last): File "C:\Users\banide\Miniconda3\envs\py222\lib\site-packages\azure\cli\core\extension__init__.py", line 112, in experimental self._experimental = bool(self.metadata.get(EXT_METADATA_ISEXPERIMENTAL)) AttributeError: 'NoneType' object has no attribute 'get'

before eventually it gets to below after 108 times,

cli.azure.cli.core: machinelearningservices 0.377 10 54 C:\Users\banide\gitrepos\sdk-cli-v2\src\cli\src\machinelearningservices cli.azure.cli.core: Total (1) 0.377 10 54 cli.azure.cli.core: Loaded 10 groups, 54 commands. cli.azure.cli.core: Found a match in the command table. cli.azure.cli.core: Raw command : ml compute show cli.azure.cli.core: Command table: ml compute show cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x0000017C29E7F798>] az_command_data_logger: command args: ml compute show -n {} --debug

If this is the normal flow, I am worried , we could be wasting a some time in this stack flow. How to get rid of this flow?

for all our commands we have the command group like this:

with self.command_group("ml model", client_factory=cf_ml_cl, is_experimental=True) as g:

Is this not sufficient to make it experimental....?

To Reproduce

Expected behavior

Environment summary

Additional context

yungezz commented 3 years ago

cc @yonzhan