elad-bar / ha-hpprinter

HP Printer Integration
93 stars 27 forks source link

Log is filling with errors #57

Closed misterymisery closed 5 months ago

misterymisery commented 4 years ago

Log Details (ERROR) Logger: custom_components.hpprinter.managers.HPDeviceData Source: custom_components/hpprinter/managers/HPDeviceData.py:82 Integration: HP Printer (documentation) First occurred: 11:18:09 PM (7 occurrences) Last logged: 11:18:09 PM

Failed to set printer consumable usage data (HP MFP M225dw @ IP xxx.xxx.xxx.xxx), Error: 'str' object has no attribute 'get', Line: 279

elad-bar commented 4 years ago

Please check with latest, thanks

misterymisery commented 4 years ago

Unfortunately the same error. Log Details (ERROR) Logger: custom_components.hpprinter.managers.HPDeviceData Source: custom_components/hpprinter/managers/HPDeviceData.py:82 Integration: HP Printer (documentation) First occurred: 5:17:25 PM (714 occurrences) Last logged: 6:59:59 PM

Failed to set printer consumable usage data (HP MFP M225dw @xxx.Xxx.Xxx.Xxx), Error: 'str' object has no attribute 'get', Line: 279

elad-bar commented 4 years ago

Please provide debug files so I'll be able to reproduce (instructions are in the readme)

Thanks

misterymisery commented 4 years ago

Log Details (ERROR) Logger: homeassistant.core Source: core.py:1206 First occurred: 11:18:36 PM (2 occurrences) Last logged: 11:18:47 PM

Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/config/custom_components/hpprinter/init.py", line 66, in async_options_updated await handle_log_level(hass, entry) File "/config/custom_components/hpprinter/helpers/init.py", line 52, in handle_log_level await hass.services.async_call(DOMAIN_LOGGER, SERVICE_SET_LEVEL, log_level_data) File "/usr/src/homeassistant/homeassistant/core.py", line 1206, in async_call raise ServiceNotFound(domain, service) from None homeassistant.exceptions.ServiceNotFound: Unable to find service logger/set_level

misterymisery commented 4 years ago

It happened when changed to debug

misterymisery commented 4 years ago

Log Details (ERROR) Logger: custom_components.hpprinter Source: custom_components/hpprinter/init.py:46 Integration: HP Printer (documentation) First occurred: 12:49:33 PM (1 occurrences) Last logged: 12:49:33 PM

Failed to load BlueIris, error: Unable to find service logger/set_level, line: 32

elad-bar commented 4 years ago

Can you do that manually? Seems like logger component is not running Which version og HA are you using?

elad-bar commented 4 years ago

any updates?

ironslow commented 4 years ago

Hi, I have the same error. Here are the debug logs associated with the error. The component is issuing those errors each minute.

2020-05-11 12:40:25 DEBUG (MainThread) [custom_components.hpprinter.managers.home_assistant] Updating @2020-05-11 12:40:25.009881+00:00 2020-05-11 12:40:25 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Updating ProductUsageDyn from xxx.xxx.xxx.xxx 2020-05-11 12:40:25 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Retrieving ProductUsageDyn from xxx.xxx.xxx.xxx 2020-05-11 12:40:25 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Updating ConsumableConfigDyn from xxx.xxx.xxx.xxx 2020-05-11 12:40:25 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Retrieving ConsumableConfigDyn from xxx.xxx.xxx.xxx 2020-05-11 12:40:25 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Updating ProductConfigDyn from xxx.xxx.xxx.xxx 2020-05-11 12:40:25 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Retrieving ProductConfigDyn from xxx.xxx.xxx.xxx 2020-05-11 12:40:25 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Updating ProductStatusDyn from xxx.xxx.xxx.xxx 2020-05-11 12:40:25 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Retrieving ProductStatusDyn from xxx.xxx.xxx.xxx 2020-05-11 12:40:25 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP LaserJet Pro M201dw @xxx.xxx.xxx.xxx), Error: 'str' object has no attribute 'get', Line: 279 2020-05-11 12:40:25 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP LaserJet Pro M201dw @xxx.xxx.xxx.xxx), Error: 'str' object has no attribute 'get', Line: 279 2020-05-11 12:40:25 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP LaserJet Pro M201dw @xxx.xxx.xxx.xxx), Error: 'str' object has no attribute 'get', Line: 279 2020-05-11 12:40:25 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP LaserJet Pro M201dw @xxx.xxx.xxx.xxx), Error: 'str' object has no attribute 'get', Line: 279 2020-05-11 12:40:25 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP LaserJet Pro M201dw @xxx.xxx.xxx.xxx), Error: 'str' object has no attribute 'get', Line: 279 2020-05-11 12:40:25 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP LaserJet Pro M201dw @xxx.xxx.xxx.xxx), Error: 'str' object has no attribute 'get', Line: 279 2020-05-11 12:40:25 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP LaserJet Pro M201dw @xxx.xxx.xxx.xxx), Error: 'str' object has no attribute 'get', Line: 279 2020-05-11 12:40:25 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP LaserJet Pro M201dw @xxx.xxx.xxx.xxx), Error: 'str' object has no attribute 'get', Line: 279

