Skip to content

AWS IoT Greengrass V2 deployment Support on thing & thingGroup both

0

Hi Team,

We are facing an issue with greengrass v2 deployment at thing and thingGroup level both. Scenario is like as below :

We have three things for and e.g device1, device2 & device3. All this things are mapped under single thing group with name "device-group".

device-group	
	- device1
	- device2
	- device3
	

In greengrass v2, we have created deployment first with thingGroup, which would trigger component deployment on all these devices. Consider deployment json is as below.

{ "deploymentName": "<TARGET_NAME>", "targetArn": "***:thinggroup/device-group", "components": { "Viewer": { "componentVersion": "1.0.0", "runWith": {} } } }

Now scenario is that, I want to release a new version of component "Viewer" with 2.0.0. Before I deploy this on all the devices, requirement is first this needs to be deploy on single device. for e.g device1 where after deployment customer can validate and give confirmation everything is working fine then after we want to proceed with deployment at thingGroup.

Right now, issue we are facing is if I create thing deployment for deployment on device1 with "Viewer" component version 2.0.0. Greengrass deployment got failed saying that constraints conflict.

{ "deploymentName": "<TARGET_NAME>", "targetArn": "***:thing/device1", "components": { "Viewer": { "componentVersion": "2.0.0", "runWith": {} } } }

023-06-12T23:41:00.474Z [ERROR] (pool-2-thread-58) com.aws.greengrass.deployment.DeploymentService: Error occurred while processing deployment. {deploymentId=cf96f385-ec51-4cb7-85a5-3d20d23884f3, serviceName=DeploymentService, currentState=RUNNING} java.util.concurrent.ExecutionException: com.aws.greengrass.componentmanager.exceptions.NoAvailableComponentVersionException: No local or cloud component version satisfies the requirements Check whether the version constraints conflict and that the component exists in your AWS account with a version that matches the version constraints. If the version constraints conflict, revise deployments to resolve the conflict. Component Viewer version constraints: thinggroup/device-group requires =1.0.0, thing/device1 requires =2.0.0.

How to handle this requirement ?

Appreciate your quick response on this query !!!

1 Answer
2

The issue you're facing is due to conflicting version constraints between the thing group deployment and the individual thing deployment. AWS IoT Greengrass V2 allows only one active deployment per target (thing or thing group) at a time. When you create a new deployment for a target that already has an existing deployment, the new deployment replaces the previous one.

To handle your requirement of deploying a new version to a single device before rolling it out to the entire group, you can follow these steps:

  1. First, remove the device (device1) from the thing group (device-group). This will prevent the device from receiving the group-level deployment.

  2. Create a new deployment targeting the individual device (device1) with the new component version (2.0.0).

  3. After validation and confirmation that everything is working fine on device1, you can proceed with updating the deployment for the thing group.

  4. Create a new deployment for the thing group (device-group) with the updated component version (2.0.0).

  5. Add device1 back to the thing group. It will now receive the same deployment as the rest of the group.

This approach allows you to test the new version on a single device without affecting the other devices in the group. It also avoids the version constraint conflict you encountered.

Remember that when you create a new deployment for a target that already has a deployment, the components in the new deployment replace those from the previous deployment. If you want to keep other components that were part of the previous deployment, make sure to include them in your new deployment configuration.

Also, note that deployments to thing groups are continuous. This means that when you add a core device to a thing group, it automatically receives the software configuration for that group. This feature can be useful when managing deployments across multiple devices.
Sources
Differences between AWS IoT Greengrass V1 and AWS IoT Greengrass V2 - AWS IoT Greengrass
Create deployments - AWS IoT Greengrass
Revise deployments - AWS IoT Greengrass

answered a year ago
EXPERT
reviewed 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.