Troubleshooting AWS IoT Events - AWS IoT Events

Troubleshooting AWS IoT Events

This section provides troubleshooting information and possible solutions to help resolve issues with AWS IoT Events.

I get errors when I attempt to create a detector model.

Solution: When you create a detector model, make sure that you consider the following limitations.

  • Only one action is allowed in each action field.

  • The condition is required for transitionEvents. It's optional for OnEnter, OnInput, and OnExit events.

  • If the condition field is empty, the evaluated result of the condition expression is equivalent to true.

  • The evaluated result of the condition expression should be a Boolean value. If the result isn't a Boolean value, it's equivalent to false and doesn't trigger the actions or transition to the nextState specified in the event.

For more information, see Detector Model Restrictions and Limitations.

I get state updates from the old detector model through MQTT messages or SNS alerts after I deleted or updated a detector model a few minutes ago.

Solution:If you update, delete, or recreate a detector model (see UpdateDetectorModel), there is some delay before all spawned detectors (instances) are deleted and the new model is used to recreate the detectors. They are recreated after the new detector model takes effect and new inputs arrive. During this time, inputs might continue to be processed by the detectors spawned by the previous version of the detector model. During this period, you might continue to receive alerts defined by the previous detector model. Wait for at least seven minutes before you recheck the update or report an error.

The detector fails to trigger an action or transition to a new state when the condition is met.

Solution:Verify that the evaluated result of the condition expression is a Boolean value. If the result isn't a Boolean value, it's equivalent to false and doesn't trigger the action or transition to the nextState specified in the event. For more information, see Conditional Expression Syntax.

Detectors don't trigger an action or a transition event when the variable reaches the specified value.

Solution:If you update setVariable for onInput, onEnter, or onExit, the new value isn't used when evaluating any condition during the current processing cycle. Instead, the original value is used until the current cycle is complete. You can change this behavior by setting the evaluationMethod parameter in the detector model definition. When evaluationMethod is set to SERIAL, variables are updated and event conditions evaluated in the order that the events are defined. When evaluationMethod is set to BATCH (the default), variables are updated and events performed only after all event conditions are evaluated.

The detector enters the wrong states when I attempt to send messages to inputs by using BatchPutMessage.

Solution: If you use BatchPutMessage to send multiple messages to inputs, the order in which the messages or inputs are processed isn't guqranteed. To guaranteer ordering, send messages one at time and wait each time for BatchPutMessage to acknowledge success.

I get a ('Connection aborted.', error(54, 'Connection reset by peer')) error when I attempt to call or invoke an API.

Solution: Verify that OpenSSL uses TLS 1.1 or a later version to establish the connection. This should be the default under most Linux distributions or Windows version 7 and later. Users of macOS might need to upgrade OpenSSL.

I get InvalidRequestException when I attempt to call CreateDetectorModel and UpdateDetectorModel APIs.

Solution: Check the following to help resolve the issue. For more information, see CreateDetectorModel and UpdateDetectorModel.

  • Make sure that you don't use both seconds and durationExpression as the parameters of SetTimerAction at the same time.

  • Make sure that your string expression for durationExpression is valid. The string expression can contain numbers, variables ($variable.<variable-name>), or input values ($input.<input-name>.<path-to-datum>).

Amazon CloudWatch logs contain error messages, when I use action.setTimer.

You can set up Amazon CloudWatch Logs to monitor AWS IoT Events detector models. The following are common errors generated by AWS IoT Events, when you set the timer. For more information, see Enable Amazon CloudWatch Logging when Developing AWS IoT Events Detector Models.

  • Error: Your duration expression for the timer named <timer-name> could not be evaluated to a number.

    Solution: Make sure that your string expression for durationExpression can be converted to a number. Other data types, such as Boolean, are not allowed.

  • Error: The evaluated result of your duration expression for the timer named <timer-name> is greater than 31622440. To ensure accuracy, make sure that your duration expression refers to a value between 60-31622400.

    Solution: Make sure that the duration of your timer is less than or equal to 31622400 seconds. The evaluated result of the duration is rounded down to the nearest whole number.

  • Error: The evaluated result of your duration expression for the timer named <timer-name> is less than 60. To ensure accuracy, make sure that your duration expression refers to a value between 60-31622400.

    Solution: Make sure that the duration of your timer is greater than or equal to 60 seconds. The evaluated result of the duration is rounded down to the nearest whole number.

  • Error: Your duration expression for the timer named <timer-name> could not be evaluated. Check the variable names, input names, and paths to the data to make sure that you refer to the existing variables and inputs.

    Solution: Make sure that your string expression refers to the existing variables and inputs. The string expression can contain numbers, variables ($variable.<variable-name>), and input values ($input.<input-name>.<path-to-datum>).

  • Error: Failed to set the timer named <timer-name>. Check your duration expression, and try again.

    Solution: Check the description of SetTimerAction for a detailed guideline, and then set the timer again.