-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
MaxListenersExceededWarning #9822
Comments
How many devices do you have on your network? |
119 |
How maybe of those are routers vs end devices? |
34 end devices |
I'm at 44 end, 37 routers I wonder where the cut off is. |
Is there some more debug logging around this? I currently cannot find where the amount of listeners increases with the amount of devices? (amount of listeners should be the same on a network with just 1 device) |
It happens very soon after startup basically �[32mZigbee2MQTT:info �[39m 2021-11-24 14:51:01: Connected to MQTT server is then followed by many, many Received MQTT message. Probably "retained" topics present in the MQTT broker, like this: �[34mZigbee2MQTT:debug�[39m 2021-11-24 14:51:05: Received MQTT message on 'zigbee2mqtt/Galerie1' with data '{"brightness":100,"color_mode":"color_temp","color_temp":400,"last_seen":1637761781656,"linkquality":51,"state":"OFF","update":{"state":"idle"},"update_available":false}' Then follows the MaxListenersExceededWarning. I'll attach an excerpt from the log, maybe you see more. |
Could you check if the issue is fixed now? Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html) |
Unfortunately, no.: I did some more testing, and the message does even appear, if I disable availability check, so it seems to be unrelated to availability. I used 1.22.0-dev commit: 51321af, which should include the change. |
Is it fixed when adding: advanced:
legacy_api: false to your |
No, legacy_api is already set to false. Here are my advanced settings (without network key / pan id), maybe this is helpful: advanced:
homeassistant_legacy_entity_attributes: false
homeassistant_legacy_triggers: false
legacy_api: false
last_seen: epoch
ikea_ota_use_test_url: false
channel: 25
cache_state: true
cache_state_persistent: true
cache_state_send_on_startup: true
log_level: debug
log_directory: data/log/%TIMESTAMP%
log_file: log.txt
log_rotation: true
log_output:
- console
- file
log_symlink_current: true
rtscts: false
log_syslog:
app_name: Zigbee2MQTT
eol: /n
host: localhost
localhost: localhost
path: /dev/log
pid: process.pid
port: 123
protocol: tcp4
type: '5424'
adapter_delay: 0 |
I have same warning message at every zigbee2mqtt restart: npm[20594]: (node:20594) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 1001 drain listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit 111 device availability check: disabled |
@okastl could you share me your data/database.db and configuration.yaml so that I can reproduce the issue locally? |
Sure. What are the security risks, if I remove network key, pan_id and ext_pan_id and post it here? |
You can randomise the networkkey, and panids. |
Done. I hope, it helps. |
For some reason I do not get the error, found this post https://stackoverflow.com/a/55983212 which should help us to determine which event listener throws this error. Could you add |
I believe this is, what you want:
|
Should be fixed now, can you confirm? Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html) |
I'll test tonight, once the family is asleep |
Unfortunately not. Using 1.22.0-dev commit: 290a031:
|
It seems zigbee2mqtt trying to publish all device state too frequently as here: I always receive this WARNING message after all device state publishing when I restart it. |
Did another attempt based on mqttjs/MQTT.js#589 , can you check if it works? Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html) |
Thanks for the fix. It is working for me no warning message... |
Works fine, thank you! |
What happened
If availability check is enabled with a lot of devices, the following warning appears in the log:
(node:23992) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 1001 drain listeners added to [Socket]. Use emitter.setMaxListeners() to increase limit
I am not sure, if this really is a problem, but it sounds scary.
What did you expect to happen
No warning.
How to reproduce it (minimal and precise)
This might be difficult. You need a zigbee network with a lot of devices. Enable availability check. Mine was set to "object" 15/1500 minutes.
Debug info
Zigbee2MQTT version: 1.22.0-dev commit: 3bfc7f3
Adapter hardware: CC26X2R1 (slaesh)
Adapter firmware version: 20210708
The text was updated successfully, but these errors were encountered: