microsoft / azure_arc

Automated Azure Arc, Edge, and Platform environments
https://aka.ms/ArcJumpstart
Creative Commons Attribution 4.0 International
743 stars 549 forks source link

Manufacturing - cannot import name 'AccessTokenInfo' from 'azure.core.credentials' when deploying AIO on the cluster #2731

Closed mrhoads closed 1 month ago

mrhoads commented 1 month ago

Note: For ease of issues and pull requests management and tracking, we kindly ask you to provide a meaningful and concise title to this issue and answer all questions to the best of your ability.

Is your issue related to a Jumpstart scenario, ArcBox, HCIBox, or Agora? Agora - Manufacturing

Describe the issue or the bug

After logging into the Client VM and letting the post-deployment automation run, the AgLoginScript runs but eventually errors with the message below. This occurs while "Waiting for AIO to be deployed successfully on <location name, like Monterrey)...waiting for 60 seconds" step. This continues to re-try itself and never appears to succeed, leading to the end-to-end automation not completing as expected.

The command failed with an unexpected error. Here is the traceback:
cannot import name 'AccessTokenInfo' from 'azure.core.credentials' (C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\core\credentials.pyc)

To Reproduce

  1. Run Bicep deployment for Contoso Motors scenario
  2. Login to Client VM
  3. Observe PowerShell script when it gets to the step of waiting for AIO to be deployed successfully

Expected behavior AIO is successfully deployed to each cluster.

Environment summary

{ "azure-cli": "2.64.0", "azure-cli-core": "2.64.0", "azure-cli-telemetry": "1.1.0", "extensions": { "azure-iot-ops": "0.5.1b1", "customlocation": "0.1.3", "eventgrid": "1.0.0b1", "k8s-configuration": "2.0.0", "k8s-extension": "1.6.1", "kusto": "0.5.0", "storage-preview": "1.0.0b4" } }

Have you looked at the Troubleshooting and Logs section? Yes but this appear to be a new error.

Screenshots

image

Additional context On a local Ubuntu 22.04 machine (outside of the E2E automation), when I re-install the azure-iot-ops extension I see a similar error. If the azure-iot-ops extension was not already installed, this message does not appear.


$ az extension add --name azure-iot-ops --version 0.5.1b1 --allow-preview true
cannot import name 'AccessTokenInfo' from 'azure.core.credentials' (/opt/az/lib/python3.11/site-packages/azure/core/credentials.py)
tz-jclark commented 1 month ago

experiencing the same issue

This part of the installation continues to loop:

Waiting for AIO to be deployed successfully on monterrey...waiting for 60 seconds
ERROR: The command failed with an unexpected error. Here is the traceback:
ERROR: cannot import name 'AccessTokenInfo' from 'azure.core.credentials' (C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\core\credentials.pyc)
Traceback (most recent call last):
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 564, in execute
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/__init__.py", line 526, in load_arguments
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 321, in load_arguments
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/commands.py", line 104, in load_arguments
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 125, in arguments_loader
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 59, in get_op_handler
  File "importlib\__init__.py", line 126, in import_module
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure-cli-extensions\azure-iot-ops\azext_edge\edge\commands_edge.py", line 18, in <module>
    from .providers.orchestration.common import (
  File "C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure-cli-extensions\azure-iot-ops\azext_edge\edge\providers\orchestration\__init__.py", line 8, in <module>
    from .deletion import delete_ops_resources
  File "C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure-cli-extensions\azure-iot-ops\azext_edge\edge\providers\orchestration\deletion.py", line 19, in <module>
    from ...util.az_client import get_resource_client, wait_for_terminal_states
  File "C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure-cli-extensions\azure-iot-ops\azext_edge\edge\util\az_client.py", line 16, in <module>
    from azure.identity import AzureCliCredential, ClientSecretCredential
  File "C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure-cli-extensions\azure-iot-ops\azure\identity\__init__.py", line 10, in <module>
    from ._credentials import (
  File "C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure-cli-extensions\azure-iot-ops\azure\identity\_credentials\__init__.py", line 5, in <module>
    from .authorization_code import AuthorizationCodeCredential
  File "C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure-cli-extensions\azure-iot-ops\azure\identity\_credentials\authorization_code.py", line 7, in <module>
    from azure.core.credentials import AccessToken, AccessTokenInfo, TokenRequestOptions
ImportError: cannot import name 'AccessTokenInfo' from 'azure.core.credentials' (C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\core\credentials.pyc)
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
Waiting for AIO to be deployed successfully on monterrey...waiting for 60 secondsWaiting for AIO to be deployed successfully on monterrey...waiting for 60 seconds
ERROR: The command failed with an unexpected error. Here is the traceback:
ERROR: cannot import name 'AccessTokenInfo' from 'azure.core.credentials' (C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\core\credentials.pyc)
Traceback (most recent call last):
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 564, in execute
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/__init__.py", line 526, in load_arguments
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 321, in load_arguments
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/commands.py", line 104, in load_arguments
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 125, in arguments_loader
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 59, in get_op_handler
  File "importlib\__init__.py", line 126, in import_module
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure-cli-extensions\azure-iot-ops\azext_edge\edge\commands_edge.py", line 18, in <module>
    from .providers.orchestration.common import (
  File "C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure-cli-extensions\azure-iot-ops\azext_edge\edge\providers\orchestration\__init__.py", line 8, in <module>
    from .deletion import delete_ops_resources
  File "C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure-cli-extensions\azure-iot-ops\azext_edge\edge\providers\orchestration\deletion.py", line 19, in <module>
    from ...util.az_client import get_resource_client, wait_for_terminal_states
  File "C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure-cli-extensions\azure-iot-ops\azext_edge\edge\util\az_client.py", line 16, in <module>
    from azure.identity import AzureCliCredential, ClientSecretCredential
  File "C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure-cli-extensions\azure-iot-ops\azure\identity\__init__.py", line 10, in <module>
    from ._credentials import (
  File "C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure-cli-extensions\azure-iot-ops\azure\identity\_credentials\__init__.py", line 5, in <module>
    from .authorization_code import AuthorizationCodeCredential
  File "C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure-cli-extensions\azure-iot-ops\azure\identity\_credentials\authorization_code.py", line 7, in <module>
    from azure.core.credentials import AccessToken, AccessTokenInfo, TokenRequestOptions
ImportError: cannot import name 'AccessTokenInfo' from 'azure.core.credentials' (C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\core\credentials.pyc)
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
Waiting for AIO to be deployed successfully on monterrey...waiting for 60 seconds

Environment { "azure-cli": "2.64.0", "azure-cli-core": "2.64.0", "azure-cli-telemetry": "1.1.0", "extensions": { "azure-iot-ops": "0.5.1b1", "customlocation": "0.1.3", "eventgrid": "1.0.0b1", "k8s-configuration": "2.0.0", "k8s-extension": "1.6.1", "kusto": "0.5.0", "storage-preview": "1.0.0b4" } }

mrhoads commented 1 month ago

Marking as closed, as it's fixed with #2741