Skip to content

Greengrass service deployment cannot be cancelled

0

I have a Greengrass service running on a Windows machine. I am attempting to deploy new versions of some of my components to the device. I am getting the following error message (repeatedly) in the System log:

com.aws.greengrass.deployment.DeploymentService: Canceling current device deployment. {DeploymentId=arn:aws:greengrass:::configuration:thing/, GreengrassDeploymentId=, serviceName=DeploymentService, currentState=RUNNING} com.aws.greengrass.deployment.DeploymentService: Deployment is in a stage where it cannot be cancelled, need to wait for it to finish. {DeploymentId=arn:aws:greengrass:::configuration:thing/, GreengrassDeploymentId=, serviceName=DeploymentService, currentState=RUNNING}

I have attempted to cancel the Active deployment through the console and through the AWS CLI, and neither seems to change the state of the machine - the error continues. I do not have remote access to the machine (although I can get it temporarily).

Is there a way I can further troubleshoot this message or fix it? Will a restart of the Greengrass service fix it?

asked a year ago114 views
2 Answers
1

This error indicates that your Greengrass deployment has reached a state where it cannot be cancelled. Similar to other AWS services like CodeDeploy, once a deployment has progressed to a certain point, cancellation options become unavailable.

The error message shows that the deployment service is attempting to cancel the current deployment but is unable to do so because the deployment is in a stage where cancellation is not possible. The system is waiting for the deployment to finish on its own.

To troubleshoot this issue:

  1. Check if the deployment might be related to a large deployment document. If the core device receives a deployment document larger than 7 KB (for deployments targeting things) or 31 KB (for deployments targeting thing groups), it might cause issues. In such cases, ensure the core device's AWS IoT policy includes the greengrass:GetDeploymentConfiguration permission.

  2. Restarting the Greengrass service on the Windows machine could potentially help resolve the issue by clearing the current deployment state. This is often a practical solution when a deployment is stuck.

  3. If you gain temporary remote access to the machine, you could:

  • Check the complete Greengrass logs for more detailed error information
  • Manually restart the Greengrass service
  • Verify if there are any resource constraints (memory, disk space) that might be affecting the deployment

If the deployment continues to fail after a service restart, you may need to investigate further by examining the complete logs to identify any specific component issues or permission problems that might be causing the deployment to get stuck.
Sources
Stop a deployment with CodeDeploy - AWS CodeDeploy
Troubleshooting AWS IoT Greengrass V2 - AWS IoT Greengrass

answered a year ago
0
Accepted Answer

yes, a restart of the greengrass should fix it, note that and the repost agent's suggestion is also correct. Please note that deployment after certain point cannot be cancelled. I am guessing that you are getting the message repeatedly because you attempted to cancel it multiple time using the UI and console. If that' not the case please provide the complete set of logs and the process to replicate.

AWS
answered a year ago
  • Restarting Greengrass did fix it - we had to reach out to the administrator of the device to perform the action.

    We got into this state without any action on our part to explicitly cancel. We did possibly update the deployment while another one was ongoing which probably caused AWS under the hood to cancel the deployment.

  • Yes, that is indeed the expected behavior, if you revise the same deployment then the subsequent previous one is cancelled and cloud sends out signal to the device to cancel the respective deployment.

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.