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.

"az container logs" does not work in 2.28.0

See original GitHub issue

Describe the bug

Command Name az container logs does not work in 2.28.0. I works fine in 2.27.2

Errors:

The command failed with an unexpected error. Here is the traceback:
'ContainerInstanceManagementClient' object has no attribute 'container'
Traceback (most recent call last):
  File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 657, in execute
    raise ex
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 720, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 691, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 112, in handler
    client = self.client_factory(self.cli_ctx, command_args) if self.client_factory else None
  File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/container/_client_factory.py", line 18, in cf_container
    return _container_instance_client_factory(cli_ctx).container
AttributeError: 'ContainerInstanceManagementClient' object has no attribute 'container'

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 container logs -g xxxx -n xxxx

Expected Behavior

Logs from the container should be shown.

Environment Summary

Linux-5.13.12-x86_64-with-debian-11.0, Debian GNU/Linux 11 (bullseye)
Python 3.6.10
Installer: DEB

azure-cli 2.28.0

Extensions:
portal 0.1.1
log-analytics 0.2.2
import-export 0.1.1

Additional Context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:25
  • Comments:32 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
visimo-jarodcommented, Sep 15, 2021

I am also having this problem with the az container exec ... command. I get a similar error message:

The command failed with an unexpected error. Here is the traceback:
'ContainerInstanceManagementClient' object has no attribute 'container'
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 657, in execute
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 720, in _run_jobs_serially
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 691, 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/container/custom.py", line 609, in container_exec
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/container/_client_factory.py", line 18, in cf_container
AttributeError: 'ContainerInstanceManagementClient' object has no attribute 'container'
To open an issue, please run: 'az feedback'

(azure-cli installed via chocolatey)

6reactions
NakagawaMakotocommented, Oct 12, 2021

Verified that 2.29.0 works fine as before.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot for Azure Container Registry on Azure Stack Hub
Find answers to common issues with Azure Container Registry on Azure Stack ... Resource Logs are not collected and stored until you create...
Read more >
'ContainerGroupsOperations' object has no attribute 'delete ...
This is a known issue introduced by Microsoft updating Az CLI to version 2.28.0. There is no solution other that downgrade at the...
Read more >
API Reference - DataRobot Python package documentation
(New in version v2.8) Specifies the behavior of Scaleout models for the project. This is one of datarobot.enums.SCALEOUT_MODELING_MODE . If datarobot.enums.
Read more >
Installing a cluster on Azure Stack Hub using ARM templates
If the cluster has internet access and you do not disable Telemetry, ... az login. Log in to Azure in the web console...
Read more >
Semaphore Changelog
Azure-cli 2.28.0 -> 2.29.0; Aws-cli 1.20.56 -> 1.20.62; Docker 20.10.8 - 20.10.9 ... Latest language versions - In the future, some packages may...
Read more >

github_iconTop Related Medium Post

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