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 aro delete fails with a traceback when provided with invalid resource group and cluster names #18501

Closed
mgahagan73 opened this issue Jun 15, 2021 · 4 comments · Fixed by Azure/ARO-RP#1552
Labels
ARO az aro (Azure Redhat OpenShift) Service Attention This issue is responsible by Azure service team.

Comments

@mgahagan73
Copy link

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name
az aro delete

Errors:

The command failed with an unexpected error. Here is the traceback:
local variable 'oc' referenced before assignment
Traceback (most recent call last):
  File "/usr/lib64/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 657, in execute
    raise ex
  File "/usr/lib64/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 "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 691, in _run_job
    result = cmd_copy(params)
  File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/command_modules/aro/custom.py", line 164, in aro_delete
    ensure_resource_permissions(cmd.cli_ctx, oc, False, [rp_client_sp.object_id])
UnboundLocalError: local variable 'oc' referenced before assignment

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 aro delete --resource-group {} -n {}

Expected Behavior

Environment Summary

Linux-5.12.9-300.fc34.x86_64-x86_64-with-glibc2.33
Python 3.9.5
Installer: RPM

azure-cli 2.25.0

I have reproduced the same traceback with both python 3.6 and python 3.9 on a Fedora 34 system

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 Jun 15, 2021
@mgahagan73
Copy link
Author

It turns out this failure only occurs when the cli is given a non-existant resource group name and cluster name

@mgahagan73 mgahagan73 changed the title az aro delete fails with a traceback and cannot remove an aro cluster az aro delete fails with a traceback when provided with invalid resource group and cluster names Jun 15, 2021
@yonzhan yonzhan added the ARO az aro (Azure Redhat OpenShift) label Jun 16, 2021
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Jun 16, 2021
@yonzhan yonzhan added Service Attention This issue is responsible by Azure service team. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jun 16, 2021
@ghost
Copy link

ghost commented Jun 16, 2021

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @mjudeikis, @jim-minter, @julienstroheker, @amanohar.

Issue Details

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name
az aro delete

Errors:

The command failed with an unexpected error. Here is the traceback:
local variable 'oc' referenced before assignment
Traceback (most recent call last):
  File "/usr/lib64/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 657, in execute
    raise ex
  File "/usr/lib64/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 "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 691, in _run_job
    result = cmd_copy(params)
  File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/command_modules/aro/custom.py", line 164, in aro_delete
    ensure_resource_permissions(cmd.cli_ctx, oc, False, [rp_client_sp.object_id])
UnboundLocalError: local variable 'oc' referenced before assignment

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 aro delete --resource-group {} -n {}

Expected Behavior

Environment Summary

Linux-5.12.9-300.fc34.x86_64-x86_64-with-glibc2.33
Python 3.9.5
Installer: RPM

azure-cli 2.25.0

I have reproduced the same traceback with both python 3.6 and python 3.9 on a Fedora 34 system

Additional Context

Author: mgahagan73
Assignees: -
Labels:

ARO, Service Attention

Milestone: -

@yonzhan
Copy link
Collaborator

yonzhan commented Jun 16, 2021

route to service team

@bennerv
Copy link
Contributor

bennerv commented Jun 29, 2021

Resolved with #18546 merged in. Can close @yonzhan

@yonzhan yonzhan closed this as completed Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARO az aro (Azure Redhat OpenShift) Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants