Cumulocity IoT Tips and Tricks - How to fix 'Errors occurred while running event processing rules'

When you open the Cumulocity Administration application, you will see the above error message if there is something wrong with your event processing rules. Errors during event processing are raised as alarms in your Cumulocity account and are visible using the "Alarms" user interface. They can be also further processed just like any other alarms (e.g., to forward them via email).

If you want to get an overview on what goes wrong, here is a simple trick: 

  • Go to the Device Management application.
  • Click on the search icon at the top (the magnifying glass) and type "CEP Engine" into the prompt, including the quotes.
  • You should see a "virtual device" with the name "CEP Engine <your tenant ID>". Click on that device. 
  • Click on the "Alarms" tab.

 Typical alarms are:

  • "Real-time event processing is currently overloaded and may stop processing your events. Please contact support": In this case, you are using more than the available capacity for event processing and you need to subscribe to a larger CEP engine instance.
  • "Exception on tenant <tenant ID> in statement '<event process rule>:<statement>": There was an error processing the statement. Navigate to the Administration application, click on "Event processing" under "Business rules", then click on the event processing rule that is mentioned in the alarm. Search for the statement that causes the alarm and analyse it. If you did not give a name to the statement ("@Name("myStatement")"), statements are numbered from top to down.

Exceptions can refer to both runtime exception and programming errors. For example, you may see errors "Finding alarm from database failed" or "Source object does not exist in inventory". In this case, the rule was passing an ID for an alarm or a device that is not existing.

Note that you can also get information on the performance of your statements by clicking on the "Measurements" tab. This will, for example, help you in identifying the cause why a statement was disabled by the built-in resource monitoring.