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
68.81k stars 28.12k forks source link

PrusaLink fills up the log when the printer is turned off #116218

Open terba opened 1 week ago

terba commented 1 week ago

The problem

The PrusaLink logs an error every minute when the printer is off (unreachable over the network). This creates around 70000 log lines per day, fills up the disk fast and makes the log unreadable.

What version of Home Assistant Core has the issue?

core-2024.4.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Core

Integration causing the issue

PrusaLink

Link to integration documentation on our website

https://www.home-assistant.io/integrations/prusalink/

Diagnostics information

The repeating log entry:

2024-04-26 04:02:19.913 ERROR (MainThread) [homeassistant.components.prusalink] Unexpected error fetching prusalink data: All connection attempts failed
Traceback (most recent call last):
File "/opt/ha/lib/python3.12/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions
yield
File "/opt/ha/lib/python3.12/site-packages/httpx/_transports/default.py", line 373, in handle_async_request
resp = await self._pool.handle_async_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/ha/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 216, in handle_async_request
raise exc from None
File "/opt/ha/lib/python3.12/site-packages/httpcore/_async/connection_pool.py", line 196, in handle_async_request
response = await connection.handle_async_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/ha/lib/python3.12/site-packages/httpcore/_async/connection.py", line 99, in handle_async_request
raise exc
File "/opt/ha/lib/python3.12/site-packages/httpcore/_async/connection.py", line 76, in handle_async_request
stream = await self._connect(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/ha/lib/python3.12/site-packages/httpcore/_async/connection.py", line 122, in _connect
stream = await self._network_backend.connect_tcp(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/ha/lib/python3.12/site-packages/httpcore/_backends/auto.py", line 30, in connect_tcp
return await self._backend.connect_tcp(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/ha/lib/python3.12/site-packages/httpcore/_backends/anyio.py", line 112, in connect_tcp
with map_exceptions(exc_map):
File "/opt/python/lib/python3.12/contextlib.py", line 158, in __exit__
self.gen.throw(value)
File "/opt/ha/lib/python3.12/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ConnectError: All connection attempts failed
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/ha/lib/python3.12/site-packages/homeassistant/helpers/update_coordinator.py", line 315, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/ha/lib/python3.12/site-packages/homeassistant/components/prusalink/__init__.py", line 153, in _async_update_data
data = await self._fetch_data()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/ha/lib/python3.12/site-packages/homeassistant/components/prusalink/__init__.py", line 193, in _fetch_data
return await self.api.get_legacy_printer()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/ha/lib/python3.12/site-packages/pyprusalink/__init__.py", line 48, in get_legacy_printer
async with self.client.request("GET", "/api/printer") as response:
File "/opt/python/lib/python3.12/contextlib.py", line 210, in __aenter__
return await anext(self.gen)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/ha/lib/python3.12/site-packages/pyprusalink/client.py", line 69, in request
response = await self._async_client.request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/ha/lib/python3.12/site-packages/httpx/_client.py", line 1574, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/ha/lib/python3.12/site-packages/httpx/_client.py", line 1661, in send
response = await self._send_handling_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/ha/lib/python3.12/site-packages/httpx/_client.py", line 1689, in _send_handling_auth
response = await self._send_handling_redirects(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/ha/lib/python3.12/site-packages/httpx/_client.py", line 1726, in _send_handling_redirects
response = await self._send_single_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/ha/lib/python3.12/site-packages/httpx/_client.py", line 1763, in _send_single_request
response = await transport.handle_async_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/ha/lib/python3.12/site-packages/httpx/_transports/default.py", line 372, in handle_async_request
with map_httpcore_exceptions():
File "/opt/python/lib/python3.12/contextlib.py", line 158, in __exit__
self.gen.throw(value)
File "/opt/ha/lib/python3.12/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: All connection attempts failed

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 1 week ago

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

Code owner commands Code owners of `prusalink` 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 prusalink` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


prusalink documentation prusalink source (message by IssueLinks)

bbrendon commented 1 day ago

@terba plz vote for your own issue :)

terba commented 1 day ago

I have to vote to solve an error? It's exactly like democracy :) Where do I have to vote? Link please!

bbrendon commented 1 day ago

Well, more votes means more visibility. Click the thumb above. You can see my one thumb in the screenshot.

image