question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[2.32.0] az aks update --enable-secret-rotation fails : 'NoneType' object does not support item assignment

See original GitHub issue

This is autogenerated. Please review and update as needed.

Describe the bug

az aks update --enable-secret-rotation fails with opaque error.

Command Name az aks update

Errors:

The command failed with an unexpected error. Here is the traceback:
'NoneType' object does not support item assignment
Traceback (most recent call last):
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 658, in execute
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 692, in _run_job
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 328, in __call__
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/acs/custom.py", line 2298, in aks_update
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/acs/decorator.py", line 5886, in update_default_mc_profile
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/acs/decorator.py", line 5832, in update_addon_profiles
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/acs/decorator.py", line 5766, in update_azure_keyvault_secrets_provider_addon_profile
TypeError: 'NoneType' object does not support item assignment

To Reproduce:

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

Not sure if there are other preconditions unique to my environment. If it is useful, I enabled the plugin via Bicep template as such:

addonProfiles: {
      azureKeyvaultSecretsProvider: {
        enabled: true
      }
    }
  • az aks update -g {} -n {} --enable-secret-rotation

Expected Behavior

Autorotation is enabled.

Environment Summary

Windows-10-10.0.22000-SP0
Python 3.8.9
Installer: MSI

azure-cli 2.32.0 *

Extensions:
azure-devops 0.20.0
ssh 1.0.0

```json
{
  "azure-cli": "2.32.0",
  "azure-cli-core": "2.32.0",
  "azure-cli-telemetry": "1.0.6",
  "extensions": {
    "azure-devops": "0.22.0",
    "ssh": "1.0.0"
  }
}
## Additional Context

<!--Please don't remove this:-->
<!--auto-generated-->

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:24 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ianjirkacommented, Feb 6, 2022

I ran into a similar issue as the person on the other thread - I can’t remove because it is in use

>az aks disable-addons -g x --name y -a azure-keyvault-secrets-provider
The behavior of this command has been altered by the following extension: aks-preview
(BadRequest) AzureKeyvaultSecretsProvider addon cannot be disabled due to more than 0 Secret Provider Classes
Code: BadRequest
Message: AzureKeyvaultSecretsProvider addon cannot be disabled due to more than 0 Secret Provider Classes

I don’t want to un-deploy anything to attempt a workaround at the moment - this is a production cluster. Do you have another approach I can try? Does it seem to be a server side or client side state issue, do you know?

Edit: Failed to post my entire thought 😐

0reactions
ebbypetercommented, Jun 30, 2022

Adding the config with a variation of the above approach worked for me… I was running the command from PowerShell and I had to get the contents of the update.json to a variable and pass it to the put method…

So the steps were:

# get current config
az rest --method GET --url 'https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}?api-version=2022-01-01' > update.json

# edit the update.json file as shown in the below section

# get the update.json data. 
$updateContent = = Get-Content -Path .\update.json

# update config
az rest --method PUT --url 'https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}?api-version=2022-01-01' --body $updateContent

update.json

{
  "id": "<RESOURCE_ID>",
  "location": "<LOCATION>",
  "name": "<CLUSTER_NAME>",
  "properties": {
    "addonProfiles": {
      "azureKeyvaultSecretsProvider": {
        "config": {
          "enableSecretRotation": "true",
          "rotationPollInterval": "2m"
        },
        "enabled": true,
        "identity": {
          "clientId": "<CLIENT_ID>",
          "objectId": "<OBJECT_ID>",
          "resourceId": "<RESOURCE_ID>"
        }
      }
    }
  },
  "type": "Microsoft.ContainerService/ManagedClusters"
}

if you are getting ‘Unsupported Media Type’ error, convert the update.json with the following

  • escaping the " (double qoute) to " (slash double quote)
  • making the json to a single line
Read more comments on GitHub >

github_iconTop Results From Across the Web

'NoneType' object does not support item assignment, even ...
The error is telling you that new is None . It can only be None if next returned None . It returned None...
Read more >
Release notes & updates – Azure CLI - Microsoft Learn
Learn about the latest Azure Command-Line Interface (CLI) release notes and updates for both the current and beta versions of the CLI.
Read more >
'NoneType' object does not support item assignment
I am literally just mapping it from the devices pulled from Device_Endpoints and generate a log.info and yet it still fails. Any advice?...
Read more >
TypeError: 'NoneType' object does not support item assignment
Since the plugin active, began to appear the following errors in the debug log trac: 0.11.7 and 0.12.5 happens in. Trac[main] ERROR: Exception...
Read more >
'None Type' object does not support item assignment - Intellipaat
I have been debugging it by any means that stop the problem, but I do not understand what this error means or how...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found