Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection failed #6

Closed
2Wanderer opened this issue Jul 11, 2024 · 6 comments
Closed

Connection failed #6

2Wanderer opened this issue Jul 11, 2024 · 6 comments
Assignees

Comments

@2Wanderer
Copy link

2Wanderer commented Jul 11, 2024

Hi! i currently experiencing an issue with the API connection to parkeerloket.zwolle.nl if i recall correctly after the 07-2024 HA update, are there more people having this issue? when i try to reconnect is says unknown error
image

image

@ChessSpider ChessSpider self-assigned this Jul 12, 2024
@ChessSpider
Copy link
Owner

Hi @2Wanderer , did the DVSPortal integration break first, and after you tried to re-add it which fails?

For me the integration still works without issue.

It seems to be this line throwing the error; https://github.com/ChessSpider/py-dvsportal/blob/main/dvsportal/dvsportal.py#L120C19-L120C56 - I have extended the error logging via this commit #7

Can you update DVSportal to the latest version, retry it, and show me the error? You'll have to click the error in the logs, and more details will show.

When I try it; I get this error aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host parkeerloket.zwolle.nl:443 ssl:default [Network unreachable]. Which I cannot explain, as it should work. But im curious if you get the same error in the traceback

@2Wanderer
Copy link
Author

2Wanderer commented Jul 12, 2024

Yes, i noticed it had become unresponsive I then deleted and tried to re-add the integration

i have updated the repo and tried to login again,
i throws the following error:

Logger: root
Bron: custom_components/dvsportal/config_flow.py:58
integratie: DVSPortal ([documentatie](https://github.com/chessspider/dvsportal#readme), [problemen](https://github.com/ChessSpider/dvsportal/issues))
Eerst voorgekomen: 16:36:55 (1 gebeurtenissen)
Laatst gelogd: 16:36:55

Error in async step user
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1203, in _create_direct_connection
    hosts = await self._resolve_host(host, port, traces=traces)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 880, in _resolve_host
    return await asyncio.shield(resolved_host_task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 917, in _resolve_host_with_throttle
    addrs = await self._resolver.resolve(host, port, family=self._family)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/resolver.py", line 33, in resolve
    infos = await self._loop.getaddrinfo(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 901, in getaddrinfo
    return await self.run_in_executor(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/socket.py", line 964, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -5] Name has no usable address

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/dvsportal/dvsportal.py", line 111, in _request
    response = await self._session.request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 581, in _request
    conn = await self._connector.connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 544, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 944, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1209, in _create_direct_connection
    raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host https:443 ssl:default [Name has no usable address]

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/dvsportal/config_flow.py", line 58, in async_step_user
    info = await validate_input(self.hass, user_input, self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dvsportal/config_flow.py", line 38, in validate_input
    await dvs_portal.token()
  File "/usr/local/lib/python3.12/site-packages/dvsportal/dvsportal.py", line 152, in token
    await self.fetch_default_type_id()
  File "/usr/local/lib/python3.12/site-packages/dvsportal/dvsportal.py", line 142, in fetch_default_type_id
    response = await self._request("login", method="GET")  # Adjust if the URI is different for the GET request.
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/dvsportal/dvsportal.py", line 119, in _request
    raise DVSPortalConnectionError(
dvsportal.exceptions.DVSPortalConnectionError: Error occurred while communicating with DVSPortal.

@ChessSpider
Copy link
Owner

Can you double check you're entering parkeerloket.zwolle.nl as hostname, and not e.g. https://parkeerloket.zwolle.nl or a different value ?

@2Wanderer
Copy link
Author

I did, and double checked it again. But it made no difference, still the 'unknow error' popsup.

The log output:

Deze fout is ontstaan door een aangepaste integratie.

Logger: root
Bron: custom_components/dvsportal/config_flow.py:58
integratie: dvsportal (documentatie, problemen)
Eerst voorgekomen: 12 juli 2024 om 16:36:55 (4 gebeurtenissen)
Laatst gelogd: 10:10:21

Error in async step user
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1203, in _create_direct_connection
hosts = await self._resolve_host(host, port, traces=traces)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 880, in _resolve_host
return await asyncio.shield(resolved_host_task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 917, in _resolve_host_with_throttle
addrs = await self._resolver.resolve(host, port, family=self._family)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/resolver.py", line 33, in resolve
infos = await self._loop.getaddrinfo(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 901, in getaddrinfo
return await self.run_in_executor(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/socket.py", line 964, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -5] Name has no usable address

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/dvsportal/dvsportal.py", line 111, in _request
response = await self._session.request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 581, in _request
conn = await self._connector.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 544, in connect
proto = await self._create_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 944, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1209, in _create_direct_connection
raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host https:443 ssl:default [Name has no usable address]

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/config/custom_components/dvsportal/config_flow.py", line 58, in async_step_user
info = await validate_input(self.hass, user_input, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/dvsportal/config_flow.py", line 38, in validate_input
await dvs_portal.token()
File "/usr/local/lib/python3.12/site-packages/dvsportal/dvsportal.py", line 152, in token
await self.fetch_default_type_id()
File "/usr/local/lib/python3.12/site-packages/dvsportal/dvsportal.py", line 142, in fetch_default_type_id
response = await self._request("login", method="GET") # Adjust if the URI is different for the GET request.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/dvsportal/dvsportal.py", line 119, in _request
raise DVSPortalConnectionError(
dvsportal.exceptions.DVSPortalConnectionError: Error occurred while communicating with DVSPortal.

@2Wanderer
Copy link
Author

I tried again today, and all of a sudden it reconnected and is working like expected again. It must have been something on the server side. Thank for your support anyway!

@ChessSpider
Copy link
Owner

ChessSpider commented Aug 5, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants