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

Setting registry for container app results in python error #5642

Closed
ValdoBE opened this issue Dec 14, 2022 · 12 comments · Fixed by #5646
Closed

Setting registry for container app results in python error #5642

ValdoBE opened this issue Dec 14, 2022 · 12 comments · Fixed by #5646
Labels
Auto-Assign Auto assign by bot ContainerApp customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.

Comments

@ValdoBE
Copy link

ValdoBE commented Dec 14, 2022

After creating Container App we now get a python error when trying to set the registry with a system assigned identity.
We have been using the same script for a few months, but we are suddenly getting this error with any changes to this part of our deploy script.

Command Name
az containerapp registry set Extension Name: containerapp. Version: 0.3.16.

Errors:

The command failed with an unexpected error. Here is the traceback:
'NoneType' object is not iterable
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\DennisPresent\.azure\cliextensions\containerapp\azext_containerapp\_client_factory.py", line 28, in _polish_bad_errors
    raise ex
  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\DennisPresent\.azure\cliextensions\containerapp\azext_containerapp\custom.py", line 2119, in set_registry
    for r in registries_def:
TypeError: 'NoneType' object is not iterable

To Reproduce:

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

  • Put any pre-requisite steps here...
  • az containerapp registry set --resource-group {} --name {} --server {} --identity {}

Expected Behavior

Environment Summary

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

azure-cli 2.43.0

Extensions:
containerapp 0.3.16
kusto 0.5.0

Dependencies:
msal 1.20.0
azure-mgmt-resource 21.1.0b1

Additional Context

@ghost ghost added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot ContainerApp CXP Attention This issue is handled by CXP team. labels Dec 14, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented Dec 14, 2022

route to CXP team

@navba-MSFT navba-MSFT self-assigned this Dec 15, 2022
@navba-MSFT
Copy link
Contributor

@ValdoBE Thanks for reaching out to us and reporting this issue. We are looking into this issue and we will provide an update.

@mcupito
Copy link

mcupito commented Dec 15, 2022

This is blocking us as well -- we are seeing the same exact behavior

@cwistedt
Copy link

Blocker for me as well.

@ValdoBE
Copy link
Author

ValdoBE commented Dec 16, 2022

Currently to unblock you can use the workaround to change the identity-based deployment to admin creds that works fine. We tested the command az containerapp registry set with admin cred username & password.

We will have to wait for an update from the team where only using managed identity option it is not working.

I'm getting the same error when using username and password

az containerapp registry set --resource-group '' --name '' --server '' --username '' --password ''

The command failed with an unexpected error. Here is the traceback:
'NoneType' object is not iterable
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\DennisPresent\.azure\cliextensions\containerapp\azext_containerapp\_client_factory.py", line 28, in _polish_bad_errors
    raise ex
  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\DennisPresent\.azure\cliextensions\containerapp\azext_containerapp\custom.py", line 2119, in set_registry
    for r in registries_def:
TypeError: 'NoneType' object is not iterable

Don't know if it helps, but I am also getting a python error when I try the show command.

az containerapp registry show --resource-group '' --name '' --server ''

The command failed with an unexpected error. Here is the traceback:
'NoneType' object is not iterable
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 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 363, in handler
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/arm.py", line 429, in show_exception_handler
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 361, in handler
  File "C:\Users\DennisPresent\.azure\cliextensions\containerapp\azext_containerapp\custom.py", line 2056, in show_registry
    for r in registries_def:
TypeError: 'NoneType' object is not iterable

@soumya05
Copy link

soumya05 commented Dec 16, 2022

I'm getting the same error when using username and password with 'az containerapp registry set ' command
as a workaround switched to powershell commands

$acrobj = New-AzContainerAppRegistryCredentialObject -Server acrName.azurecr.io -Identity 'system'

Update-AzContainerApp -ContainerAppName acaName -ResourceGroupName rgName -Location location - ConfigurationRegistry $acrobj

@feroxsys
Copy link

This is blocking for us as well.
Both using managed identity and the username & password authentication fail with a similar Python error.

I tried different (earlier) versions of the Azure CLI and the containerapp extension, but the error remains.

@navba-MSFT
Copy link
Contributor

involving the service team to look into this further

