Azure / azure-cli

Azure Command-Line Interface
MIT License
4k stars 2.98k forks source link

az login: request() got an unexpected keyword argument 'enable_cae' #27131

Closed mm-supernice closed 1 year ago

mm-supernice commented 1 year ago

Describe the bug

when running "az login" after authentication in the browser (safari or edge) a stack trace is shown:

Related command

az login

Errors

The command failed with an unexpected error. Here is the traceback: request() got an unexpected keyword argument 'enable_cae' Traceback (most recent call last): File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute raise ex File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job result = cmd_copy(params) File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__ return self.handler(*args, **kwargs) File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(**command_args) File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/azure/cli/command_modules/profile/custom.py", line 139, in login subscriptions = profile.login( File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/azure/cli/core/_profile.py", line 176, in login subscriptions = subscription_finder.find_using_common_tenant(username, credential) File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/azure/cli/core/_profile.py", line 759, in find_using_common_tenant subscriptions = self.find_using_specific_tenant(tenant_id, specific_tenant_credential) File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/azure/cli/core/_profile.py", line 809, in find_using_specific_tenant for s in subscriptions: File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/azure/core/paging.py", line 123, in __next__ return next(self._page_iterator) File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/azure/core/paging.py", line 75, in __next__ self._response = self._get_next(self.continuation_token) File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/azure/mgmt/resource/subscriptions/v2019_11_01/operations/_operations.py", line 519, in get_next pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/azure/core/pipeline/_base.py", line 227, in run return first_node.send(pipeline_request) File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/azure/core/pipeline/_base.py", line 89, in send response = self.next.send(request) File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/azure/core/pipeline/_base.py", line 89, in send response = self.next.send(request) File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/azure/core/pipeline/_base.py", line 89, in send response = self.next.send(request) [Previous line repeated 2 more times] File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/azure/mgmt/core/policies/_base.py", line 46, in send response = self.next.send(request) File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/azure/core/pipeline/policies/_redirect.py", line 184, in send response = self.next.send(request) File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/azure/core/pipeline/policies/_retry.py", line 473, in send response = self.next.send(request) File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/azure/core/pipeline/policies/_authentication.py", line 120, in send self.on_request(request) File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/azure/core/pipeline/policies/_authentication.py", line 96, in on_request self._token = self._credential.get_token(*self._scopes, enable_cae=self._enable_cae) File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/azure/cli/core/auth/msal_authentication.py", line 69, in get_token result = self.acquire_token_silent_with_error(list(scopes), self._account, claims_challenge=claims, **kwargs) File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/msal/application.py", line 1279, in acquire_token_silent_with_error return _clean_up(self._acquire_token_silent_with_error( File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/msal/application.py", line 1301, in _acquire_token_silent_with_error result = self._acquire_token_silent_from_cache_and_possibly_refresh_it( File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/msal/application.py", line 1415, in _acquire_token_silent_from_cache_and_possibly_refresh_it result = self._acquire_token_silent_by_finding_rt_belongs_to_me_or_my_family( File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/msal/application.py", line 1471, in _acquire_token_silent_by_finding_rt_belongs_to_me_or_my_family last_resp = at = self._acquire_token_silent_by_finding_specific_refresh_token( File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/msal/application.py", line 1521, in _acquire_token_silent_by_finding_specific_refresh_token response = client.obtain_token_by_refresh_token( File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/msal/oauth2cli/oauth2.py", line 830, in obtain_token_by_refresh_token resp = super(Client, self).obtain_token_by_refresh_token( File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/msal/oauth2cli/oauth2.py", line 262, in obtain_token_by_refresh_token return self._obtain_token("refresh_token", data=data, **kwargs) File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/msal/oauth2cli/oidc.py", line 116, in _obtain_token ret = super(Client, self)._obtain_token(grant_type, *args, **kwargs) File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/msal/oauth2cli/oauth2.py", line 771, in _obtain_token resp = super(Client, self)._obtain_token( File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/msal/oauth2cli/oauth2.py", line 234, in _obtain_token resp = (post or self._http_client.post)( File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/msal/individual_cache.py", line 269, in wrapper value = function(*args, **kwargs) File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/msal/individual_cache.py", line 269, in wrapper value = function(*args, **kwargs) File "/Users/bill.gates/Library/Python/3.9/lib/python/site-packages/requests/sessions.py", line 637, in post return self.request("POST", url, data=data, json=json, **kwargs) TypeError: request() got an unexpected keyword argument 'enable_cae'

Issue script & Debug output

confidential

Expected behavior

login should work like on my linux machine

Environment Summary

macOS 12.6.8 zsh 5.8.1 Python 3.9.6

azure-cli 2.51.0

core 2.51.0 telemetry 1.1.0

Extensions: front-door 1.0.17

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

Python location '/Library/Developer/CommandLineTools/usr/bin/python3' Extensions directory '/Users/silicium/.azure/cliextensions'

Python (Darwin) 3.9.6 (default, Oct 18 2022, 12:41:40) [Clang 14.0.0 (clang-1400.0.29.202)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

yonzhan commented 1 year ago

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

uoaper commented 1 year ago

Have a similar problem executing az keyvault secret show ...

request() got an unexpected keyword argument 'enable_cae'

looks like it related with new core version https://pypi.org/project/azure-core/1.29.0/#history

AThomsen commented 1 year ago

Have a similar problem executing az keyvault secret show ...

request() got an unexpected keyword argument 'enable_cae'

looks like it related with new core version https://pypi.org/project/azure-core/1.29.0/#history

Yes! pip install azure-core==1.28.0 fixed it for me!

stanosaka commented 1 year ago

had the same issue , pip install azure-core==1.28.0 won't fix the issue. Environment: `az --version azure-cli 2.51.0

core 2.51.0 telemetry 1.1.0

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

Python location '/opt/azure-cli/bin/python' Extensions directory '/home/xyz/.azure/cliextensions'

Python (Linux) 3.11.3 (main, Jun 5 2023, 09:32:32) [GCC 13.1.1 20230429]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.`

mm-supernice commented 1 year ago

pip install azure-core==1.28.0

works for me, thank you!

gmoretti-ciandt commented 1 year ago

I had the same issue here, and pip install azure-core==1.28.0 does not work for me either.

When I run az login I have the follow stack:

CIANDT\gmoretti@lnb029081cps:~$ az login
A web browser has been opened at https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize. Please continue the login in the web browser. If no web browser is available or if the web browser fails to open, use device code flow with `az login --use-device-code`.
The command failed with an unexpected error. Here is the traceback:
Session.request() got an unexpected keyword argument 'enable_cae'
Traceback (most recent call last):
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/command_modules/profile/custom.py", line 139, in login
    subscriptions = profile.login(
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/_profile.py", line 176, in login
    subscriptions = subscription_finder.find_using_common_tenant(username, credential)
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/_profile.py", line 759, in find_using_common_tenant
    subscriptions = self.find_using_specific_tenant(tenant_id, specific_tenant_credential)
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/_profile.py", line 809, in find_using_specific_tenant
    for s in subscriptions:
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/core/paging.py", line 123, in __next__
    return next(self._page_iterator)
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/core/paging.py", line 75, in __next__
    self._response = self._get_next(self.continuation_token)
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/mgmt/resource/subscriptions/v2019_11_01/operations/_operations.py", line 519, in get_next
    pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/core/pipeline/_base.py", line 227, in run
    return first_node.send(pipeline_request)
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/core/pipeline/_base.py", line 89, in send
    response = self.next.send(request)
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/core/pipeline/_base.py", line 89, in send
    response = self.next.send(request)
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/core/pipeline/_base.py", line 89, in send
    response = self.next.send(request)
  [Previous line repeated 2 more times]
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/mgmt/core/policies/_base.py", line 46, in send
    response = self.next.send(request)
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/core/pipeline/policies/_redirect.py", line 184, in send
    response = self.next.send(request)
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/core/pipeline/policies/_retry.py", line 473, in send
    response = self.next.send(request)
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/core/pipeline/policies/_authentication.py", line 120, in send
    self.on_request(request)
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/core/pipeline/policies/_authentication.py", line 96, in on_request
    self._token = self._credential.get_token(*self._scopes, enable_cae=self._enable_cae)
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/azure/cli/core/auth/msal_authentication.py", line 69, in get_token
    result = self.acquire_token_silent_with_error(list(scopes), self._account, claims_challenge=claims, **kwargs)
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/msal/application.py", line 1279, in acquire_token_silent_with_error
    return _clean_up(self._acquire_token_silent_with_error(
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/msal/application.py", line 1301, in _acquire_token_silent_with_error
    result = self._acquire_token_silent_from_cache_and_possibly_refresh_it(
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/msal/application.py", line 1415, in _acquire_token_silent_from_cache_and_possibly_refresh_it
    result = self._acquire_token_silent_by_finding_rt_belongs_to_me_or_my_family(
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/msal/application.py", line 1471, in _acquire_token_silent_by_finding_rt_belongs_to_me_or_my_family
    last_resp = at = self._acquire_token_silent_by_finding_specific_refresh_token(
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/msal/application.py", line 1521, in _acquire_token_silent_by_finding_specific_refresh_token
    response = client.obtain_token_by_refresh_token(
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/msal/oauth2cli/oauth2.py", line 830, in obtain_token_by_refresh_token
    resp = super(Client, self).obtain_token_by_refresh_token(
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/msal/oauth2cli/oauth2.py", line 262, in obtain_token_by_refresh_token
    return self._obtain_token("refresh_token", data=data, **kwargs)
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/msal/oauth2cli/oidc.py", line 116, in _obtain_token
    ret = super(Client, self)._obtain_token(grant_type, *args, **kwargs)
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/msal/oauth2cli/oauth2.py", line 771, in _obtain_token
    resp = super(Client, self)._obtain_token(
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/msal/oauth2cli/oauth2.py", line 234, in _obtain_token
    resp = (post or self._http_client.post)(
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/msal/individual_cache.py", line 269, in wrapper
    value = function(*args, **kwargs)
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/msal/individual_cache.py", line 269, in wrapper
    value = function(*args, **kwargs)
  File "/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/lib/python3.10/site-packages/requests/sessions.py", line 637, in post
    return self.request("POST", url, data=data, json=json, **kwargs)
TypeError: Session.request() got an unexpected keyword argument 'enable_cae'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

My AZ Version

 az --version
azure-cli                         2.51.0

core                              2.51.0
telemetry                          1.1.0

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

Python location '/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/bin/python3'
Extensions directory '/home/gmoretti/.azure/cliextensions'

Python (Linux) 3.10.11 (main, Aug  9 2023, 01:39:21) [GCC 11.4.0]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.
akfmdl commented 1 year ago

I had the same issue, i got an error below using cli 'az login' but i could login using azureml-core sdk after pip install azure-core==1.28.0

The command failed with an unexpected error. Here is the traceback: request() got an unexpected keyword argument 'enable_cae' Traceback (most recent call last): File "/root/lib/azure-cli/lib/python3.8/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/root/lib/azure-cli/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute raise ex File "/root/lib/azure-cli/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) File "/root/lib/azure-cli/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job result = cmd_copy(params) File "/root/lib/azure-cli/lib/python3.8/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__ return self.handler(*args, **kwargs) File "/root/lib/azure-cli/lib/python3.8/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(**command_args) File "/root/lib/azure-cli/lib/python3.8/site-packages/azure/cli/command_modules/profile/custom.py", line 139, in login subscriptions = profile.login( File "/root/lib/azure-cli/lib/python3.8/site-packages/azure/cli/core/_profile.py", line 176, in login subscriptions = subscription_finder.find_using_common_tenant(username, credential) File "/root/lib/azure-cli/lib/python3.8/site-packages/azure/cli/core/_profile.py", line 759, in find_using_common_tenant subscriptions = self.find_using_specific_tenant(tenant_id, specific_tenant_credential) File "/root/lib/azure-cli/lib/python3.8/site-packages/azure/cli/core/_profile.py", line 809, in find_using_specific_tenant for s in subscriptions: File "/root/lib/azure-cli/lib/python3.8/site-packages/azure/core/paging.py", line 123, in __next__ return next(self._page_iterator) File "/root/lib/azure-cli/lib/python3.8/site-packages/azure/core/paging.py", line 75, in __next__ self._response = self._get_next(self.continuation_token) File "/root/lib/azure-cli/lib/python3.8/site-packages/azure/mgmt/resource/subscriptions/v2019_11_01/operations/_operations.py", line 519, in get_next pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access File "/root/lib/azure-cli/lib/python3.8/site-packages/azure/core/pipeline/_base.py", line 227, in run return first_node.send(pipeline_request) File "/root/lib/azure-cli/lib/python3.8/site-packages/azure/core/pipeline/_base.py", line 89, in send response = self.next.send(request) File "/root/lib/azure-cli/lib/python3.8/site-packages/azure/core/pipeline/_base.py", line 89, in send response = self.next.send(request) File "/root/lib/azure-cli/lib/python3.8/site-packages/azure/core/pipeline/_base.py", line 89, in send response = self.next.send(request) [Previous line repeated 2 more times] File "/root/lib/azure-cli/lib/python3.8/site-packages/azure/mgmt/core/policies/_base.py", line 46, in send response = self.next.send(request) File "/root/lib/azure-cli/lib/python3.8/site-packages/azure/core/pipeline/policies/_redirect.py", line 184, in send response = self.next.send(request) File "/root/lib/azure-cli/lib/python3.8/site-packages/azure/core/pipeline/policies/_retry.py", line 473, in send response = self.next.send(request) File "/root/lib/azure-cli/lib/python3.8/site-packages/azure/core/pipeline/policies/_authentication.py", line 120, in send self.on_request(request) File "/root/lib/azure-cli/lib/python3.8/site-packages/azure/core/pipeline/policies/_authentication.py", line 96, in on_request self._token = self._credential.get_token(*self._scopes, enable_cae=self._enable_cae) File "/root/lib/azure-cli/lib/python3.8/site-packages/azure/cli/core/auth/msal_authentication.py", line 69, in get_token result = self.acquire_token_silent_with_error(list(scopes), self._account, claims_challenge=claims, **kwargs) File "/root/lib/azure-cli/lib/python3.8/site-packages/msal/application.py", line 1279, in acquire_token_silent_with_error return _clean_up(self._acquire_token_silent_with_error( File "/root/lib/azure-cli/lib/python3.8/site-packages/msal/application.py", line 1301, in _acquire_token_silent_with_error result = self._acquire_token_silent_from_cache_and_possibly_refresh_it( File "/root/lib/azure-cli/lib/python3.8/site-packages/msal/application.py", line 1415, in _acquire_token_silent_from_cache_and_possibly_refresh_it result = self._acquire_token_silent_by_finding_rt_belongs_to_me_or_my_family( File "/root/lib/azure-cli/lib/python3.8/site-packages/msal/application.py", line 1471, in _acquire_token_silent_by_finding_rt_belongs_to_me_or_my_family last_resp = at = self._acquire_token_silent_by_finding_specific_refresh_token( File "/root/lib/azure-cli/lib/python3.8/site-packages/msal/application.py", line 1521, in _acquire_token_silent_by_finding_specific_refresh_token response = client.obtain_token_by_refresh_token( File "/root/lib/azure-cli/lib/python3.8/site-packages/msal/oauth2cli/oauth2.py", line 830, in obtain_token_by_refresh_token resp = super(Client, self).obtain_token_by_refresh_token( File "/root/lib/azure-cli/lib/python3.8/site-packages/msal/oauth2cli/oauth2.py", line 262, in obtain_token_by_refresh_token return self._obtain_token("refresh_token", data=data, **kwargs) File "/root/lib/azure-cli/lib/python3.8/site-packages/msal/oauth2cli/oidc.py", line 116, in _obtain_token ret = super(Client, self)._obtain_token(grant_type, *args, **kwargs) File "/root/lib/azure-cli/lib/python3.8/site-packages/msal/oauth2cli/oauth2.py", line 771, in _obtain_token resp = super(Client, self)._obtain_token( File "/root/lib/azure-cli/lib/python3.8/site-packages/msal/oauth2cli/oauth2.py", line 234, in _obtain_token resp = (post or self._http_client.post)( File "/root/lib/azure-cli/lib/python3.8/site-packages/msal/individual_cache.py", line 269, in wrapper value = function(*args, **kwargs) File "/root/lib/azure-cli/lib/python3.8/site-packages/msal/individual_cache.py", line 269, in wrapper value = function(*args, **kwargs) File "/root/lib/azure-cli/lib/python3.8/site-packages/requests/sessions.py", line 637, in post return self.request("POST", url, data=data, json=json, **kwargs) TypeError: request() got an unexpected keyword argument 'enable_cae'

swang-cc commented 1 year ago

15:18 EST, Still having this issue.

mishatal commented 1 year ago

What is the other option to work around the issue (when installing azure-core==1.28.0 doesn't help)? What is ETA of the fix?

sravansurab commented 1 year ago

az ml online-endpoint list throwing same error

katymccl commented 1 year ago

We are also experiencing this issue with az quantum endpoint, specifically the az quantum target list command. We are experiencing this issue in our ADO release pipelines which utilize the Azure cli. This is affecting running e2e tests for our weekly deployments.

pvaneck commented 1 year ago

Pinning azure-core to 1.28.0 for now should work as a workaround since enable_cae was introduced in 1.29.0. If you are still seeing this error after pip install azure-core==1.28.0 , it could be azure-core isn't being downgraded in the correct environment.

In any case, a patch for azure-core should be released very shortly to help mitigate this issue for those using the latest version of azure-core. And, there is also a PR on the CLI side (#27135) which should fix this on the cli side. However, I think further thought should be put into what kwargs should be passed into MSAL because there could potentially be other unexpected kwargs passed in from get_token to msal methods in the future.

pvaneck commented 1 year ago

A patch release of azure-core has been released (1.29.1) which should resolve this issue for those newly installing azure-cli from PyPI. However, enable_cae still needs to be handled on the azure cli side as well for when it's inevitably used by azure mgmt SDKs.

swang-cc commented 1 year ago

Confirmed. It is working again.

gmoretti-ciandt commented 1 year ago

Here works for me, I just need to update the azure-core in pip to 1.29.1, in my case the the pip inside the azure-cli instalation. For example the az --version inform the location of the python that azure-cli are using:

Python location '/home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/bin/python3'

So I run /home/gmoretti/.asdf/installs/azure-cli/2.51.0/bin/venv/bin/pip install azure-core==1.29.1

After that my login works!

jiasli commented 1 year ago

Root cause

This issue is causes by a change in azure-core==1.29.0 which passes enable_cae to get_token protocol (https://github.com/Azure/azure-sdk-for-python/pull/31012). This unexpected argument breaks Azure CLI and MSAL.

Solution

This issue has been fixed in azure-core==1.29.1 which doesn't pass enable_cae to get_token protocol unless enable_cae is explicitly set to True (https://github.com/Azure/azure-sdk-for-python/pull/31546).

Please upgrade azure-core in Azure CLI's environment to the latest version with

pip install --upgrade azure-core

* pip should be the one from Azure CLI's environment.

Additional Information

Installing Azure CLI with pip is not officially supported. If possible, we highly recommend following https://learn.microsoft.com/en-us/cli/azure/install-azure-cli to install official Azure CLI packages delivered by Microsoft.

jiasli commented 1 year ago

If you are still seeing this error after pip install azure-core==1.28.0 , it could be azure-core isn't being downgraded in the correct environment.

@pvaneck is absolutely correct. Make sure you run pip from Azure CLI's environment or use Azure CLI's Python interpreter to run pip. You may check the location of Azure CLI's Python interpreter with az --version:

$ az --version
...
Python location '/opt/az/bin/python3'

Then run

<path_to_python> -m pip install --upgrade azure-core

@stanosaka, how did you install Azure CLI? You are using Python 3.11 which Azure CLI doesn't support yet (https://github.com/Azure/azure-cli/pull/26923). The Python executable in Azure CLI's DEB package is /opt/az/bin/python3.

stanosaka commented 1 year ago

@jiasli Thank you for the information. I installed by yay -S azure-cli, it works for me now, after i installed by yay -S azure-cli-bin. Thanks.

SJaffa commented 1 year ago

I seem to get this if I run az login but not if I use az login --tenant <my-tenant-name>

jonhyat commented 1 year ago

az login The command failed with an unexpected error. Here is the traceback: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x797dfcebf100>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn conn = connection.create_connection( File "/opt/az/lib/python3.10/site-packages/urllib3/util/connection.py", line 72, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "/opt/az/lib/python3.10/socket.py", line 955, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 714, in urlopen httplib_response = self._make_request( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 403, in _make_request self._validate_conn(conn) File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1053, in _validate_conn conn.connect() File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 363, in connect self.sock = conn = self._new_conn() File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x797dfcebf100>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 826, in urlopen return self.urlopen( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 798, in urlopen retries = retries.increment( File "/opt/az/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x797dfcebf100>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 663, in execute raise ex File "/opt/az/lib/python3.10/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/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job result = cmd_copy(params) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 333, in call return self.handler(*args, kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(command_args) File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/profile/custom.py", line 139, in login subscriptions = profile.login( File "/opt/az/lib/python3.10/site-packages/azure/cli/core/_profile.py", line 154, in login user_identity = identity.login_with_auth_code(scopes=scopes, kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/auth/identity.py", line 153, in login_with_auth_code result = self._msal_app.acquire_token_interactive( File "/opt/az/lib/python3.10/site-packages/azure/cli/core/auth/identity.py", line 112, in _msal_app self._msal_app_instance = PublicClientApplication(self.client_id, self._msal_app_kwargs) File "/opt/az/lib/python3.10/site-packages/msal/application.py", line 1718, in init super(PublicClientApplication, self).init( File "/opt/az/lib/python3.10/site-packages/msal/application.py", line 549, in init self.authority = Authority( File "/opt/az/lib/python3.10/site-packages/msal/authority.py", line 115, in init openid_config = tenant_discovery( File "/opt/az/lib/python3.10/site-packages/msal/authority.py", line 180, in tenant_discovery resp = http_client.get(tenant_discovery_endpoint, *kwargs) File "/opt/az/lib/python3.10/site-packages/msal/individual_cache.py", line 269, in wrapper value = function(args, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 602, in get return self.request("GET", url, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, send_kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/adapters.py", line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x797dfcebf100>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) To check existing issues, please visit: https://github.com/Azure/azure-cli/issues john@penguin:~/nx-stable-diffusion$ az login The command failed with an unexpected error. Here is the traceback: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7c1d61c07100>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn conn = connection.create_connection( File "/opt/az/lib/python3.10/site-packages/urllib3/util/connection.py", line 72, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "/opt/az/lib/python3.10/socket.py", line 955, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 714, in urlopen httplib_response = self._make_request( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 403, in _make_request self._validate_conn(conn) File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1053, in _validate_conn conn.connect() File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 363, in connect self.sock = conn = self._new_conn() File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7c1d61c07100>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 826, in urlopen return self.urlopen( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 798, in urlopen retries = retries.increment( File "/opt/az/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7c1d61c07100>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 663, in execute raise ex File "/opt/az/lib/python3.10/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/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job result = cmd_copy(params) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 333, in call return self.handler(*args, kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(command_args) File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/profile/custom.py", line 139, in login subscriptions = profile.login( File "/opt/az/lib/python3.10/site-packages/azure/cli/core/_profile.py", line 154, in login user_identity = identity.login_with_auth_code(scopes=scopes, kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/auth/identity.py", line 153, in login_with_auth_code result = self._msal_app.acquire_token_interactive( File "/opt/az/lib/python3.10/site-packages/azure/cli/core/auth/identity.py", line 112, in _msal_app self._msal_app_instance = PublicClientApplication(self.client_id, self._msal_app_kwargs) File "/opt/az/lib/python3.10/site-packages/msal/application.py", line 1718, in init super(PublicClientApplication, self).init( File "/opt/az/lib/python3.10/site-packages/msal/application.py", line 549, in init self.authority = Authority( File "/opt/az/lib/python3.10/site-packages/msal/authority.py", line 115, in init openid_config = tenant_discovery( File "/opt/az/lib/python3.10/site-packages/msal/authority.py", line 180, in tenant_discovery resp = http_client.get(tenant_discovery_endpoint, *kwargs) File "/opt/az/lib/python3.10/site-packages/msal/individual_cache.py", line 269, in wrapper value = function(args, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 602, in get return self.request("GET", url, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, send_kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/adapters.py", line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7c1d61c07100>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) To check existing issues, please visit: https://github.com/Azure/azure-cli/issues john@penguin:~/nx-stable-diffusion$ az login --debug cli.knack.cli: Command arguments: ['login', '--debug'] cli.knack.cli: init debug log: Enable color in terminal. cli.knack.cli: Event: Cli.PreExecute [] cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x78af1f41d360>, <function OutputProducer.on_global_arguments at 0x78af1f374280>, <function CLIQuery.on_global_arguments at 0x78af1f195480>] cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate [] cli.azure.cli.core: Modules found from index for 'login': ['azure.cli.command_modules.profile'] cli.azure.cli.core: Loading command modules: cli.azure.cli.core: Name Load Time Groups Commands cli.azure.cli.core: profile 0.006 2 9 cli.azure.cli.core: Total (1) 0.006 2 9 cli.azure.cli.core: Loaded 2 groups, 9 commands. cli.azure.cli.core: Found a match in the command table. cli.azure.cli.core: Raw command : login cli.azure.cli.core: Command table: login cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x78af1e552cb0>] cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/john/.azure/commands/2023-08-17.11-56-54.login.940.log'. az_command_data_logger: command args: login --debug cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x78af1e56b7f0>] cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad [] cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x78af1e5b5630>, <function register_cache_arguments..add_cache_arguments at 0x78af1e5b5750>] cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded [] cli.knack.cli: Event: CommandInvoker.OnPreParseArgs [] cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x78af1f374310>, <function CLIQuery.handle_query_parameter at 0x78af1f195510>, <function register_ids_argument..parse_ids_arguments at 0x78af1e5b56c0>] cli.azure.cli.core.auth.persistence: build_persistence: location='/home/john/.azure/msal_token_cache.json', encrypt=False cli.azure.cli.core.auth.binary_cache: load: /home/john/.azure/msal_http_cache.bin urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None) urllib3.connectionpool: Starting new HTTPS connection (1): login.microsoftonline.com:443 urllib3.util.retry: Incremented Retry for (url='/organizations/v2.0/.well-known/openid-configuration'): Retry(total=0, connect=None, read=None, redirect=None, status=None) urllib3.connectionpool: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x78af1dff3070>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /organizations/v2.0/.well-known/openid-configuration urllib3.connectionpool: Starting new HTTPS connection (2): login.microsoftonline.com:443 cli.azure.cli.core.azclierror: Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn conn = connection.create_connection( File "/opt/az/lib/python3.10/site-packages/urllib3/util/connection.py", line 72, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "/opt/az/lib/python3.10/socket.py", line 955, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 714, in urlopen httplib_response = self._make_request( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 403, in _make_request self._validate_conn(conn) File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1053, in _validate_conn conn.connect() File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 363, in connect self.sock = conn = self._new_conn() File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x78af1dff3280>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 826, in urlopen return self.urlopen( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 798, in urlopen retries = retries.increment( File "/opt/az/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x78af1dff3280>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 663, in execute raise ex File "/opt/az/lib/python3.10/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/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job result = cmd_copy(params) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 333, in call return self.handler(*args, kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(command_args) File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/profile/custom.py", line 139, in login subscriptions = profile.login( File "/opt/az/lib/python3.10/site-packages/azure/cli/core/_profile.py", line 154, in login user_identity = identity.login_with_auth_code(scopes=scopes, kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/auth/identity.py", line 153, in login_with_auth_code result = self._msal_app.acquire_token_interactive( File "/opt/az/lib/python3.10/site-packages/azure/cli/core/auth/identity.py", line 112, in _msal_app self._msal_app_instance = PublicClientApplication(self.client_id, self._msal_app_kwargs) File "/opt/az/lib/python3.10/site-packages/msal/application.py", line 1718, in init super(PublicClientApplication, self).init( File "/opt/az/lib/python3.10/site-packages/msal/application.py", line 549, in init self.authority = Authority( File "/opt/az/lib/python3.10/site-packages/msal/authority.py", line 115, in init openid_config = tenant_discovery( File "/opt/az/lib/python3.10/site-packages/msal/authority.py", line 180, in tenant_discovery resp = http_client.get(tenant_discovery_endpoint, *kwargs) File "/opt/az/lib/python3.10/site-packages/msal/individual_cache.py", line 269, in wrapper value = function(args, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 602, in get return self.request("GET", url, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, send_kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/adapters.py", line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x78af1dff3280>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))

cli.azure.cli.core.azclierror: The command failed with an unexpected error. Here is the traceback: az_command_data_logger: The command failed with an unexpected error. Here is the traceback: cli.azure.cli.core.azclierror: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x78af1dff3280>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn conn = connection.create_connection( File "/opt/az/lib/python3.10/site-packages/urllib3/util/connection.py", line 72, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "/opt/az/lib/python3.10/socket.py", line 955, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 714, in urlopen httplib_response = self._make_request( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 403, in _make_request self._validate_conn(conn) File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1053, in _validate_conn conn.connect() File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 363, in connect self.sock = conn = self._new_conn() File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x78af1dff3280>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 826, in urlopen return self.urlopen( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 798, in urlopen retries = retries.increment( File "/opt/az/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x78af1dff3280>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 663, in execute raise ex File "/opt/az/lib/python3.10/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/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job result = cmd_copy(params) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 333, in call return self.handler(*args, kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(command_args) File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/profile/custom.py", line 139, in login subscriptions = profile.login( File "/opt/az/lib/python3.10/site-packages/azure/cli/core/_profile.py", line 154, in login user_identity = identity.login_with_auth_code(scopes=scopes, kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/auth/identity.py", line 153, in login_with_auth_code result = self._msal_app.acquire_token_interactive( File "/opt/az/lib/python3.10/site-packages/azure/cli/core/auth/identity.py", line 112, in _msal_app self._msal_app_instance = PublicClientApplication(self.client_id, self._msal_app_kwargs) File "/opt/az/lib/python3.10/site-packages/msal/application.py", line 1718, in init super(PublicClientApplication, self).init( File "/opt/az/lib/python3.10/site-packages/msal/application.py", line 549, in init self.authority = Authority( File "/opt/az/lib/python3.10/site-packages/msal/authority.py", line 115, in init openid_config = tenant_discovery( File "/opt/az/lib/python3.10/site-packages/msal/authority.py", line 180, in tenant_discovery resp = http_client.get(tenant_discovery_endpoint, *kwargs) File "/opt/az/lib/python3.10/site-packages/msal/individual_cache.py", line 269, in wrapper value = function(args, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 602, in get return self.request("GET", url, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, send_kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/adapters.py", line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x78af1dff3280>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) az_command_data_logger: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x78af1dff3280>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn conn = connection.create_connection( File "/opt/az/lib/python3.10/site-packages/urllib3/util/connection.py", line 72, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "/opt/az/lib/python3.10/socket.py", line 955, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 714, in urlopen httplib_response = self._make_request( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 403, in _make_request self._validate_conn(conn) File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1053, in _validate_conn conn.connect() File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 363, in connect self.sock = conn = self._new_conn() File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x78af1dff3280>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 826, in urlopen return self.urlopen( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 798, in urlopen retries = retries.increment( File "/opt/az/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x78af1dff3280>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 663, in execute raise ex File "/opt/az/lib/python3.10/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/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job result = cmd_copy(params) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 333, in call return self.handler(*args, kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(command_args) File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/profile/custom.py", line 139, in login subscriptions = profile.login( File "/opt/az/lib/python3.10/site-packages/azure/cli/core/_profile.py", line 154, in login user_identity = identity.login_with_auth_code(scopes=scopes, kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/auth/identity.py", line 153, in login_with_auth_code result = self._msal_app.acquire_token_interactive( File "/opt/az/lib/python3.10/site-packages/azure/cli/core/auth/identity.py", line 112, in _msal_app self._msal_app_instance = PublicClientApplication(self.client_id, self._msal_app_kwargs) File "/opt/az/lib/python3.10/site-packages/msal/application.py", line 1718, in init super(PublicClientApplication, self).init( File "/opt/az/lib/python3.10/site-packages/msal/application.py", line 549, in init self.authority = Authority( File "/opt/az/lib/python3.10/site-packages/msal/authority.py", line 115, in init openid_config = tenant_discovery( File "/opt/az/lib/python3.10/site-packages/msal/authority.py", line 180, in tenant_discovery resp = http_client.get(tenant_discovery_endpoint, *kwargs) File "/opt/az/lib/python3.10/site-packages/msal/individual_cache.py", line 269, in wrapper value = function(args, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 602, in get return self.request("GET", url, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, send_kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/adapters.py", line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x78af1dff3280>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) To check existing issues, please visit: https://github.com/Azure/azure-cli/issues cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x78af1e552ef0>] az_command_data_logger: exit code: 1 cli.main: Command ran in 40.861 seconds (init: 0.349, invoke: 40.512) telemetry.main: Begin splitting cli events and extra events, total events: 1 telemetry.client: Accumulated 0 events. Flush the clients. telemetry.main: Finish splitting cli events and extra events, cli events: 1 telemetry.save: Save telemetry record of length 7427 in cache telemetry.main: Begin creating telemetry upload process. telemetry.process: Creating upload process: "/usr/bin/../../opt/az/bin/python3 /opt/az/lib/python3.10/site-packages/azure/cli/telemetry/init.py /home/john/.azure" telemetry.process: Return from creating process telemetry.main: Finish creating telemetry upload process. john@penguin:~/nx-stable-diffusion$ az login --use-device.code unrecognized arguments: --use-device.code

Examples from AI knowledge base: https://aka.ms/cli_ref Read more about the command in reference docs john@penguin:~/nx-stable-diffusion$ az login --use-device-code The command failed with an unexpected error. Here is the traceback: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f008d57e620>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn conn = connection.create_connection( File "/opt/az/lib/python3.10/site-packages/urllib3/util/connection.py", line 72, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "/opt/az/lib/python3.10/socket.py", line 955, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 714, in urlopen httplib_response = self._make_request( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 403, in _make_request self._validate_conn(conn) File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1053, in _validate_conn conn.connect() File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 363, in connect self.sock = conn = self._new_conn() File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f008d57e620>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 826, in urlopen return self.urlopen( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 798, in urlopen retries = retries.increment( File "/opt/az/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f008d57e620>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 663, in execute raise ex File "/opt/az/lib/python3.10/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/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job result = cmd_copy(params) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 333, in call return self.handler(args, kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(command_args) File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/profile/custom.py", line 139, in login subscriptions = profile.login( File "/opt/az/lib/python3.10/site-packages/azure/cli/core/_profile.py", line 152, in login user_identity = identity.login_with_device_code(scopes=scopes, kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/auth/identity.py", line 162, in login_with_device_code flow = self._msal_app.initiate_device_flow(scopes, kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/auth/identity.py", line 112, in _msal_app self._msal_app_instance = PublicClientApplication(self.client_id, self._msal_app_kwargs) File "/opt/az/lib/python3.10/site-packages/msal/application.py", line 1718, in init super(PublicClientApplication, self).init( File "/opt/az/lib/python3.10/site-packages/msal/application.py", line 549, in init self.authority = Authority( File "/opt/az/lib/python3.10/site-packages/msal/authority.py", line 115, in init openid_config = tenant_discovery( File "/opt/az/lib/python3.10/site-packages/msal/authority.py", line 180, in tenant_discovery resp = http_client.get(tenant_discovery_endpoint, kwargs) File "/opt/az/lib/python3.10/site-packages/msal/individual_cache.py", line 269, in wrapper value = function(args, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 602, in get return self.request("GET", url, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, send_kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/adapters.py", line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f008d57e620>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) To check existing issues, please visit: https://github.com/Azure/azure-cli/issues john@penguin:~/nx-stable-diffusion$ az login The command failed with an unexpected error. Here is the traceback: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7e14d965b100>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn conn = connection.create_connection( File "/opt/az/lib/python3.10/site-packages/urllib3/util/connection.py", line 72, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "/opt/az/lib/python3.10/socket.py", line 955, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 714, in urlopen httplib_response = self._make_request( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 403, in _make_request self._validate_conn(conn) File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1053, in _validate_conn conn.connect() File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 363, in connect self.sock = conn = self._new_conn() File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7e14d965b100>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 826, in urlopen return self.urlopen( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 798, in urlopen retries = retries.increment( File "/opt/az/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7e14d965b100>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 663, in execute raise ex File "/opt/az/lib/python3.10/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/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job result = cmd_copy(params) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 333, in call return self.handler(*args, kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(command_args) File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/profile/custom.py", line 139, in login subscriptions = profile.login( File "/opt/az/lib/python3.10/site-packages/azure/cli/core/_profile.py", line 154, in login user_identity = identity.login_with_auth_code(scopes=scopes, kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/auth/identity.py", line 153, in login_with_auth_code result = self._msal_app.acquire_token_interactive( File "/opt/az/lib/python3.10/site-packages/azure/cli/core/auth/identity.py", line 112, in _msal_app self._msal_app_instance = PublicClientApplication(self.client_id, self._msal_app_kwargs) File "/opt/az/lib/python3.10/site-packages/msal/application.py", line 1718, in init super(PublicClientApplication, self).init( File "/opt/az/lib/python3.10/site-packages/msal/application.py", line 549, in init self.authority = Authority( File "/opt/az/lib/python3.10/site-packages/msal/authority.py", line 115, in init openid_config = tenant_discovery( File "/opt/az/lib/python3.10/site-packages/msal/authority.py", line 180, in tenant_discovery resp = http_client.get(tenant_discovery_endpoint, *kwargs) File "/opt/az/lib/python3.10/site-packages/msal/individual_cache.py", line 269, in wrapper value = function(args, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 602, in get return self.request("GET", url, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, send_kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/adapters.py", line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7e14d965b100>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) To check existing issues, please visit: https://github.com/Azure/azure-cli/issues john@penguin:~/nx-stable-diffusion$ az login The command failed with an unexpected error. Here is the traceback: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7ad2661e3100>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn conn = connection.create_connection( File "/opt/az/lib/python3.10/site-packages/urllib3/util/connection.py", line 72, in create_connection for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM): File "/opt/az/lib/python3.10/socket.py", line 955, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 714, in urlopen httplib_response = self._make_request( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 403, in _make_request self._validate_conn(conn) File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1053, in _validate_conn conn.connect() File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 363, in connect self.sock = conn = self._new_conn() File "/opt/az/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7ad2661e3100>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 826, in urlopen return self.urlopen( File "/opt/az/lib/python3.10/site-packages/urllib3/connectionpool.py", line 798, in urlopen retries = retries.increment( File "/opt/az/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7ad2661e3100>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 663, in execute raise ex File "/opt/az/lib/python3.10/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/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job result = cmd_copy(params) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 333, in call return self.handler(*args, kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(command_args) File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/profile/custom.py", line 139, in login subscriptions = profile.login( File "/opt/az/lib/python3.10/site-packages/azure/cli/core/_profile.py", line 154, in login user_identity = identity.login_with_auth_code(scopes=scopes, kwargs) File "/opt/az/lib/python3.10/site-packages/azure/cli/core/auth/identity.py", line 153, in login_with_auth_code result = self._msal_app.acquire_token_interactive( File "/opt/az/lib/python3.10/site-packages/azure/cli/core/auth/identity.py", line 112, in _msal_app self._msal_app_instance = PublicClientApplication(self.client_id, self._msal_app_kwargs) File "/opt/az/lib/python3.10/site-packages/msal/application.py", line 1718, in init super(PublicClientApplication, self).init( File "/opt/az/lib/python3.10/site-packages/msal/application.py", line 549, in init self.authority = Authority( File "/opt/az/lib/python3.10/site-packages/msal/authority.py", line 115, in init openid_config = tenant_discovery( File "/opt/az/lib/python3.10/site-packages/msal/authority.py", line 180, in tenant_discovery resp = http_client.get(tenant_discovery_endpoint, *kwargs) File "/opt/az/lib/python3.10/site-packages/msal/individual_cache.py", line 269, in wrapper value = function(args, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 602, in get return self.request("GET", url, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, send_kwargs) File "/opt/az/lib/python3.10/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, kwargs) File "/opt/az/lib/python3.10/site-packages/requests/adapters.py", line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /organizations/v2.0/.well-known/openid-configuration (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7ad2661e3100>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')) To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

manish-tkprasad commented 1 year ago

My yaml pipeline was working fine until last week and I am also facing this issue where in my yaml pipeline calling the "az keyvault secret download" from linux agent and getting the error as ERROR: request() got an unexpected keyword argument 'enable_cae'

This got fixed with pip install azure-core==1.28.0, but as part of another job which runs on windows agent, we use -task: AzureKeyVault@2 to get the secret and ssh to the linux vm, here the ssh is timing out and I am suspecting again this is due to this recent change.

jiasli commented 1 year ago

@jonhyat, the error [Errno -3] Temporary failure in name resolution you are facing belongs to a different issue. Please refer to https://github.com/Azure/azure-cli/issues/26213, https://github.com/Azure/azure-cli/issues/16524.

jiasli commented 1 year ago

@manish-tkprasad, ssh timing out is irrelevant to this issue. Please create a new issue at https://github.com/Azure/azure-cli/issues/new/choose with requested information.