Troubleshooting an SiteWise Edge gateway - AWS IoT SiteWise

Troubleshooting an SiteWise Edge gateway

AWS IoT SiteWise Edge gateways run a set of AWS IoT Greengrass components. You can configure your SiteWise Edge gateway to log events to Amazon CloudWatch and to your SiteWise Edge gateway's local file system. Then, you can view the log files 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 Monitoring AWS IoT SiteWise with Amazon CloudWatch 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 AWS 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 AWS 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 AWS IoT Greengrass V2 console to upgrade the AWS IoT Greengrass nucleus component.

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

  2. In the navigation pane, under AWS 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.

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 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 AWS IoT SiteWise, you can filter which OPC-UA variables the SiteWise Edge gateway sends. For more information, see Using OPC-UA node filters.

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

No data was shown in the dashboard

If there is no data shown in your dashboard, the Publisher configuration and the Data Source of the SiteWise Edge gateway may be out of sync. If they are out of sync, updating the name of the data source may expedite the sync from the cloud to the edge, fixing the Out of sync error.

To update the name of a data source
  1. Navigate to the AWS IoT SiteWise console.

  2. In the navigation pane, choose Edge gateways.

  3. Select the SiteWise Edge gateway connected to the dashboard.

  4. Under Data sources, select Edit.

  5. Select a new source Name, and select Save to confirm your change.

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

"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. (build 11.0.20+8-LTS OpenJDK 64-Bit Server VM Corretto- (build 11.0.20+8-LTS, mixed node)

If you are running Java version you must update the IoT SiteWise Publisher pack to version 2.4.1 or newer. Only java version 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 AWS IoT Greengrass issues

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