azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

Error while trying to view logs on (likely) bad container deploy

Open tmswfrk opened this issue 5 years ago • 5 comments

This is autogenerated. Please review and update as needed.

Description

Been trying to follow the docs I've found both officially and elsewhere online. I'm a bit limited on my knowledge of docker and Azure, and especially with the two together, but I understand what I'm at least trying to do here. I've created a container, i've tagged it, set up a service principal, and have pushed the container to my registry. However, it appears that after a container create, the container is restarting and not properly coming online - which could be likely due to a misconfigured or missing config file (which would be my issue). Unfortunately I cannot confirm this as trying to retrieve the specific logs for this container is failing for me. I've also attempted to attach to the container to stream stdout/stderr, but a similar message appears here as well.

Command Name az container logs

Errors:

The command failed with an unexpected error. Here is the traceback:
'ContainerInstanceManagementClient' object has no attribute 'container'
Traceback (most recent call last):
  File "/usr/local/Cellar/azure-cli/2.28.0/libexec/lib/python3.9/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/local/Cellar/azure-cli/2.28.0/libexec/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 657, in execute
    raise ex
  File "/usr/local/Cellar/azure-cli/2.28.0/libexec/lib/python3.9/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/Cellar/azure-cli/2.28.0/libexec/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 691, in _run_job
    result = cmd_copy(params)
  File "/usr/local/Cellar/azure-cli/2.28.0/libexec/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/local/Cellar/azure-cli/2.28.0/libexec/lib/python3.9/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 "/usr/local/Cellar/azure-cli/2.28.0/libexec/lib/python3.9/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 --resource-group {} --name {}

Expected Behavior

Environment Summary

macOS-11.4-x86_64-i386-64bit, Darwin 20.5.0
Python 3.9.7
Installer: HOMEBREW

azure-cli 2.28.0

Additional Context

tmswfrk avatar Sep 13 '21 06:09 tmswfrk

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

Issue Details

This is autogenerated. Please review and update as needed.

Description

Been trying to follow the docs I've found both officially and elsewhere online. I'm a bit limited on my knowledge of docker and Azure, and especially with the two together, but I understand what I'm at least trying to do here. I've created a container, i've tagged it, set up a service principal, and have pushed the container to my registry. However, it appears that after a container create, the container is restarting and not properly coming online - which could be likely due to a misconfigured or missing config file (which would be my issue). Unfortunately I cannot confirm this as trying to retrieve the specific logs for this container is failing for me. I've also attempted to attach to the container to stream stdout/stderr, but a similar message appears here as well.

Command Name az container logs

Errors:

The command failed with an unexpected error. Here is the traceback:
'ContainerInstanceManagementClient' object has no attribute 'container'
Traceback (most recent call last):
  File "/usr/local/Cellar/azure-cli/2.28.0/libexec/lib/python3.9/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/local/Cellar/azure-cli/2.28.0/libexec/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 657, in execute
    raise ex
  File "/usr/local/Cellar/azure-cli/2.28.0/libexec/lib/python3.9/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/Cellar/azure-cli/2.28.0/libexec/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 691, in _run_job
    result = cmd_copy(params)
  File "/usr/local/Cellar/azure-cli/2.28.0/libexec/lib/python3.9/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/local/Cellar/azure-cli/2.28.0/libexec/lib/python3.9/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 "/usr/local/Cellar/azure-cli/2.28.0/libexec/lib/python3.9/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 --resource-group {} --name {}

Expected Behavior

Environment Summary

macOS-11.4-x86_64-i386-64bit, Darwin 20.5.0
Python 3.9.7
Installer: HOMEBREW

azure-cli 2.28.0

Additional Context

Author: tmswfrk
Assignees: -
Labels:

Service Attention, Container Instances, customer-reported

Milestone: -

ghost avatar Sep 13 '21 08:09 ghost

route to service team

yonzhan avatar Sep 13 '21 08:09 yonzhan

Probably the same underlying problem and workarounds as #19489

kf6kjg avatar Sep 16 '21 20:09 kf6kjg

@tmswfrk Looks like this has since been fixed and I can confirm that there is no error now. Apologies for no updates on this issue sooner. Unless you are still seeing this error on your end with the latest version, I believe this could be closed.

PramodValavala-MSFT avatar Feb 08 '22 11:02 PramodValavala-MSFT

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

ghost avatar Feb 15 '22 14:02 ghost