rbiasiutti commented 4 years ago

Hi, I have the same error too. The error occurring in a fresh installation of HassOS 3.13 with Home Assistant version 0.109.6

I connected an HP Laserjet Pro MFP M125nw and in the device card I found this entities:

_HP Printer Connectivity : Connesso HP Printer Printer :1956 Pages HP Printer Scanner : 883 Pages HP Printer Status : Idle HP Printer Tonercartridge Black : 0 % sensor.hp_printer_n_a_n_a_

but the log file is full of messages like this:

_2020-05-17 16:16:38 ERROR (MainThread) [customcomponents.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP Printer @192.168.xxx.xxx), Error: 'str' object has no attribute 'get', Line: 279

which are repeating 5 times every 60 seconds.

elad-bar commented 4 years ago

Please check the latest, if it happens, please post logs at debug level to better understand the issue

thanks

rbiasiutti commented 4 years ago

Well... I've installed again the integration from HACS repository; I've overwritten all files with the version downloaded from github (latest version); I've set the Log Level to DEBUG and restarted Home Assistant; this is the error which appears in the log file:

**_2020-05-17 20:01:58 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for shelly which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.

2020-05-17 20:02:10 ERROR (MainThread) [custom_components.hpprinter] Failed to load HP Printer, error: Unable to find service logger/setlevel, line: 32 **

elad-bar commented 4 years ago

please add it to the configuration YAML, didn't you use the HACS for the installation?

rbiasiutti commented 4 years ago

I've installed the integration from the relative HACS menu; after that, I've overwritten the installed files with the files in your repository to be sure to have the latest version but the error is present even if I use the first files.

If you prefer, I remove all files and redownload the integration from HACS; I set again the Log level to DEBUG and will report the results.

the "Basic configuration steps" tell me of " In case you are already using that integration with YAML Configuration - please remove it " and I followed this indication... which instruction you want to insert in the configuration.yaml file?

elad-bar commented 4 years ago

Seems that you installed it correctly, defined it from Integrations and configuration YAML not contains hp_printer:, I'm just trying to understand how to reproduce

rbiasiutti commented 4 years ago

upgrade after today's new version I've installed the update and, after the restart of HA, into the log file the errors are still present (5 times every 60 seconds);

_2020-05-18 14:31:11 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP LJPro M125nw @192.168.xxx.xxx), Error: 'str' object has no attribute 'get', Line: 285 2020-05-18 14:31:12 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP LJPro M125nw @192.168.xxx.xxx), Error: 'str' object has no attribute 'get', Line: 285 2020-05-18 14:31:12 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP LJPro M125nw @192.168.xxx.xxx), Error: 'str' object has no attribute 'get', Line: 285 2020-05-18 14:31:12 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP LJPro M125nw @192.168.xxx.xxx), Error: 'str' object has no attribute 'get', Line: 285 2020-05-18 14:31:12 ERROR (MainThread) [customcomponents.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP LJPro M125nw @192.168.xxx.xxx), Error: 'str' object has no attribute 'get', Line: 285

When I set the log level in "Debug" mode, into the log file are added these lines:

_2020-05-18 14:33:19 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/config/custom_components/hpprinter/init.py", line 66, in async_options_updated await handle_log_level(hass, entry) File "/config/custom_components/hpprinter/helpers/init.py", line 53, in handle_log_level await hass.services.async_call(DOMAIN_LOGGER, SERVICE_SET_LEVEL, log_level_data) File "/usr/src/homeassistant/homeassistant/core.py", line 1206, in async_call raise ServiceNotFound(domain, service) from None homeassistant.exceptions.ServiceNotFound: Unable to find service logger/setlevel

I hope these informations, helps you to resolve the issue

elad-bar commented 4 years ago

can you please debug level in configuration.yaml?

elad-bar commented 4 years ago

@rbiasiutti , did you try to set it manually from the configuration.yaml to provide debug level logs? I cannot assist without that.

thanks

rbiasiutti commented 4 years ago

no, I'm not have set. Exactly, which instruction lines I must insert in the configuration.yaml for activating the Debug Logs you want?

tagno25 commented 4 years ago

I set debug for both custom_components.hpprinter and custom_components.hpprinter.managers.HPDeviceData

It seems like the error is caused by trying to determine how many color pages have been printed on a black and white printer.

