Troubleshooting an AWS IoT SiteWise gateway - AWS IoT SiteWise

Troubleshooting an AWS IoT SiteWise gateway

AWS IoT SiteWise gateways run an AWS IoT Greengrass connector. You can configure your gateway to log connector events to CloudWatch and to your gateway's local file system. Then, you can view the log files associated with the connector to troubleshoot your gateway.

You can also view CloudWatch metrics reported by your gateways to troubleshoot issues with connectivity or data streams. For more information, see Gateway metrics.

Configuring and accessing AWS IoT SiteWise gateway logs

Before you can view gateway logs, you must configure your gateway to send logs to Amazon CloudWatch Logs or store logs on the local file system.

  • Use CloudWatch Logs if you want to use the AWS Management Console to view your gateway's log files. For more information, see Using Amazon CloudWatch Logs.

  • Use local file system logs if you want to use the command line or local software to view your gateway's log files. For more information, see Using local file system logs.

Troubleshooting gateway issues

Use the following information to troubleshoot gateway issues.

Modbus TCP sources are out of sync

Your Modbus TCP source might be out of sync if your source data type is ASCII, UTF8, or ISO8859 and you're running an old version of the Modbus-TCP Protocol Adapter connector. To upgrade the connector to the latest version, do the following:

  1. Sign in to the AWS IoT Greengrass V1 console.

  2. In the navigation pane, choose Groups.

  3. Under Greengrass groups, choose the target group.

  4. In the navigation pane, choose Connectors.

  5. In the Upgrade column, choose Available.

  6. On the Upgrade connector page, choose the latest version, and then choose Upgrade.

For more information, see Modbus-TCP Protocol Adapter connector in the AWS IoT Greengrass Version 1 Developer Guide.

Unable to connect to stream manager

You might see the following swPublisher error log message if stream manager isn't enabled on your gateway's AWS IoT Greengrass group.

com.amazonaws.greengrass.streammanager.client.StreamManagerClientImpl: Connect failed

As of version 6, the AWS IoT SiteWise connector requires stream manager. For more information about how to enable stream manager, see step 5 of Configuring an AWS IoT Greengrass group.

Unable to connect to an OPC-UA source

You might see the following OPCUACollector error log message if the version of the installed OpenJDK isn't supported.

java.security.KeyStoreException: Key protection algorithm not found: java.security.UnrecoverableKeyException: Encrypt Private Key failed: unrecognized algorithm name: PBEWithSHA1AndDESede Failed to start OPC-UA Connection for Source 'Server 1': Failed to add key to store

To downgrade to the supported OpenJDK version, follow the steps in this section. These steps assume that you use a device with Ubuntu. If you use a different Linux distribution, consult the relevant documentation for your device.

To downgrade to the support Amazon Corretto 8

  1. To uninstall the current OpenJDK, run one of the following commands.

    • sudo apt purge -y openjdk-8-jre-headless
    • sudo apt-get purge -y java-1.8.0-amazon-corretto-jdk
  2. To download and install the supported Amazon Corretto 8, run the following command.

    curl -s https://corretto.aws/downloads/resources/8.282.08.1/java-1.8.0-amazon-corretto-jdk_8.282.08-1_amd64.deb --output /tmp/java-1.8.0-amazon-corretto-jdk_8.282.08-1_amd64.deb sudo apt-get update && sudo apt-get install java-common sudo dpkg --install /tmp/java-1.8.0-amazon-corretto-jdk_8.282.08-1_amd64.deb
  3. To restart the AWS IoT Greengrass V1 Core software, run the following command.

    sudo /greengrass/ggc/core/greengrassd restart

AWS IoT SiteWise doesn't receive data from OPC-UA servers

If your AWS IoT SiteWise assets aren't receiving data sent by your OPC-UA servers, you can search your gateway's logs to troubleshoot issues. Look for info-level swPublisher logs that contain the following message.

Emitting diagnostic name=PublishError.SomeException

Based on the type of SomeException in the log, use the following exception types and corresponding issues to troubleshoot your gateway:

  • ResourceNotFoundException – Your OPC-UA servers are sending data that doesn't match a property alias for any asset. This exception can occur in two cases:

    • Your property aliases don't exactly match your OPC-UA variables, including any source prefix you defined. Check that your property aliases and source prefixes are correct.

    • You haven't mapped your OPC-UA variables to asset properties. For more information, see Mapping industrial data streams to asset properties.

      If you already mapped all of the OPC-UA variables that you want in AWS IoT SiteWise, you can filter which OPC-UA variables the gateway sends. For more information, see Using OPC-UA node filters.

  • AccessDeniedException – Your gateway's AWS IoT Greengrass group doesn't have sufficient permissions to use the BatchPutAssetPropertyValue operation to send data to asset properties. For more information, see the AWS IoT SiteWise connector requirements.

  • InvalidRequestException – Your OPC-UA variables data types don't match your asset property data types. For example, if an OPC-UA variable has an integer data type, your corresponding asset property must be integer data type. A double-type asset property can't receive OPC-UA integer values. To fix this issue, define new properties with the correct data types.

  • TimestampOutOfRangeException – Your gateway is sending data that is outside the range that AWS IoT SiteWise accepts. AWS IoT SiteWise rejects any data points with timestamps earlier than 7 days in the past or newer than 5 minutes in the future. If your gateway lost power or connection to the AWS Cloud, you might need to clear your gateway's cache.

  • ThrottlingException or LimitExceededException – Your request exceeded an AWS IoT SiteWise service quota, such as rate of data points ingested or request rate for asset property data API operations. Check that your configuration doesn't exceed the AWS IoT SiteWise quotas.

Troubleshooting AWS IoT Greengrass issues

To find solutions to many issues configuring or deploying your gateway on AWS IoT Greengrass, see Troubleshooting AWS IoT Greengrass in the AWS IoT Greengrass Developer Guide.