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

Log is filling with errors #57

Open
misterymisery opened this issue May 2, 2020 · 26 comments · May be fixed by #65
Open

Log is filling with errors #57

misterymisery opened this issue May 2, 2020 · 26 comments · May be fixed by #65

Comments

@misterymisery
Copy link

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
Copy link
Owner

elad-bar commented May 6, 2020

Please check with latest, thanks

@misterymisery
Copy link
Author

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
Copy link
Owner

elad-bar commented May 6, 2020

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

Thanks

@elad-bar elad-bar reopened this May 6, 2020
@misterymisery
Copy link
Author

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
Copy link
Author

It happened when changed to debug

@misterymisery
Copy link
Author

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
Copy link
Owner

elad-bar commented May 8, 2020

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

@elad-bar
Copy link
Owner

elad-bar commented May 9, 2020

any updates?

@ironslow
Copy link

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
Copy link

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) [custom_components.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
Copy link
Owner

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

thanks

@rbiasiutti
Copy link

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/set_level, line: 32
_**

@elad-bar
Copy link
Owner

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

@rbiasiutti
Copy link

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
Copy link
Owner

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
Copy link

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) [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

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/set_level

I hope these informations, helps you to resolve the issue

@elad-bar
Copy link
Owner

can you please debug level in configuration.yaml?

@elad-bar
Copy link
Owner

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

thanks

@rbiasiutti
Copy link

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
Copy link

tagno25 commented May 31, 2020

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
Copy link

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

tagno25 added a commit to tagno25/ha-hpprinter that referenced this issue Aug 18, 2020
@tagno25 tagno25 linked a pull request Aug 18, 2020 that will close this issue
@rt400
Copy link

rt400 commented Sep 23, 2020

@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
Copy link
Owner

@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
Copy link

@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
Copy link

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
Copy link

Krocko commented Feb 10, 2024

Same for me.

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

Successfully merging a pull request may close this issue.

8 participants