Troubleshooting an SiteWise Edge 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 (PDF).

Troubleshooting an SiteWise Edge gateway

Amazon IoT SiteWise Edge gateways run a set of Amazon IoT Greengrass components. You can configure your SiteWise Edge gateway to log connector events to Amazon CloudWatch and to your SiteWise Edge gateway's local file system. Then, you can view the log files associated with the connector to troubleshoot your SiteWise Edge gateway.

You can also view CloudWatch metrics reported by your SiteWise Edge gateways to troubleshoot issues with connectivity or data streams. For more information, see Amazon IoT Greengrass Version 1 gateway metrics.

Configuring and accessing SiteWise Edge gateway logs

Before you can view SiteWise Edge gateway logs, you must configure your SiteWise Edge 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 SiteWise Edge 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 SiteWise Edge gateway's log files. For more information, see Using service logs.

Troubleshooting SiteWise Edge gateway issues

Use the following information to troubleshoot SiteWise Edge gateway issues.

Unable to deploy packs to SiteWise Edge gateways

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

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

  2. In the navigation pane, under Amazon IoT 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 Amazon IoT 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 SiteWise Edge 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.

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 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 SiteWise Edge 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 SiteWise Edge 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 SiteWise Edge gateway sends. For more information, see Using OPC-UA node filters.

  • AccessDeniedException – Your SiteWise Edge 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 SiteWise Edge 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 SiteWise Edge gateway lost power or connection to the Amazon Cloud, you might need to clear your SiteWise Edge 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.

No data was shown in the dashboard

If there is no data shown in your dashboard, then in the Amazon IoT SiteWise console, check if the Publisher configuration and the Data Source are out of sync. To fix this issue, use the following produce:

  1. Logn into the Amazon IoT SiteWise console.

  2. In the Edge section, open Gateways section.

  3. Under Data sources, select Edit.

    
                SiteWise Edge gateways data source edit screenshot.
  4. Select a new source Name, and select Save to confirm your change.

  5. Verify your changes by confirming the the data source name has been updated in the Data sources table.

Changing the data source name may expedite the sync from the cloud to the edge, fixing the Out of sync error.

"Could not find or load main class" showing up in the aws.iot.SiteWiseEdgePublisher logs at /greengrass/v2/logs error

If you see this error, you may need to update the java version of your SiteWise Edge gateway.

  • From a terminal, run the following command:

    java -version

    The version of java your SiteWise Edge gateway is running with will show up under OpenJDK Runtime Environment. You'll see a response like the following:

    openjdk version "11.0.20" 2023-07-18 LTS OpenJDK Runtime Environment Corretto011.0.20.8.1 (build 11.0.20+8-LTS OpenJDK 64-Bit Server VM Corretto-11.0.20.8.1 (build 11.0.20+8-LTS, mixed node)

If you are running Java version 11.0.20.8.1 you must update the IoT SiteWise Publisher pack to version 2.4.1 or newer. Only java version 11.0.20.8.1 is affected, environments with other java versions can continue to use older versions of the IoT SiteWise Publisher component. For more information about updating a component pack, see Changing the version of SiteWise Edge gateway component packs.

Troubleshooting Amazon IoT Greengrass issues

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