Unable to deploy Greengrass V2 available component

0

Environment: Greengrass V2 Nucleus (2.9.1) running as Docker container.

We developed one aws.greengrass.generic component and have successfully published 4 versions (1.0.0, 1.0.1, 1.0.2 and 1.0.3). All three versions are published, displayed in Greengrass V2 console and artifacts correctly available in the S3 bucket.

[2022-11-26 17:32:54] INFO - Getting project configuration from gdk-config.json
[2022-11-26 17:32:54] INFO - Found component recipe file 'recipe.yaml' in the  project directory.
[2022-11-26 17:32:54] INFO - Found credentials in shared credentials file: ~/.aws/credentials
[2022-11-26 17:32:55] INFO - Using '1.0.3' as the next version of the component '<my-component>' to create.
[2022-11-26 17:32:55] INFO - Publishing the component '<my-component>' with the given project configuration.
[2022-11-26 17:32:55] INFO - Uploading the component built artifacts to s3 bucket.
[2022-11-26 17:32:55] INFO - Uploading component artifacts to S3 bucket: <my-bucket>. If this is your first time using this bucket, add the 's3:GetObject' permission to each core device's token exchange role to allow it to download the component artifacts. For more information, see https://docs.aws.amazon.com/greengrass/v2/developerguide/device-service-role.html.
[2022-11-26 17:32:56] INFO - Successfully created the artifacts bucket '<my-bucket>' in region 'us-east-1'
[2022-11-26 17:32:58] INFO - Updating the component recipe <my-component>-1.0.3.
[2022-11-26 17:32:58] INFO - Creating a new greengrass <my-component>-1.0.3
[2022-11-26 17:32:58] INFO - Created private version '1.0.3' of the component in the account.'<my-component>'.

However, we apparently can only deploy version 1.0.0 successfully. All other versions fail.

2022-11-26T20:19:01.427Z [INFO] (pool-2-thread-47) com.aws.greengrass.componentmanager.ComponentManager: prepare-package-start. {packageIdentifier=<my-component>-v1.0.0}

When we try to deploy ANY newer version (e.g. 1.0.3), we always get this error:

2022-11-26T20:36:10.987Z [ERROR] (pool-2-thread-51) com.aws.greengrass.deployment.DeploymentService: Error occurred while processing deployment. {deploymentId=3a4cb705-db16-4b5b-94b4-30e53f0edc9b, 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 <my-component> version constraints: thing/<thing-name> requires =1.0.3.
...
2022-11-26T20:36:20.733Z [ERROR] (pool-2-thread-9) com.aws.greengrass.deployment.DeploymentService: Deployment task failed with following errors. {DeploymentId=arn:aws:greengrass:us-east-1:<account-id>:configuration:thing/<my-thing>:5, detailed-deployment-status=FAILED_NO_STATE_CHANGE, deployment-error-types=[REQUEST_ERROR], GreengrassDeploymentId=3a4cb705-db16-4b5b-94b4-30e53f0edc9b, serviceName=DeploymentService, currentState=RUNNING, deployment-error-stack=[DEPLOYMENT_FAILURE, NO_AVAILABLE_COMPONENT_VERSION, COMPONENT_VERSION_REQUIREMENTS_NOT_MET]}
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 <my-component> version constraints: thing/<my-thing> requires =1.0.3.
        at com.aws.greengrass.componentmanager.ComponentManager.negotiateVersionWithCloud(ComponentManager.java:229)
        at com.aws.greengrass.componentmanager.ComponentManager.resolveComponentVersion(ComponentManager.java:164)
        at com.aws.greengrass.componentmanager.DependencyResolver.lambda$resolveDependencies$2(DependencyResolver.java:125)
        at com.aws.greengrass.componentmanager.DependencyResolver.resolveComponentDependencies(DependencyResolver.java:221)
        at com.aws.greengrass.componentmanager.DependencyResolver.resolveDependencies(DependencyResolver.java:123)
        at com.aws.greengrass.deployment.DefaultDeploymentTask.lambda$call$2(DefaultDeploymentTask.java:125)

As stated, the component is available in Greengrass V2 console and artifacts correctly published in S3.

profile picture
rodmaz
asked a year ago831 views
4 Answers
1
Accepted Answer

Hi,

Your recipe is specifying a specific platform that it is written for. Platforms which do not match what the recipe specifies will fail with the error that you're seeing.

Specifically, you have set the CPU architecture to amd64, aarch64. This is not a valid architecture. Please see the correct way here: https://docs.aws.amazon.com/greengrass/v2/developerguide/component-recipe-reference.html#recipe-format:~:text=For%20each%20key%2Dvalue%20pair%2C%20you%20can%20specify%20one%20of%20the%20following%20values%3A.

Since you're aiming to support both amd64 and arm, I'd recommend just leaving off the architecture, and then the component will be deployable on any linux system.

If you truly want to limit to amd64 and aarch64, the correct way to do this is using a regular expression: architecture: /amd64|aarch64/

Cheers,

Michael

AWS
EXPERT
answered a year ago
profile picture
EXPERT
reviewed a month ago
  • Thanks Michael! That fixed it. I would recommend team to improve the error logging message. Making it perhaps clearer that the problem was in the platform/architecture section of the recipe would save some time. ;-)

0

Thanks @AWS-User-Nitrin. However all the mentioned reasons do not make sense in our opinion:

The core device is the target of multiple deployments that have conflicting component version requirements. For example, the core device might be the target of multiple deployments that include a com.example.HelloWorld component, where one deployment requires version 1.0.0 and the other requires version 1.0.1. It's impossible to have a component that meets both requirements, so the deployment fails.

We created a new deployment revision and upgraded the component version. Besides, we have also removed the deployment and started fresh. We simply cannot deploy any version of that component, except 1.0.0.

The component version doesn't exist in the AWS IoT Greengrass service or on the local device. The component might have been deleted, for example.

Like stated, the component is listed in the GGV2 console, including all its versions. The artifacts are also in AWS S3 correctly placed.

*The core device's AWS IoT policy doesn't grant the greengrass:ResolveComponentCandidates permission. *

It does grant this permission (no 403 errors are logged).

There exists component versions that meet the version requirements, but none are compatible with the core device's platform.

This is not the case.

profile picture
rodmaz
answered a year ago
  • What is the full recipe of your component?

  • As Michael mentioned, can you please share or mention the full recipe of your component?

0
profile pictureAWS
EXPERT
answered a year ago
0

Our full component recipe is:

---
RecipeFormatVersion: 2020-01-25
ComponentName: com.example.MyComponent
ComponentVersion: 1.0.0
ComponentDescription: My component description.
ComponentPublisher: MyCompany Inc.
ComponentType: aws.greengrass.generic
ComponentDependencies:
  aws.greengrass.Nucleus:
    VersionRequirement: ">=2.9.0"
    DependencyType: HARD
  aws.greengrass.TokenExchangeService:
    VersionRequirement: ">=2.0.0"
    DependencyType: HARD

Manifests:
  - Platform:
      os: linux
      architecture: amd64, aarch64
    Lifecycle:
      Run: "node {artifacts:decompressedPath}/MyComponent/index.js"
    Artifacts:
      - URI: "s3://BUCKET_NAME/COMPONENT_NAME/COMPONENT_VERSION/MyComponent.zip"
        Unarchive: ZIP

profile picture
rodmaz
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.

Guidelines for Answering Questions