thingsboard icon indicating copy to clipboard operation
thingsboard copied to clipboard

[Bug] Send email node sends duplicate emails

Open OzyOzk opened this issue 3 years ago • 4 comments

Describe the bug The send email node in the rule chain sends the same email twice. Issue is inconsistent and occurs in roughly 1 in 2 emails.

Your Server Environment

  • own setup
    • AWS EC2
    • 3.3.4.1PE-1
    • AWS Linux

Your Client Environment

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser FireFox
  • Version 104.0.1

To Reproduce Steps to reproduce the behavior:

I'm unable to reproduce this behavior. When I use virtual devices to trigger alarms, the emails are never duplicated.

Expected behavior Rule-chain should only be sending one email per alarm.

Screenshots rulechain error explain your problem.

Context

This rule-chain is designed to only raise an alarm if the co2 value has been above a threshold for at least 15 minutes.

OzyOzk avatar Sep 05 '22 13:09 OzyOzk

I would recommend to enable debug modus in switch node and create alarm node to check whether the device sends data twice.

Backdraft007 avatar Sep 06 '22 10:09 Backdraft007

I would recommend to enable debug modus in switch node and create alarm node to check whether the device sends data twice.

I already checked if we're getting duplicate messages. The issue seems to be caused by the label going from the create alarm node to the script node. I had these labels as "created/updated". I changed them to "created" only and now I'm not getting duplicate emails, though I can't say for certain that this was the cause.

OzyOzk avatar Sep 07 '22 11:09 OzyOzk

I think it is the cause. I cannot test it in the moment.

Backdraft007 avatar Sep 07 '22 14:09 Backdraft007

I think it is the cause. I cannot test it in the moment.

This was not the cause unfortunately. I'm still occasionally getting double emails. I turned on debug and saw that there were two identical messages going into the send email node. Perhaps this is caused by the save initial alarm time node on the bottom left. I've since moved that so it comes after the create alarm node. Hopefully this solves it.

OzyOzk avatar Sep 13 '22 15:09 OzyOzk

I know this is an old issue, but I think I've found myself in the same situation but without emails, just duplicate messages. Keep in mind this happened only once until now, but I can't explain this behaviour. I'll only describe the part where I've found this issue because the rest is kinda irrelevant, but if you need it I will provide. immagine One particular message arrived at the switch block, its content is also irrelevant. immagine One in, one out. So far everything is behaving normally. But something weird happens when the message is "duplicated" to the 2 script blocks. immagine immagine This is where the anomaly happens, both nodes received 2 identical messages (even the message id is the same for each couple!), not just 1, effectively quadrupling the original message. I have not been able to reproduce this behaviour, it seems to happen randomly. The reason I have reported it here is because the structure of the rule chain is strikingly similar, as in having a node which duplicates messages.

The version of Thingsboard (with Cassandra) used is 3.6.1, installed on an Ubuntu machine with Docker.

SimoneG97 avatar Jan 18 '24 14:01 SimoneG97