thingsboard / thingsboard-edge

Apache License 2.0
93 stars 71 forks source link

[Question] Edge PE 3.5.1.1 can't push cloud events after encountering exception error #71

Closed akseerali closed 9 months ago

akseerali commented 11 months ago

Component

Rule Engine

Description I am using Transformation-Script Node at the edge and cloud rule chains. The issue is, there are exception issues at the edge and cloud resulting from a JavaScript code. Under the "Rule Engine Statistics" in "API Usage", the cloud is now showing "Script invocation is blocked due to maximum error count 3" error.

image

After this error, I have updated the edge and cloud rule chains and the "Downlinks" section under the edge instance is also showing "deployed" status; however, the rule chain at the edge is still same. Moreover, the edge is not pushing the telemetry data to the cloud. The status of cloud events at the edge is pending.

image

I have further tried to resolve this issue by restarting the edge container, but this has not worked so far.

Question/Discussion

Environment

volodymyr-babak commented 11 months ago

@akseerali,

Could you please attach the logs from your edge container to help us troubleshoot the issue? I'll be in a better position to answer your questions after reviewing the logs. I suspect there are two possible issues:

akseerali commented 9 months ago

Hi @volodymyr-babak

This issue appeared after the rule chain in the cloud threw a few exception errors during the execution of a JavaScript function on data originating from Edge. That is why it could not sync even after restarting the Edge container.

We used the most recent backup to clear this issue, and that is why we could not get old logs. The issue only appeared after fixing the rule chain.

Some observations: If a few exception errors result from data processing/transforming in the edge rule chain using JavaScript, it will throw exception errors in the API statistics. However, the Edge will continue to work. If the same error appears in the cloud, then there is a limit to exception errors, and the cloud will no longer synchronize with the edge instance to make any changes in devices, assets, dashboards, or rule chains.

Further testing can be done on this scenario to replicate and fix the issue in future.