2020-05-31 15:11:39 INFO (MainThread) [custom_components.hpprinter.managers.home_assistant] Finalizing initialization of integration (192.168.0.21) at 2020-05-31 20:11:39.000985+00:00 2020-05-31 15:11:39 INFO (MainThread) [custom_components.hpprinter.managers.home_assistant] Handling ConfigEntry initialization: {'entry_id': 'f0463ad98afe41f8926841ccb8ae8111', 'version': 1, 'domain': 'hpprinter', 'title': 'HP Laserjet M1536dnf', 'data': {'host': '192.168.0.21', 'name': 'HP Laserjet M1536dnf'}, 'options': {}, 'system_options': {'disable_new_entities': False}, 'source': 'user', 'connection_class': 'local_poll', 'unique_id': None} 2020-05-31 15:11:39 DEBUG (MainThread) [custom_components.hpprinter.managers.home_assistant] Updating @ 2020-05-31 15:11:39.023994 2020-05-31 15:11:39 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Updating ProductUsageDyn from 192.168.0.21 2020-05-31 15:11:39 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Retrieving ProductUsageDyn from 192.168.0.21 2020-05-31 15:11:39 DEBUG (MainThread) [custom_components.hpprinter.models.base_entity] Starting async_setup_entry binary_sensor 2020-05-31 15:11:39 DEBUG (MainThread) [custom_components.hpprinter.models.base_entity] Starting async_setup_entry sensor 2020-05-31 15:11:39 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Updating ConsumableConfigDyn from 192.168.0.21 2020-05-31 15:11:39 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Retrieving ConsumableConfigDyn from 192.168.0.21 2020-05-31 15:11:39 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Updating ProductConfigDyn from 192.168.0.21 2020-05-31 15:11:39 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Retrieving ProductConfigDyn from 192.168.0.21 2020-05-31 15:11:39 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Updating ProductStatusDyn from 192.168.0.21 2020-05-31 15:11:39 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Retrieving ProductStatusDyn from 192.168.0.21 2020-05-31 15:11:39 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP Laserjet M1536dnf @192.168.0.21), Error: 'str' object has no attribute 'get', Line: 285 2020-05-31 15:11:39 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP Laserjet M1536dnf @192.168.0.21), Error: 'str' object has no attribute 'get', Line: 285 2020-05-31 15:11:39 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP Laserjet M1536dnf @192.168.0.21), Error: 'str' object has no attribute 'get', Line: 285 2020-05-31 15:11:39 INFO (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Skipped setting using data for N/a N/A 2020-05-31 15:11:39 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP Laserjet M1536dnf @192.168.0.21), Error: 'str' object has no attribute 'get', Line: 285 2020-05-31 15:11:39 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP Laserjet M1536dnf @192.168.0.21), Error: 'str' object has no attribute 'get', Line: 285 2020-05-31 15:11:39 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP Laserjet M1536dnf @192.168.0.21), Error: 'str' object has no attribute 'get', Line: 285 2020-05-31 15:11:39 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP Laserjet M1536dnf @192.168.0.21), Error: 'str' object has no attribute 'get', Line: 285 2020-05-31 15:11:39 INFO (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Skipped setting using data for N/a N/A 2020-05-31 15:11:39 INFO (MainThread) [custom_components.hpprinter.managers.entity_manager] Entity HP Laserjet M1536dnf Connectivity restored | binary_sensor.hp_laserjet_m1536dnf_connectivity 2020-05-31 15:11:39 INFO (MainThread) [custom_components.hpprinter.managers.entity_manager] Entity HP Laserjet M1536dnf Status restored | sensor.hp_laserjet_m1536dnf_status_2 2020-05-31 15:11:39 INFO (MainThread) [custom_components.hpprinter.managers.entity_manager] Entity HP Laserjet M1536dnf Printer restored | sensor.hp_laserjet_m1536dnf_printer 2020-05-31 15:11:39 INFO (MainThread) [custom_components.hpprinter.managers.entity_manager] Entity HP Laserjet M1536dnf Scanner restored | sensor.hp_laserjet_m1536dnf_scanner 2020-05-31 15:11:39 INFO (MainThread) [custom_components.hpprinter.managers.entity_manager] Entity HP Laserjet M1536dnf N/a N/A restored | sensor.hp_laserjet_m1536dnf_n_a_n_a 2020-05-31 15:11:39 INFO (MainThread) [custom_components.hpprinter.managers.entity_manager] Entity HP Laserjet M1536dnf Toner Black restored | sensor.hp_laserjet_m1536dnf_toner_black 2020-05-31 15:11:39 INFO (MainThread) [custom_components.hpprinter.binary_sensor] Added new HP Laserjet M1536dnf Connectivity 2020-05-31 15:11:39 INFO (MainThread) [custom_components.hpprinter.sensor] Added new HP Laserjet M1536dnf Status 2020-05-31 15:11:39 INFO (MainThread) [custom_components.hpprinter.sensor] Added new HP Laserjet M1536dnf Printer 2020-05-31 15:11:39 INFO (MainThread) [custom_components.hpprinter.sensor] Added new HP Laserjet M1536dnf Scanner 2020-05-31 15:11:39 INFO (MainThread) [custom_components.hpprinter.sensor] Added new HP Laserjet M1536dnf N/a N/A 2020-05-31 15:11:39 INFO (MainThread) [custom_components.hpprinter.sensor] Added new HP Laserjet M1536dnf Toner Black

ironslow commented 4 years ago

Just installed the most recent version (433ee93). The problem is still there. There are error logs at each 30 seconds. Here is an extract at debug level

2020-07-23 18:24:58 DEBUG (MainThread) [custom_components.hpprinter.managers.home_assistant] Updating @2020-07-23 18:24:58.009071+00:00 2020-07-23 18:24:58 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Updating ProductUsageDyn from 192.168.0.62 2020-07-23 18:24:58 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Retrieving ProductUsageDyn from 192.168.0.62 2020-07-23 18:24:58 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Updating ConsumableConfigDyn from 192.168.0.62 2020-07-23 18:24:58 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Retrieving ConsumableConfigDyn from 192.168.0.62 2020-07-23 18:24:58 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Updating ProductConfigDyn from 192.168.0.62 2020-07-23 18:24:58 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Retrieving ProductConfigDyn from 192.168.0.62 2020-07-23 18:24:58 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Updating ProductStatusDyn from 192.168.0.62 2020-07-23 18:24:58 DEBUG (MainThread) [custom_components.hpprinter.api.HPPrinterAPI] Retrieving ProductStatusDyn from 192.168.0.62 2020-07-23 18:24:58 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP Printer @192.168.0.62), Error: 'str' object has no attribute 'get', Line: 287 2020-07-23 18:24:58 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP Printer @192.168.0.62), Error: 'str' object has no attribute 'get', Line: 287 2020-07-23 18:24:58 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP Printer @192.168.0.62), Error: 'str' object has no attribute 'get', Line: 287 2020-07-23 18:24:58 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP Printer @192.168.0.62), Error: 'str' object has no attribute 'get', Line: 287 2020-07-23 18:24:58 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP Printer @192.168.0.62), Error: 'str' object has no attribute 'get', Line: 287 2020-07-23 18:24:58 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP Printer @192.168.0.62), Error: 'str' object has no attribute 'get', Line: 287 2020-07-23 18:24:58 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP Printer @192.168.0.62), Error: 'str' object has no attribute 'get', Line: 287 2020-07-23 18:24:58 INFO (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Skipped setting using data for N/a N/A

rt400 commented 4 years ago

@elad-bar i have the issue, alot of error in the log : `Logger: custom_components.hpprinter.managers.HPDeviceData Source: custom_components/hpprinter/managers/HPDeviceData.py:329 Integration: HP Printer (documentation) First occurred: 8:44:40 AM (2772 occurrences) Last logged: 3:19:40 PM

Failed to set printer consumable usage data (HP Printer @192.168.1.250), Error: 'str' object has no attribute 'get', Line: 287`

work with the last HA version 0.115.2

elad-bar commented 4 years ago

@rt400 please provide XML debug files - available in integration's options (Store responses) so I'll be able to reproduce it

thanks

johan-de-jong commented 3 years ago

@elad-bar I have the same HP LaserJet Pro MFP M125nw that generates error:

2021-05-07 12:07:01 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP LaserJet Pro MFP M125nw @laserjet.local), Error: 'str' object has no attribute 'get', Line: 287

Here are the requested .xml files: HP LaserJet Pro MFP M125nw.zip

johan-de-jong commented 10 months ago

The latest v1.0.12 release still produces the same high volume error messages on non-color devices:

2024-01-04 10:20:35.533 ERROR (MainThread) [custom_components.hpprinter.managers.HPDeviceData] Failed to set printer consumable usage data (HP LaserJet Pro MFP M125nw @laserjet.local), Error: 'str' object has no attribute 'get', Line: 287
Krocko commented 9 months ago

Same for me.

elad-bar commented 5 months ago

is it still relevant with v2?

thanks

johan-de-jong commented 5 months ago

This issue no longer seems relevant with the 2.x release.

I no longer have: "Failed to set printer consumable usage data (HP LaserJet Pro MFP M125nw @laserjet.local), Error: 'str' object has no attribute 'get', Line: 287" errors.

elad-bar commented 5 months ago

great thanks