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

NZBGet integration excessive logs to homeassistant.core #33154

Open
alex3305 opened this issue Mar 22, 2020 · 4 comments
Open

NZBGet integration excessive logs to homeassistant.core #33154

alex3305 opened this issue Mar 22, 2020 · 4 comments

Comments

@alex3305
Copy link
Contributor

@alex3305 alex3305 commented Mar 22, 2020

The problem

I have configured the NZBGet integration to retrieve the current state of NZBGet. However, I have also configured to let my NZBGet server go to sleep when I'm not using it. In that state Home Assistant is unable to retrieve the state of NZBGet.

This isn't an issue for me, but the NZBGet integration is spamming the log with exceptions. Also these log messages seem (to me at least) in the wrong namespace.

Environment

  • Home Assistant release with the issue: 0.107.5
  • Last working Home Assistant release (if known): n/a
  • Operating environment (Hass.io/Docker/Windows/etc.): Docker
  • Integration causing this issue: nzbget
  • Link to integration documentation on our website: NZBGet

Problem-relevant configuration.yaml

nzbget:
  host: 192.168.1.10

logger:
  default: warning
  logs:
    homeassistant.components.nzbget: fatal
    pynzbgetapi: fatal

Traceback/Error logs

2020-03-22 16:57:11 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/nzbget/__init__.py", line 111, in refresh
    nzbget_data.update()
  File "/usr/src/homeassistant/homeassistant/components/nzbget/__init__.py", line 138, in update
    self.status = self._api.status()
  File "/usr/local/lib/python3.7/site-packages/pynzbgetapi/__init__.py", line 121, in status
    return self.__proxy_call(lambda: self.proxy.status())
  File "/usr/local/lib/python3.7/site-packages/pynzbgetapi/__init__.py", line 54, in __proxy_call
    return method_call()
  File "/usr/local/lib/python3.7/site-packages/pynzbgetapi/__init__.py", line 121, in <lambda>
    return self.__proxy_call(lambda: self.proxy.status())
  File "/usr/local/lib/python3.7/xmlrpc/client.py", line 1112, in __call__
    return self.__send(self.__name, args)
  File "/usr/local/lib/python3.7/xmlrpc/client.py", line 1452, in __request
    verbose=self.__verbose
  File "/usr/local/lib/python3.7/xmlrpc/client.py", line 1154, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/local/lib/python3.7/xmlrpc/client.py", line 1166, in single_request
    http_conn = self.send_request(host, handler, request_body, verbose)
  File "/usr/local/lib/python3.7/xmlrpc/client.py", line 1279, in send_request
    self.send_content(connection, request_body)
  File "/usr/local/lib/python3.7/xmlrpc/client.py", line 1309, in send_content
    connection.endheaders(request_body)
  File "/usr/local/lib/python3.7/http/client.py", line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.7/http/client.py", line 966, in send
    self.connect()
  File "/usr/local/lib/python3.7/http/client.py", line 938, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/local/lib/python3.7/socket.py", line 728, in create_connection
    raise err
  File "/usr/local/lib/python3.7/socket.py", line 716, in create_connection
    sock.connect(sa)
OSError: [Errno 113] Host is unreachable

Additional information

Adding this to the logging configuration is a workaround for this issue:

logger:
  default: warning
  logs:
    homeassistant.core: fatal

But obviously could also hide other, relevant logging.

Also in the Google Assistant integration http errors are indeed handled correctly, with the correct namespace. For instance:

2020-03-22 17:06:15 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.go
ogleapis.com/v1/devices:reportStateAndNotification failed: 400

So a definitive solution is possible.

@probot-home-assistant

This comment has been minimized.

Copy link

@probot-home-assistant probot-home-assistant bot commented Mar 22, 2020

Hey there @chriscla, mind taking a look at this issue as its been labeled with a integration (nzbget) you are listed as a codeowner for? Thanks!

@frenck

This comment has been minimized.

Copy link
Member

@frenck frenck commented Mar 22, 2020

Labelled/tagged this issue for nzbget.

The last bit of your report is about something else. Please don't combine separate things in a single issue. Create another issue instead.

@alex3305

This comment has been minimized.

Copy link
Contributor Author

@alex3305 alex3305 commented Mar 22, 2020

@frenck On first glance it maybe seems so. But I only provide an example of an integration where I know behaviour is correctly implemented.

@chriscla

This comment has been minimized.

Copy link
Contributor

@chriscla chriscla commented Mar 22, 2020

Thanks for reporting @alex3305 -- this is indeed an area that can be cleaned up. I'll try to work on this over the next couple weeks, it's likely not a big change but the COVID-19 situation is having an impact.

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.