Azure / Azure/azure-cli

Failure of `az spring connection list --app app-name` with `'Namespace' object has no attribute 'opt_out_list'`

Open
#29,001 8 comments 0 reactions 0 assignees View on GitHub
Auto-Resolve bug customer-reported Service Attention Similar-Issue Spring-Cloud
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### Describe the bug

I am trying to list a connection for Azure Spring Apps, through Azure CLI 2.60.0.

It seems we introduced a bug in Azure CLI 2.60.0, because this works in Azure CLI 2.59.0

### Related command

`az spring connection list --app catalog-service`

### Errors

`'Namespace' object has no attribute 'opt_out_list'`

### Issue script & Debug output

cli.knack.cli: Command arguments: ['spring', 'connection', 'list', '--app', 'catalog-service', '--debug']
cli.knack.cli: __init__ debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [, , ]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'spring': ['azure.cli.command_modules.serviceconnector', 'azext_serviceconnector_passwordless', 'azext_spring']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: serviceconnector 0.305 24 354
cli.azure.cli.core: Total (1) 0.305 24 354
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name Load Time Groups Commands Directory
cli.azure.cli.core: ai-examples 0.089 1 1 /usr/lib/python3.9/site-packages/azure-cli-extensions/ai-examples
cli.azure.cli.core: serviceconnector-passwordless 0.084 17 24 /home/neven/.azure/cliextensions/serviceconnector-passwordless
cli.azure.cli.core: spring 0.300 46 206 /home/neven/.azure/cliextensions/spring
cli.azure.cli.core: Total (3) 0.474 64 231
cli.azure.cli.core: Loaded 70 groups, 561 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : spring connection list
cli.azure.cli.core: Command table: spring connection list
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate []
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/neven/.azure/commands/2024-05-21.19-40-06.spring_connection_list.4102.log'.
az_command_data_logger: command args: spring connection list --app {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [.add_subscription_parameter at 0x7f2263611310>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [.add_ids_arguments at 0x7f226363a310>, .add_cache_arguments at 0x7f22635da1f0>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [, , .parse_ids_arguments at 0x7f22635da160>]
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "/usr/lib64/az/lib/python3.9/site-packages/knack/invocation.py", line 113, in _validation
self._validate_arg_level(parsed_ns)
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 898, in _validate_arg_level
validator(**self._build_kwargs(validator, ns))
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/serviceconnector/_validators.py", line 875, in validate_params
_validate_and_apply(validate_list_params, apply_list_params)
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/serviceconnector/_validators.py", line 870, in _validate_and_apply
arg_values = intelligent_experience(cmd, namespace, missing_args)
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/serviceconnector/_validators.py", line 307, in intelligent_experience
if opt_out_auth(namespace):
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/serviceconnector/_validators.py", line 289, in opt_out_auth
opt_out_list = namespace.opt_out_list
AttributeError: 'Namespace' object has no attribute 'opt_out_list'

cli.azure.cli.core.azclierror: 'Namespace' object has no attribute 'opt_out_list'
az_command_data_logger: 'Namespace' object has no attribute 'opt_out_list'
cli.knack.cli: Event: Cli.PostExecute []
az_command_data_logger: exit code: 2
cli.__main__: Command ran in 1.067 seconds (init: 0.188, invoke: 0.879)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 3838 in cache
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/usr/bin/python3.9 /usr/lib/az/lib/python3.9/site-packages/azure/cli/telemetry/__init__.py /home/neven/.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.

### Expected behavior

I am expected to show the list of all service connectors as in previous versions of Azure CLI.

### Environment Summary

azure-cli 2.60.0 *

core 2.60.0 *
telemetry 1.1.0

Extensions:
ai-examples 0.2.5
ml 2.25.1
serviceconnector-passwordless 2.0.2
spring 1.24.3
ssh 2.0.3

Dependencies:
msal 1.28.0
azure-mgmt-resource 23.1.0b2

Python location '/usr/bin/python3.9'
Extensions directory '/home/neven/.azure/cliextensions'
Extensions system directory '/usr/lib/python3.9/site-packages/azure-cli-extensions'

Python (Linux) 3.9.19 (main, Mar 28 2024, 18:56:59)
[GCC 11.2.0]

### Additional context

Here is related [issue](https://github.com/Azure/azure-cli/issues/28865).

I believe [this commit](https://github.com/Azure/azure-cli/commit/f494e413191304e4810c813f89a1a2f242580799) introduced the error.

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.