bebound / azure-cli

Azure Command-Line Interface
MIT License
0 stars 0 forks source link

AZ Login error on new silicon mac. #48

Open bebound opened 1 year ago

bebound commented 1 year ago

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az login

Errors:

[greg@CM-LT-0007 ~]$ 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 0x102319d20>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn
    conn = connection.create_connection(
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/urllib3/util/connection.py", line 73, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/opt/homebrew/Cellar/python@3.10/3.10.10/Frameworks/Python.framework/Versions/3.10/lib/python3.10/socket.py", line 955, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/urllib3/connectionpool.py", line 382, in _make_request
    self._validate_conn(conn)
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
    conn.connect()
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/urllib3/connection.py", line 358, in connect
    conn = self._new_conn()
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x102319d20>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/urllib3/connectionpool.py", line 783, in urlopen
    return self.urlopen(
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/urllib3/connectionpool.py", line 755, in urlopen
    retries = retries.increment(
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/urllib3/util/retry.py", line 574, 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 0x102319d20>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/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/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/azure/cli/command_modules/profile/custom.py", line 139, in login
    subscriptions = profile.login(
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/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/homebrew/Cellar/azure-cli/2.45.0/libexec/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/homebrew/Cellar/azure-cli/2.45.0/libexec/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/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/msal/application.py", line 1685, in __init__
    super(PublicClientApplication, self).__init__(
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/msal/application.py", line 533, in __init__
    self.authority = Authority(
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/msal/authority.py", line 120, in __init__
    openid_config = tenant_discovery(
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/msal/authority.py", line 175, in tenant_discovery
    resp = http_client.get(tenant_discovery_endpoint, **kwargs)
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/msal/individual_cache.py", line 269, in wrapper
    value = function(*args, **kwargs)
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/requests/sessions.py", line 555, in get
    return self.request('GET', url, **kwargs)
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/opt/homebrew/Cellar/azure-cli/2.45.0/libexec/lib/python3.10/site-packages/requests/adapters.py", line 516, 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 0x102319d20>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))```

## To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

- _Put any pre-requisite steps here..._
- Get new MacBook with Apple Silicon
- Install HomeBrew
- install azure cli via brew ` brew install azure-cli`
- `az login`

## Expected Behavior

I an presented with a browser window to authenticate

## Environment Summary

macOS-13.2-arm64-arm-64bit, Darwin 22.3.0 Python 3.10.10 Installer: HOMEBREW

azure-cli 2.45.0


## Additional Context

I'm able to login just fine on my old mac but not on the new one.  I have no problem logging in on my Mac via `login.microsoftonline.com`. 

I see in the issue archive this happens but I didn't see a clear solution.

<!--Please don't remove this:-->
<!--auto-generated-->

Copy from `https://github.com/Azure/azure-cli/issues/25432`
similar-bot-test[bot] commented 1 year ago
Find similar issue https://github.com/Azure/azure-cli/issues/21514.
Issue title Max retries exceeded with url
Create time 2022-03-03
Comment number 7