Troubleshooting an Amazon IoT SiteWise gateway - Amazon IoT SiteWise
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Troubleshooting an Amazon IoT SiteWise gateway

Amazon IoT SiteWise gateways run an Amazon 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 Amazon IoT Greengrass Version 1 gateway metrics.

Configuring and accessing Amazon 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 Amazon Web Services 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.

Unable to deploy packs to Amazon IoT SiteWise Edge gateways

If the Greengrass nucleus component (aws.greengrass.Nucleus) is out of date, you might not be able to deploy packs to your Amazon IoT SiteWise Edge gateway. You can use the Amazon IoT Greengrass V2 console to upgrade the Greengrass nucleus component.

Upgrade the Greengrass nucleus component (console)
  1. Navigate to the Amazon IoT Greengrass console.

  2. In the navigation pane, under Greengrass, choose Deployments.

  3. In the Deployments list, select the deployment that you want to revise.

  4. Choose Revise.

  5. On the Specify target page, choose Next.

  6. On the Select components page, under Public components, in the search box, enter aws.greengrass.Nucleus, and then select aws.greengrass.Nucleus.

  7. Choose Next.

  8. On the Configure components page, choose Next.

  9. On the Configure advanced settings page, choose Next.

  10. On the Review page, choose Deploy.

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 Amazon 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 Amazon 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 Amazon IoT Greengrass group.

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

As of version 6, the Amazon IoT SiteWise connector requires stream manager. For more information about how to enable stream manager, see step 5 of Configuring an Amazon 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. Key protection algorithm not found: 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 --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 Amazon IoT Greengrass V1 Core software, run the following command.

    sudo /greengrass/ggc/core/greengrassd restart

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

If your Amazon 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 Amazon 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 Amazon IoT Greengrass group doesn't have sufficient permissions to use the BatchPutAssetPropertyValue operation to send data to asset properties. For more information, see the Amazon 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 Amazon IoT SiteWise accepts. Amazon 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 Amazon Cloud, you might need to clear your gateway's cache.

  • ThrottlingException or LimitExceededException – Your request exceeded an Amazon 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 Amazon IoT SiteWise quotas.

Troubleshooting Amazon IoT Greengrass issues

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