home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.63k stars 29.93k forks source link

OpenSky Unavailable #104054

Closed milandzuris closed 5 months ago

milandzuris commented 10 months ago

The problem

Every few Hours this integration is Unavailable image

What version of Home Assistant Core has the issue?

2023.11.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

OpenSky

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 10 months ago

Hey there @joostlek, mind taking a look at this issue as it has been labeled with an integration (opensky) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `opensky` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign opensky` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


opensky documentation opensky source (message by IssueLinks)

joostlek commented 10 months ago

Anything in the logs?

milandzuris commented 10 months ago

Anything in the logs?

no

joostlek commented 10 months ago

Could you please turn on debug logging and check?

milandzuris commented 10 months ago

Could you please turn on debug logging and check?

home-assistant_opensky_2023-11-17T21-15-35.687Z.log

mindogo1 commented 10 months ago

having the same issue, it is now constantly unavailable

tieskuh commented 10 months ago

Yes, I have the same issue as well. But I think it is a problem at OpenSky.

2023-11-19 09:41:14.383 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/python_opensky/opensky.py", line 124, in _request
    response.raise_for_status()
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1005, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 502, message='Bad Gateway', url=URL('https://opensky-network.org:443/api/states/all?time=0&extended=true&lamin=0.0&lamax=0.0&lomin=1.0&lomax=1.0')

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 227, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 148, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 63, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 234, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 293, in async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 389, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/opensky/config_flow.py", line 120, in async_step_init
    await opensky.authenticate(
  File "/usr/local/lib/python3.11/site-packages/python_opensky/opensky.py", line 52, in authenticate
    await self.get_states(bounding_box=BoundingBox(0.0, 0.0, 1.0, 1.0))
  File "/usr/local/lib/python3.11/site-packages/python_opensky/opensky.py", line 169, in get_states
    data = await self._request("states/all", data=params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/python_opensky/opensky.py", line 136, in _request
    raise OpenSkyConnectionError(msg) from exception
python_opensky.exceptions.OpenSkyConnectionError: Error occurred while communicating with OpenSky API

This URL from the log: https://opensky-network.org/api/states/all?time=0&extended=true&lamin=0.0&lamax=0.0&lomin=1.0&lomax=1.0

Also gives a 502 when visiting with a browser

image

joostlek commented 10 months ago

I'll have a check with OpenSky

milandzuris commented 9 months ago

Sky is Dead @joostlek image

joostlek commented 9 months ago

https://twitter.com/OpenSkyNetwork/status/1731102369247576473

milandzuris commented 7 months ago

Something new? @joostlek image

joostlek commented 5 months ago

It seems to be working for me normally, the outage has been resolved so I will close this issue.

milandzuris commented 5 months ago

It seems to be working for me normally, the outage has been resolved so I will close this issue.

image better but

joostlek commented 5 months ago

Yes the API is still a little bit spotty, but nothing the HA code can do about with that except for doing retries, which makes it harder to keep under the usage limits. It's also not a service which is life depending and cause a major problem for people if it doesn't have a value for 15 minutes.