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

Error in running az ml connection list #28295

Open
ZhiliangWu opened this issue Feb 2, 2024 · 2 comments
Open

Error in running az ml connection list #28295

ZhiliangWu opened this issue Feb 2, 2024 · 2 comments
Assignees
Labels
Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Machine Learning az ml Service Attention This issue is responsible by Azure service team.

Comments

@ZhiliangWu
Copy link

Describe the bug

As in https://learn.microsoft.com/en-us/cli/azure/ml/connection?view=azure-cli-latest#az-ml-connection-list, this command shall list all the workspaces' connection. However, it is returning errors.

Related command

az ml connection list

Errors

Met error <class 'UnboundLocalError'>:cannot access local variable 'credentials' where it is not associated with a value
Please check log by running the command with '--debug' for more details.

Issue script & Debug output

Traceback (most recent call last):
  File "/Users/********/.azure/cliextensions/ml/azext_mlv2/manual/custom/workspace_connection.py", line 81, in ml_workspace_connection_list
    return list(map(lambda x: _dump_entity_with_warnings(x), results))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/core/paging.py", line 123, in __next__
    return next(self._page_iterator)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/core/paging.py", line 83, in __next__
    self.continuation_token, self._current_page = self._extract_data(self._response)
                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/********/.azure/cliextensions/ml/azext_mlv2/manual/vendored_curated_sdk/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_workspace_connections_operations.py", line 371, in extract_data
    list_of_elem = cls(list_of_elem)
                   ^^^^^^^^^^^^^^^^^
  File "/Users/********/.azure/cliextensions/ml/azext_mlv2/manual/vendored_curated_sdk/azure/ai/ml/operations/_workspace_connections_operations.py", line 153, in <lambda>
    cls=lambda objs: [WorkspaceConnection._from_rest_object(obj) for obj in objs],
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/********/.azure/cliextensions/ml/azext_mlv2/manual/vendored_curated_sdk/azure/ai/ml/operations/_workspace_connections_operations.py", line 153, in <listcomp>
    cls=lambda objs: [WorkspaceConnection._from_rest_object(obj) for obj in objs],
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/********/.azure/cliextensions/ml/azext_mlv2/manual/vendored_curated_sdk/azure/ai/ml/entities/_workspace/connections/workspace_connection.py", line 228, in _from_rest_object
    rest_kwargs = cls._extract_kwargs_from_rest_obj(rest_obj=rest_obj, popped_tags=popped_tags)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/********/.azure/cliextensions/ml/azext_mlv2/manual/vendored_curated_sdk/azure/ai/ml/entities/_workspace/connections/workspace_connection.py", line 304, in _extract_kwargs_from_rest_obj
    "credentials": credentials,
                   ^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'credentials' where it is not associated with a value
cli: None
cli: Traceback (most recent call last):
  File "/Users/********/.azure/cliextensions/ml/azext_mlv2/manual/custom/workspace_connection.py", line 81, in ml_workspace_connection_list
    return list(map(lambda x: _dump_entity_with_warnings(x), results))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/core/paging.py", line 123, in __next__
    return next(self._page_iterator)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/core/paging.py", line 83, in __next__
    self.continuation_token, self._current_page = self._extract_data(self._response)
                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/********/.azure/cliextensions/ml/azext_mlv2/manual/vendored_curated_sdk/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_workspace_connections_operations.py", line 371, in extract_data
    list_of_elem = cls(list_of_elem)
                   ^^^^^^^^^^^^^^^^^
  File "/Users/********/.azure/cliextensions/ml/azext_mlv2/manual/vendored_curated_sdk/azure/ai/ml/operations/_workspace_connections_operations.py", line 153, in <lambda>
    cls=lambda objs: [WorkspaceConnection._from_rest_object(obj) for obj in objs],
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/********/.azure/cliextensions/ml/azext_mlv2/manual/vendored_curated_sdk/azure/ai/ml/operations/_workspace_connections_operations.py", line 153, in <listcomp>
    cls=lambda objs: [WorkspaceConnection._from_rest_object(obj) for obj in objs],
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/********/.azure/cliextensions/ml/azext_mlv2/manual/vendored_curated_sdk/azure/ai/ml/entities/_workspace/connections/workspace_connection.py", line 228, in _from_rest_object
    rest_kwargs = cls._extract_kwargs_from_rest_obj(rest_obj=rest_obj, popped_tags=popped_tags)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/********/.azure/cliextensions/ml/azext_mlv2/manual/vendored_curated_sdk/azure/ai/ml/entities/_workspace/connections/workspace_connection.py", line 304, in _extract_kwargs_from_rest_obj
    "credentials": credentials,
                   ^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'credentials' where it is not associated with a value

cli.azure.cli.core.azclierror: Traceback (most recent call last):
  File "/Users/********/.azure/cliextensions/ml/azext_mlv2/manual/custom/workspace_connection.py", line 81, in ml_workspace_connection_list
    return list(map(lambda x: _dump_entity_with_warnings(x), results))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/core/paging.py", line 123, in __next__
    return next(self._page_iterator)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/core/paging.py", line 83, in __next__
    self.continuation_token, self._current_page = self._extract_data(self._response)
                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/********/.azure/cliextensions/ml/azext_mlv2/manual/vendored_curated_sdk/azure/ai/ml/_restclient/v2023_06_01_preview/operations/_workspace_connections_operations.py", line 371, in extract_data
    list_of_elem = cls(list_of_elem)
                   ^^^^^^^^^^^^^^^^^
  File "/Users/********/.azure/cliextensions/ml/azext_mlv2/manual/vendored_curated_sdk/azure/ai/ml/operations/_workspace_connections_operations.py", line 153, in <lambda>
    cls=lambda objs: [WorkspaceConnection._from_rest_object(obj) for obj in objs],
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/********/.azure/cliextensions/ml/azext_mlv2/manual/vendored_curated_sdk/azure/ai/ml/operations/_workspace_connections_operations.py", line 153, in <listcomp>
    cls=lambda objs: [WorkspaceConnection._from_rest_object(obj) for obj in objs],
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/********/.azure/cliextensions/ml/azext_mlv2/manual/vendored_curated_sdk/azure/ai/ml/entities/_workspace/connections/workspace_connection.py", line 228, in _from_rest_object
    rest_kwargs = cls._extract_kwargs_from_rest_obj(rest_obj=rest_obj, popped_tags=popped_tags)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/********/.azure/cliextensions/ml/azext_mlv2/manual/vendored_curated_sdk/azure/ai/ml/entities/_workspace/connections/workspace_connection.py", line 304, in _extract_kwargs_from_rest_obj
    "credentials": credentials,
                   ^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'credentials' where it is not associated with a value

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
             ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.56.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
           ^^^^^^^^^^^^^^^^^^
  File "/Users/********/.azure/cliextensions/ml/azext_mlv2/manual/custom/workspace_connection.py", line 83, in ml_workspace_connection_list
    log_and_raise_error(err, debug)
  File "/Users/********/.azure/cliextensions/ml/azext_mlv2/manual/custom/raise_error.py", line 181, in log_and_raise_error
    raise cli_error
knack.util.CLIError: Met error <class 'UnboundLocalError'>:cannot access local variable 'credentials' where it is not associated with a value
Please check log by running the command with '--debug' for more details.

cli.azure.cli.core.azclierror: Met error <class 'UnboundLocalError'>:cannot access local variable 'credentials' where it is not associated with a value
Please check log by running the command with '--debug' for more details.
az_command_data_logger: Met error <class 'UnboundLocalError'>:cannot access local variable 'credentials' where it is not associated with a value
Please check log by running the command with '--debug' for more details.
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x1068762a0>]

Expected behavior

list all the workspaces' connection

Environment Summary

az --version
azure-cli 2.56.0

core 2.56.0
telemetry 1.1.0

Extensions:
ml 2.22.0

Dependencies:
msal 1.24.0b2
azure-mgmt-resource 23.1.0b2

Additional context

No response

@ZhiliangWu ZhiliangWu added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Feb 2, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot Service Attention This issue is responsible by Azure service team. Machine Learning az ml labels Feb 2, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Feb 2, 2024

Thank you for opening this issue, we will look into it.

Copy link
Contributor

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

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 bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Machine Learning az ml Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

3 participants