mitch-dc / volkswagen_we_connect_id

Apache License 2.0
200 stars 52 forks source link

Name does not resolve #166

Open mnorrsken opened 1 year ago

mnorrsken commented 1 year ago

Name does not resolve when setting up integration.

Seems that login.apps.emea.vwapps.io does not exist


No config, happens when setting up in UI

Describe the bug

App cannot connect to login.apps.emea.vwapps.io as that dns does not exist when i try to do lookup

Debug log


Logger: custom_components.volkswagen_we_connect_id.config_flow
Source: deps/lib/python3.10/site-packages/weconnect/auth/openid_session.py:196
Integration: Volkswagen We Connect ID
First occurred: 13:41:38 (2 occurrences)
Last logged: 13:41:46

Unexpected exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn
    conn = connection.create_connection(
  File "/usr/local/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 "/usr/local/lib/python3.10/socket.py", line 955, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name does not resolve

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 386, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 358, in connect
    self.sock = conn = self._new_conn()
  File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0xffff7a3275b0>: Failed to establish a new connection: [Errno -2] Name does not resolve

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 489, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 815, in urlopen
    return self.urlopen(
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 815, in urlopen
    return self.urlopen(
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 815, in urlopen
    return self.urlopen(
  File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
    retries = retries.increment(
  File "/usr/local/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.apps.emea.vwapps.io', port=443): Max retries exceeded with url: /authorize?redirect_uri=weconnect%3A%2F%2Fauthenticated&nonce=170556581652181268341678624897 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0xffff7a3275b0>: Failed to establish a new connection: [Errno -2] Name does not resolve'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/volkswagen_we_connect_id/config_flow.py", line 64, in async_step_user
    info = await validate_input(self.hass, user_input)
  File "/config/custom_components/volkswagen_we_connect_id/config_flow.py", line 39, in validate_input
    await hass.async_add_executor_job(we_connect.login)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/deps/lib/python3.10/site-packages/weconnect/weconnect.py", line 169, in login
    self.__session.login()
  File "/config/deps/lib/python3.10/site-packages/weconnect/auth/we_connect_session.py", line 73, in login
    authorizationUrl = self.authorizationUrl(url='https://identity.vwgroup.io/oidc/v1/authorize')
  File "/config/deps/lib/python3.10/site-packages/weconnect/auth/we_connect_session.py", line 93, in authorizationUrl
    tryLoginResponse: requests.Response = self.get(authUrl, allow_redirects=False, access_type=AccessType.NONE)
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 600, in get
    return self.request("GET", url, **kwargs)
  File "/config/deps/lib/python3.10/site-packages/weconnect/auth/we_connect_session.py", line 67, in request
    return super(WeConnectSession, self).request(
  File "/config/deps/lib/python3.10/site-packages/weconnect/auth/openid_session.py", line 196, in request
    return super(OpenIDSession, self).request(
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 565, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='login.apps.emea.vwapps.io', port=443): Max retries exceeded with url: /authorize?redirect_uri=weconnect%3A%2F%2Fauthenticated&nonce=170556581652181268341678624897 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0xffff7a3275b0>: Failed to establish a new connection: [Errno -2] Name does not resolve'))
pplucky commented 1 year ago

Please make sure you update Home Assistant to latest version (or at least 2023.3.1), and then also update custom component to latest version (0.1.5), as the URLs have recently changed.

That should do the trick.

EdStark666 commented 1 year ago

Same Problem here. ID4, ID.SW 3.x Login via App and Web is working. If i try to enter the same credentials (VW ID SSO Username + PW) i get unexpected error. The logs showing: "Failed to establish a new connection: [Errno -2] Name does not resolve" If you need the full log, i can send it to you.

HA is up to date: Home Assistant 2023.4.6 Supervisor 2023.04.0 Operating System 10.0 Frontend 20230411.1 - latest