Skip to content

AWS IoT Core Console Bug: CloudWatch Shows Thing Name Instead of Shadow Name in deviceShadowName Field

0

I've discovered what appears to be a bug in the AWS IoT Core console that affects CloudWatch error logging for named device shadows.

Issue Description: When navigating to the Device Shadows tab in the IoT Core console (IoT Core → Things → [Select Thing] → Device Shadows tab), the console UI correctly loads and displays all named shadows, but CloudWatch logs show incorrect GetThingShadow errors - one error entry for each named shadow that gets loaded.

Expected vs Actual Behavior:

  • Expected: CloudWatch deviceShadowName field should show the actual shadow names being loaded
  • Actual: CloudWatch deviceShadowName field shows the Thing name instead of the shadow names
  • Error message: "No shadow exists with name: '[Thing-Name]'" when the actual shadow names are different

Steps to Reproduce:

  1. Navigate to IoT Core → Things
  2. Select any Thing with named device shadows
  3. Click on the "Device Shadows" tab
  4. Observe that named shadows load correctly in the UI
  5. Check CloudWatch logs for GetThingShadow events - you'll see one error per named shadow

Verification Performed: I confirmed the shadows exist and are accessible using AWS CLI:

aws iot-data get-thing-shadow --thing-name [ThingName] --shadow-name [ActualShadowName] output.json

This command successfully returns the shadow data for each named shadow, proving they exist and the console should be able to access them.

Impact: While the console functions correctly for viewing shadows, the misleading error logs (one per named shadow) make troubleshooting difficult and could confuse developers debugging IoT applications.

Environment:

  • Service: AWS IoT Core
  • Interface: AWS Management Console
  • Error location: CloudWatch Logs
  • Trigger: Loading Device Shadows tab

Has anyone else encountered this issue? Is there a known workaround or has this been reported to the IoT Core team?

1 Answer
0

Based on the information provided, it appears you're encountering an issue with how AWS IoT Core logs shadow operations in CloudWatch.

The behavior you're describing does seem unusual. When accessing a named shadow through the IoT Core console, the CloudWatch logs should correctly identify the shadow name in the deviceShadowName field, not the thing name.

In AWS IoT, there are two types of shadows: unnamed (classic) shadows and named shadows. A thing can have multiple named shadows but only one unnamed shadow. When working with named shadows, the shadow name should be properly reflected in logs and API calls.

For named shadows, the system requires that the shadow be created first before it can be accessed. This is typically done by publishing an update to the shadow with the specific shadow name. The fact that your AWS CLI command works confirms that the named shadow exists and is accessible.

The issue you're experiencing might be related to how the console is making the API call to retrieve the shadow information. While the console UI correctly displays the shadow content, it appears the logging mechanism might be incorrectly recording the thing name instead of the shadow name in the CloudWatch logs.

This could indeed be a bug in the AWS IoT Core console's logging implementation. Since you've verified that the shadow exists and is accessible via CLI, and the console is correctly displaying the shadow content despite the error logs, this suggests an inconsistency in how the operation is being logged rather than an actual failure to access the shadow.

As a workaround, you might want to continue using the AWS CLI or SDK for any critical shadow operations where you need accurate logging. For monitoring and debugging purposes, you could also implement your own logging mechanism that clearly identifies the shadow names being accessed.

I'd recommend reporting this issue to AWS Support so they can investigate the discrepancy between the console's behavior and the CloudWatch logs.
Sources
AWS IoT Device Shadow service - AWS IoT Core
Using shadows in devices - AWS IoT Core

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.