@navba-MSFT navba-MSFT added Service Attention This issue is responsible by Azure service team. and removed CXP Attention This issue is handled by CXP team. labels Dec 16, 2022
@navba-MSFT navba-MSFT removed their assignment Dec 16, 2022
@ghost
Copy link

ghost commented Dec 16, 2022

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

Issue Details

After creating Container App we now get a python error when trying to set the registry with a system assigned identity.
We have been using the same script for a few months, but we are suddenly getting this error with any changes to this part of our deploy script.

Command Name
az containerapp registry set Extension Name: containerapp. Version: 0.3.16.

Errors:

The command failed with an unexpected error. Here is the traceback:
'NoneType' object is not iterable
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\DennisPresent\.azure\cliextensions\containerapp\azext_containerapp\_client_factory.py", line 28, in _polish_bad_errors
    raise ex
  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\DennisPresent\.azure\cliextensions\containerapp\azext_containerapp\custom.py", line 2119, in set_registry
    for r in registries_def:
TypeError: 'NoneType' object is not iterable

To Reproduce:

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

  • Put any pre-requisite steps here...
  • az containerapp registry set --resource-group {} --name {} --server {} --identity {}

Expected Behavior

Environment Summary

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

azure-cli 2.43.0

Extensions:
containerapp 0.3.16
kusto 0.5.0

Dependencies:
msal 1.20.0
azure-mgmt-resource 21.1.0b1

Additional Context

Author: ValdoBE
Assignees: navba-MSFT
Labels:

question, customer-reported, Service Attention, Auto-Assign, ContainerApp

Milestone: -

@navba-MSFT
Copy link
Contributor

@calvinsID Could you please look into this and provide an update ?

@DavidVollmers
Copy link

Still doesn't work for me...

2023-01-04T10:01:15.2546947Z ERROR: 'NoneType' object is not iterable
2023-01-04T10:01:15.2551526Z Traceback (most recent call last):
2023-01-04T10:01:15.2552955Z   File "/opt/az/lib/python3.8/site-packages/knack/cli.py", line 231, in invoke
2023-01-04T10:01:15.2553655Z     cmd_result = self.invocation.execute(args)
2023-01-04T10:01:15.2554610Z   File "/opt/az/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 658, in execute
2023-01-04T10:01:15.2555483Z     raise ex
2023-01-04T10:01:15.2556351Z   File "/opt/az/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially
2023-01-04T10:01:15.2567767Z     results.append(self._run_job(expanded_arg, cmd_copy))
2023-01-04T10:01:15.2569194Z   File "/opt/az/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 713, in _run_job
2023-01-04T10:01:15.2569783Z     return cmd_copy.exception_handler(ex)
2023-01-04T10:01:15.2570442Z   File "/azp/agent/_work/_temp/.azclitask/cliextensions/containerapp/azext_containerapp/_client_factory.py", line 28, in _polish_bad_errors
2023-01-04T10:01:15.2571055Z     raise ex
2023-01-04T10:01:15.2571823Z   File "/opt/az/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 692, in _run_job
2023-01-04T10:01:15.2572364Z     result = cmd_copy(params)
2023-01-04T10:01:15.2573236Z   File "/opt/az/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
2023-01-04T10:01:15.2573808Z     return self.handler(*args, **kwargs)
2023-01-04T10:01:15.2574761Z   File "/opt/az/lib/python3.8/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
2023-01-04T10:01:15.2575452Z     return op(**command_args)
2023-01-04T10:01:15.2576032Z   File "/azp/agent/_work/_temp/.azclitask/cliextensions/containerapp/azext_containerapp/custom.py", line 1669, in set_registry
2023-01-04T10:01:15.2576627Z     for r in registries_def:
2023-01-04T10:01:15.2577395Z TypeError: 'NoneType' object is not iterable

Happens when trying to update a containerapp from within an Azure DevOps Release Pipeline:

az config set extension.use_dynamic_install=yes_without_prompt
az upgrade
az provider register --namespace Microsoft.App
az containerapp registry set --server foo.azurecr.io --name bar --resource-group foobar

@stuartdotnet
Copy link

I had this error and when I moved the container app and registry to the same resource group it went away.

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 ContainerApp customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention This issue is responsible by Azure service team.
Projects
None yet
9 participants