core: IPP component can't handle an offline printer

The problem

IPP is able to discover a local printer and setup everything correctly.

Unfortunately if the printer becomes offline, IPP will just fill your logs.

Worst, when restarting HA and the printer is offline, it will just delay the all process.

Environment

  • Home Assistant Core release with the issue: 0.110.4
  • Last working Home Assistant Core release (if known): None
  • Operating environment (Home Assistant/Supervised/Docker/venv): venv
  • Integration causing this issue: ipp
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/ipp/

Problem-relevant configuration.yaml


setup using config flow after auto-discovery

Traceback/Error logs

2020-05-31 15:40:11 ERROR (MainThread) [homeassistant.components.ipp] Error fetching ipp data: Invalid response from API: Error occurred while communicating with IPP server.
2020-05-31 15:40:11 WARNING (MainThread) [homeassistant.config_entries] Config entry for ipp not ready yet. Retrying in 20 seconds.

Additional information

The expected behaviour would be for when printer is off the IPP entities would become disabled. That, until autodiscovery finds the printer again (when turned on)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 5
  • Comments: 18 (7 by maintainers)

Most upvoted comments

For me it would be enough not to spam the log file…

Same issue here. The “normal” situation should be “printer turned off” (i.e. not wasting energy). Most printers nowadays sent an announcement when they are turned on; why not use that to trigger configuration and/or availability?

@hogend that looks like a different issue, do you use CUPS or such to share printerfrom another device? Those 1030 errors mean not found whjch means it connects but something is configured wrong (from the searches ive done on such error code).

If you would open an issue about error code 1030 not being handled. We could likely abort entirely in such cases.

You are right about the error code 1030 coming from CUPS. I will create an issue for that.

With 0.118.0 it has become even worse:

2020-11-18 21:55:54 ERROR (MainThread) [homeassistant.components.ipp] Error fetching ipp data: Invalid response from API: ('Unexpected printer status code', {'status-code': 1030}) 2020-11-18 21:55:54 WARNING (MainThread) [homeassistant.config_entries] Config entry for ipp not ready yet. Retrying in 80 seconds 2020-11-18 21:55:54 ERROR (MainThread) [homeassistant.components.ipp] Error fetching ipp data: Invalid response from API: ('Unexpected printer status code', {'status-code': 1030}) 2020-11-18 21:55:54 WARNING (MainThread) [homeassistant.config_entries] Config entry for ipp not ready yet. Retrying in 80 seconds 2020-11-18 21:55:54 ERROR (MainThread) [homeassistant.components.ipp] Error fetching ipp data: Invalid response from API: ('Unexpected printer status code', {'status-code': 1030}) 2020-11-18 21:55:54 WARNING (MainThread) [homeassistant.config_entries] Config entry for ipp not ready yet. Retrying in 80 seconds 2020-11-18 21:56:09 ERROR (MainThread) [homeassistant.components.ipp] Error fetching ipp data: Invalid response from API: Error occurred while communicating with IPP server. 2020-11-18 21:56:09 WARNING (MainThread) [homeassistant.config_entries] Config entry for ipp not ready yet. Retrying in 80 seconds 2020-11-18 21:56:09 ERROR (MainThread) [homeassistant.components.ipp] Error fetching ipp data: Invalid response from API: Error occurred while communicating with IPP server. 2020-11-18 21:56:09 WARNING (MainThread) [homeassistant.config_entries] Config entry for ipp not ready yet. Retrying in 80 seconds

More than 8500 log entries in the last 1.5 days

For the record, this still happens in Home Assistant 0.118.0.

Still happens on 0.116.2

The printer isn’t even always offline when it occurs. Both HA and printer are connected via cable.

It sounds like 2 issues here. One is when we restart ha with ConfigNotReady I see this with wled too. Ideally it should print one error and retry in the background without flooding the logs. The second issue sounds like when the printer becomes unavailable it should only print 1 error and not print anymore while it’s in that state. I think filling up the logs is a checkpoint for the quality scale isn’t it?