Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connectedk8s version 1.6.1 - az connectedk8s enable-features fails with 'NoneType' object has no attribute 'lower' #7109

Closed
katriendg opened this issue Dec 21, 2023 · 3 comments
Assignees
Labels
Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. Connected Kubernetes Service Attention This issue is responsible by Azure service team.

Comments

@katriendg
Copy link

Describe the bug

Since upgrading AZ CLI extension connectedk8s to 1.6.1 from 1.6.0 we are getting an unexpected error when running the command az connectedk8s enable-features

Related command

az connectedk8s enable-features -n <cluster> -g <rg> --custom-locations-oid <customlocation ID for tenant> --features cluster-connect custom-locations

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.11/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 663, in execute
raise ex
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job
result = cmd_copy(params)
^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 333, in call
return self.handler(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
^^^^^^^^^^^^^^^^^^
File "/home/codespace/.azure/cliextensions/connectedk8s/azext_connectedk8s/custom.py", line 1451, in enable_features
if (connected_cluster != None) and (connected_cluster.kind.lower() == consts.Provisioned_Cluster_Kind):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'lower'

Issue script & Debug output

cli.knack.cli: Command arguments: ['connectedk8s', 'enable-features', '-n', '---redacted--', '-g', '---redacted--', '--custom-locations-oid', '---redacted--', '--features', 'cluster-connect', 'custom-locations', '--debug']
cli.knack.cli: init debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7f427c1c94e0>, <function OutputProducer.on_global_arguments at 0x7f427c165ee0>, <function CLIQuery.on_global_arguments at 0x7f427c1a39c0>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'connectedk8s': ['azext_connectedk8s']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: Total (0) 0.000 0 0
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name Load Time Groups Commands Directory
cli.azure.cli.core: connectedk8s 0.091 1 10 /home/codespace/.azure/cliextensions/connectedk8s
cli.azure.cli.core: Total (1) 0.091 1 10
cli.azure.cli.core: Loaded 1 groups, 10 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : connectedk8s enable-features
cli.azure.cli.core: Command table: connectedk8s enable-features
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f427b460d60>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/codespace/.azure/commands/2023-12-21.15-45-14.connectedk8s_enable-features.332327.log'.
az_command_data_logger: command args: connectedk8s enable-features -n {} -g {} --custom-locations-oid {} --features {} {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x7f427b278fe0>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x7f427b279080>, <function register_cache_arguments..add_cache_arguments at 0x7f427b2791c0>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7f427c165f80>, <function CLIQuery.handle_query_parameter at 0x7f427c1a3a60>, <function register_ids_argument..parse_ids_arguments at 0x7f427b279120>]
az_command_data_logger: extension name: connectedk8s
az_command_data_logger: extension version: 1.6.1
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
cli.azure.cli.core.commands.client_factory: Getting management service client client_type=ConnectedKubernetesClient
cli.azure.cli.core.auth.persistence: build_persistence: location='/home/codespace/.azure/msal_token_cache.json', encrypt=False
cli.azure.cli.core.auth.binary_cache: load: /home/codespace/.azure/msal_http_cache.bin

---redacted--

msal.application: Broker enabled? False
cli.azext_connectedk8s.custom: This operation might take a while...

cli.azure.cli.core.commands.client_factory: Getting management service client client_type=ConnectedKubernetesClient
urllib3.util.retry: Converted retries value:---redacted--
cli.azure.cli.core.auth.credential_adaptor: CredentialAdaptor.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={}
cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token:---redacted--
msal.application: Cache hit an AT
msal.telemetry: Generate or reuse correlation_id: ---redacted--
cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/ ---redacted--
cli.azure.cli.core.sdk.policies: Request method: 'GET'
cli.azure.cli.core.sdk.policies: Request headers:
cli.azure.cli.core.sdk.policies: 'Accept': 'application/json'
cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': ---redacted--
cli.azure.cli.core.sdk.policies: 'CommandName': 'connectedk8s enable-features'
cli.azure.cli.core.sdk.policies: 'ParameterSetName': '-n -g --custom-locations-oid --features --debug'
cli.azure.cli.core.sdk.policies: ---redacted--
cli.azure.cli.core.sdk.policies: 'Authorization': '*****'
cli.azure.cli.core.sdk.policies: Request body:
cli.azure.cli.core.sdk.policies: This request has no body
urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443
urllib3.connectionpool: ---redacted---
cli.azure.cli.core.sdk.policies: Response status: 200
cli.azure.cli.core.sdk.policies: Response headers:
cli.azure.cli.core.sdk.policies: 'Cache-Control': 'no-cache'
---redacted--
cli.azure.cli.core.sdk.policies: Response content:

---redacted---

cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "/opt/az/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 663, in execute
raise ex
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job
result = cmd_copy(params)
^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 333, in call
return self.handler(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
^^^^^^^^^^^^^^^^^^
File "/home/codespace/.azure/cliextensions/connectedk8s/azext_connectedk8s/custom.py", line 1451, in enable_features
if (connected_cluster != None) and (connected_cluster.kind.lower() == consts.Provisioned_Cluster_Kind):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'lower'

cli.azure.cli.core.azclierror: The command failed with an unexpected error. Here is the traceback:
az_command_data_logger: The command failed with an unexpected error. Here is the traceback:
cli.azure.cli.core.azclierror: 'NoneType' object has no attribute 'lower'
Traceback (most recent call last):
File "/opt/az/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 663, in execute
raise ex
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job
result = cmd_copy(params)
^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 333, in call
return self.handler(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
^^^^^^^^^^^^^^^^^^
File "/home/codespace/.azure/cliextensions/connectedk8s/azext_connectedk8s/custom.py", line 1451, in enable_features
if (connected_cluster != None) and (connected_cluster.kind.lower() == consts.Provisioned_Cluster_Kind):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'lower'
az_command_data_logger: 'NoneType' object has no attribute 'lower'
Traceback (most recent call last):
File "/opt/az/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 663, in execute
raise ex
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job
result = cmd_copy(params)
^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 333, in call
return self.handler(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
^^^^^^^^^^^^^^^^^^
File "/home/codespace/.azure/cliextensions/connectedk8s/azext_connectedk8s/custom.py", line 1451, in enable_features
if (connected_cluster != None) and (connected_cluster.kind.lower() == consts.Provisioned_Cluster_Kind):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'lower'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f427b460fe0>]
az_command_data_logger: exit code: 1
cli.main: Command ran in 0.979 seconds (init: 0.156, invoke: 0.823)
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 7407 in cache
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/opt/az/bin/python3 /opt/az/lib/python3.11/site-packages/azure/cli/telemetry/init.py /home/codespace/.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.

Expected behavior

Running the same command with previous version 1.6.0 works fine, it's now failing every time with the same error with 1.6.1.

Environment Summary

azure-cli 2.55.0

core 2.55.0
telemetry 1.1.0

Extensions:
azure-iot-ops 0.2.0b1
connectedk8s 1.6.1
k8s-extension 1.5.3

Dependencies:
msal 1.24.0b2
azure-mgmt-resource 23.1.0b2

Python location '/opt/az/bin/python3'
Extensions directory '/home/codespace/.azure/cliextensions'

Python (Linux) 3.11.5 (main, Nov 29 2023, 03:42:00) [GCC 9.4.0]

Additional context

Easy to reproduce, after running az connectedk8s connect successfully, the command above always fails.

@katriendg katriendg added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Dec 21, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added Auto-Assign Auto assign by bot Connected Kubernetes Service Attention This issue is responsible by Azure service team. labels Dec 21, 2023
@yonzhan
Copy link
Collaborator

yonzhan commented Dec 21, 2023

Thank you for opening this issue, we will look into it.

Copy link
Contributor

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

@katriendg
Copy link
Author

Now testing with connectedk8s version 1.6.3 I see the issue is solved. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. Connected Kubernetes Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

3 participants