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

az ts export -s {} --output-folder {} #17759

Closed
Svessir opened this issue Apr 19, 2021 · 10 comments
Closed

az ts export -s {} --output-folder {} #17759

Svessir opened this issue Apr 19, 2021 · 10 comments
Assignees
Labels
ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group Service Attention This issue is responsible by Azure service team.
Milestone

Comments

@Svessir
Copy link

Svessir commented Apr 19, 2021

This is autogenerated. Please review and update as needed.

Describe the bug

az ts export is throwing an error for valid input:
az ts export -s /subscriptions/{}/resourceGroups/{}/providers/Microsoft.Resources/templateSpecs/{}/versions/{} --output-folder ./exported

Command Name
az ts export

Errors:

'NoneType' object is not iterable
Traceback (most recent call last):
python3.8/site-packages/knack/cli.py, ln 231, in invoke
    cmd_result = self.invocation.execute(args)
cli/core/commands/__init__.py, ln 657, in execute
    raise ex
cli/core/commands/__init__.py, ln 720, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
...
    result = cmd_copy(params)
cli/core/commands/__init__.py, ln 328, in __call__
    return self.handler(*args, **kwargs)
azure/cli/core/__init__.py, ln 807, in default_command_handler
    return op(**command_args)
cli/command_modules/resource/custom.py, ln 1963, in export_template_spec
    return unpack(cmd, exported_template, output_folder, (str(name) + '.JSON'))
cli/command_modules/resource/_packing_engine.py, ln 195, in unpack
    for artifact in getattr(packaged_template, 'Artifacts'):
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 ts export -s {} --output-folder {}

Expected Behavior

The templates in -s "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Resources/templateSpecs/{}/versions/{}" should have been exported to the destination specified by the --output-folder param

Environment Summary

Linux-5.4.0-71-generic-x86_64-with-glibc2.27
Python 3.8.0
Installer: PIP

azure-cli 2.22.0 *

Extensions:
azure-devops 0.18.0
azure-iot 0.10.10

Additional Context

@ghost ghost added needs-triage This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Apr 19, 2021
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Apr 19, 2021
@yonzhan yonzhan removed the question The issue doesn't require a change to the product in order to be resolved. Most issues start as that label Apr 19, 2021
@yonzhan yonzhan added this to the S186 milestone Apr 19, 2021
@kairu-ms kairu-ms assigned zhoxing-ms and unassigned kairu-ms Apr 20, 2021
@kairu-ms
Copy link
Contributor

Resource

@zhoxing-ms zhoxing-ms added ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group Service Attention This issue is responsible by Azure service team. and removed Time Series Insights labels Apr 20, 2021
@ghost
Copy link

ghost commented Apr 20, 2021

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

Issue Details

This is autogenerated. Please review and update as needed.

Describe the bug

az ts export is throwing an error for valid input:
az ts export -s /subscriptions/{}/resourceGroups/{}/providers/Microsoft.Resources/templateSpecs/{}/versions/{} --output-folder ./exported

Command Name
az ts export

Errors:

'NoneType' object is not iterable
Traceback (most recent call last):
python3.8/site-packages/knack/cli.py, ln 231, in invoke
    cmd_result = self.invocation.execute(args)
cli/core/commands/__init__.py, ln 657, in execute
    raise ex
cli/core/commands/__init__.py, ln 720, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
...
    result = cmd_copy(params)
cli/core/commands/__init__.py, ln 328, in __call__
    return self.handler(*args, **kwargs)
azure/cli/core/__init__.py, ln 807, in default_command_handler
    return op(**command_args)
cli/command_modules/resource/custom.py, ln 1963, in export_template_spec
    return unpack(cmd, exported_template, output_folder, (str(name) + '.JSON'))
cli/command_modules/resource/_packing_engine.py, ln 195, in unpack
    for artifact in getattr(packaged_template, 'Artifacts'):
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 ts export -s {} --output-folder {}

Expected Behavior

The templates in -s "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Resources/templateSpecs/{}/versions/{}" should have been exported to the destination specified by the --output-folder param

Environment Summary

Linux-5.4.0-71-generic-x86_64-with-glibc2.27
Python 3.8.0
Installer: PIP

azure-cli 2.22.0 *

Extensions:
azure-devops 0.18.0
azure-iot 0.10.10

Additional Context

Author: Svessir
Assignees: zhoxing-ms
Labels:

ARM, Service Attention

Milestone: S186

@zhoxing-ms
Copy link
Contributor

@detienne20 could you please help to have a look at this issue~

@yonzhan yonzhan modified the milestones: S186, Backlog Apr 20, 2021
@usrme
Copy link

usrme commented Apr 29, 2021

Seeing the same error message as of yesterday, which is weird as the command has been in use for quite some time now... For some reason some template specs have the artifacts property defined and some don't, which trips up the underlying Python code.

@usrme
Copy link

usrme commented May 10, 2021

@detienne20, despite #17890 being successfully resolved I am still seeing issue even with 2.23.0:

# az ts export --name {} --resource-group {} --version {} --output-folder .
Command group 'ts' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
The command failed with an unexpected error. Here is the traceback:
'NoneType' object is not iterable
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/local/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 657, in execute
    raise ex
  File "/usr/local/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 720, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/usr/local/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 691, in _run_job
    result = cmd_copy(params)
  File "/usr/local/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/usr/local/lib/python3.8/site-packages/azure/cli/command_modules/resource/custom.py", line 1967, in export_template_spec
    return unpack(cmd, exported_template, output_folder, (str(name) + '.JSON'))
  File "/usr/local/lib/python3.8/site-packages/azure/cli/command_modules/resource/_packing_engine.py", line 195, in unpack
    for artifact in getattr(packaged_template, 'Artifacts'):
TypeError: 'NoneType' object is not iterable
To open an issue, please run: 'az feedback'
bash-5.1# az version
{
  "azure-cli": "2.23.0",
  "azure-cli-core": "2.23.0",
  "azure-cli-telemetry": "1.0.6",
  "extensions": {}
}

The template spec in question does not have any artifacts defined:

Screenshot_20210510_093853

@johndowns
Copy link
Contributor

johndowns commented Jun 14, 2021

I have this issue too. Happy for you to ping me internally if you want to see the debug output. I'm using CLI v2.24.2.

@zhoxing-ms
Copy link
Contributor

@detienne20 Any update for this issue?

@Svessir
Copy link
Author

Svessir commented Jul 12, 2021

Any update?

@yonzhan
Copy link
Collaborator

yonzhan commented Jul 12, 2021

@detienne20

@detienne20
Copy link
Contributor

Thank you for your patience, the fix for this is in progress and will be released soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

7 participants