com.aws.greengrass.deployment.DeploymentConfigMerger: merge-config. merge-config-service BROKEN

0

Hi there I tried to deploy a component to a new provisioned device, however i encounter this error com.aws.greengrass.deployment.DeploymentConfigMerger: merge-config. merge-config-service BROKEN

here is part of the logs

2022-03-20T23:26:34.797Z [INFO] (pool-2-thread-6) com.aws.greengrass.componentmanager.ComponentManager: Found running component which meets the requirement and use it.. {ComponentIdentifier=rtt.ancillary-v1.0.1}
2022-03-20T23:26:34.798Z [INFO] (pool-2-thread-6) com.aws.greengrass.componentmanager.ComponentManager: Found the best local candidate that satisfies the requirement.. {LocalCandidateId=rtt.ancillary-v1.0.1}
2022-03-20T23:26:35.377Z [INFO] (pool-2-thread-6) com.aws.greengrass.componentmanager.ComponentManager: resolve-component-version-end. Resolved component version.. {ResolvedComponent=rtt.ancillary-v1.0.1}
2022-03-20T23:26:35.409Z [INFO] (pool-2-thread-6) com.aws.greengrass.componentmanager.DependencyResolver: resolve-group-dependencies-finish. Finish resolving group dependencies. {resolvedComponents={rtt.ancillary=ComponentMetadata(componentIdentifier=rtt.ancillary-v1.0.1, dependencies={})}, componentToVersionRequirements={rtt.ancillary={thing/test123==1.0.1}}}
2022-03-20T23:26:35.439Z [INFO] (pool-2-thread-6) com.aws.greengrass.componentmanager.ComponentManager: prepare-package-start. {packageIdentifier=rtt.ancillary-v1.0.1}
2022-03-20T23:26:35.502Z [INFO] (pool-2-thread-5) com.aws.greengrass.lifecyclemanager.UpdateSystemPolicyService: register-service-update-action. {action=0-071b-439e-9e57-303d24e2748f, serviceName=UpdateSystemPolicyService, currentState=RUNNING}
2022-03-20T23:26:35.508Z [INFO] (pool-2-thread-6) com.aws.greengrass.lifecyclemanager.UpdateSystemPolicyService: service-update-start. {serviceName=UpdateSystemPolicyService, currentState=RUNNING}
2022-03-20T23:26:35.513Z [INFO] (pool-2-thread-6) com.aws.greengrass.deployment.DeploymentConfigMerger: merge-config. Applying deployment changes, deployment cannot be cancelled now. {deployment=07e027a5-071b-439e-9e57-303d24e2748f}
2022-03-20T23:26:35.514Z [INFO] (pool-2-thread-6) com.aws.greengrass.deployment.DeploymentDirectoryManager: Persist configuration snapshot. {file=/greengrass/v2/deployments/07e027a5-071b-439e-9e57-303d24e2748f/rollback_snapshot.tlog}
2022-03-20T23:26:35.574Z [INFO] (main-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=main, currentState=FINISHED, newState=INSTALLED}
2022-03-20T23:26:35.587Z [INFO] (Serialized listener processor) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-config-change. Requesting restart for component. {configNode=services.main.lifecycle, serviceName=main, currentState=INSTALLED}
2022-03-20T23:26:35.804Z [ERROR] (pool-2-thread-14) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-errored. {reason=Script errored in install, serviceName=rtt.ancillary, currentState=NEW}
2022-03-20T23:26:35.806Z [INFO] (rtt.ancillary-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=rtt.ancillary, currentState=NEW, newState=ERRORED}
2022-03-20T23:26:35.807Z [INFO] (rtt.ancillary-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=rtt.ancillary, currentState=ERRORED, newState=NEW}
2022-03-20T23:26:35.905Z [ERROR] (pool-2-thread-14) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-errored. {reason=Script errored in install, serviceName=rtt.ancillary, currentState=NEW}
2022-03-20T23:26:35.905Z [INFO] (rtt.ancillary-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=rtt.ancillary, currentState=NEW, newState=ERRORED}
2022-03-20T23:26:35.906Z [INFO] (rtt.ancillary-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=rtt.ancillary, currentState=ERRORED, newState=NEW}
2022-03-20T23:26:35.996Z [ERROR] (pool-2-thread-14) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-errored. {reason=Script errored in install, serviceName=rtt.ancillary, currentState=NEW}
2022-03-20T23:26:35.997Z [INFO] (rtt.ancillary-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-set-state. {serviceName=rtt.ancillary, currentState=NEW, newState=BROKEN}
2022-03-20T23:26:35.997Z [ERROR] (rtt.ancillary-lifecycle) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-broken. service is broken. Deployment is needed. {serviceName=rtt.ancillary, currentState=BROKEN}
2022-03-20T23:26:36.701Z [WARN] (pool-2-thread-6) com.aws.greengrass.deployment.DeploymentConfigMerger: merge-config. merge-config-service BROKEN. {serviceName=rtt.ancillary}
2022-03-20T23:26:36.702Z [ERROR] (pool-2-thread-6) com.aws.greengrass.deployment.activator.DeploymentActivator: merge-config. Deployment failed. {deploymentId=07e027a5-439e-9e57-303d24e}
com.aws.greengrass.deployment.exceptions.ServiceUpdateException: Service rtt.ancillary in broken state after deployment
        at com.aws.greengrass.deployment.DeploymentConfigMerger.waitForServicesToStart(DeploymentConfigMerger.java:194)
        at com.aws.greengrass.deployment.activator.DefaultActivator.activate(DefaultActivator.java:84)
        at com.aws.greengrass.deployment.DeploymentConfigMerger.updateActionForDeployment(DeploymentConfigMerger.java:150)
        at com.aws.greengrass.deployment.DeploymentConfigMerger.lambda$mergeInNewConfig$0(DeploymentConfigMerger.java:102)
        at com.aws.greengrass.lifecyclemanager.UpdateSystemPolicyService.runUpdateActions(UpdateSystemPolicyService.java:95)
        at com.aws.greengrass.lifecyclemanager.UpdateSystemPolicyService.lambda$startup$0(UpdateSystemPolicyService.java:165)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)

2022-03-20T23:26:36.708Z [INFO] (pool-2-thread-6) com.aws.greengrass.deployment.activator.DeploymentActivator: merge-config. Rolling back failed deployment. {deploymentId=07e027a5-071b-9e57-303d}
2022-03-20T23:26:36.769Z [INFO] (pool-2-thread-6) com.aws.greengrass.config.ConfigurationWriter: truncate-tlog. queued immediate truncation. {}
2022-03-20T23:26:36.882Z [INFO] (Serialized listener processor) com.aws.greengrass.config.ConfigurationWriter: truncate-tlog. completed successfully. {}
2022-03-20T23:26:36.889Z [INFO] (pool-2-thread-6) com.aws.greengrass.deployment.DeploymentConfigMerger: merge-config. Removing services. {service-to-remove=[rtt.ancillary]}
2022-03-20T23:26:36.889Z [INFO] (pool-2-thread-14) com.aws.greengrass.lifecyclemanager.GenericExternalService: service-close. Service is now closing. {serviceName=rtt.ancillary, currentState=BROKEN}

here is my deployment config

{
    "targetArn": "arn:aws:iot::thing/test123",
    "revisionId": "2",
    "deploymentId": "07e027a5-9e57-303d2",
    "deploymentName": "update firmware",
    "deploymentStatus": "ACTIVE",
    "components": {
        "rtt.ancillary": {
            "componentVersion": "1.0.1",
            "configurationUpdate": {
                "merge": "{\"thing_name\":\"test_name\"}"
            }
        }
    },
    "deploymentPolicies": {
        "failureHandlingPolicy": "ROLLBACK",
        "componentUpdatePolicy": {
            "timeoutInSeconds": 30,
            "action": "NOTIFY_COMPONENTS"
        },
        "configurationValidationPolicy": {
            "timeoutInSeconds": 60
        }
    },
    "iotJobConfiguration": {
        "jobExecutionsRolloutConfig": {
            "exponentialRate": {
                "baseRatePerMinute": 5,
                "incrementFactor": 2.0,
                "rateIncreaseCriteria": {
                    "numberOfNotifiedThings": 10,
                    "numberOfSucceededThings": 5
                }
            },
            "maximumPerMinute": 50
        },
        "timeoutConfig": {
            "inProgressTimeoutInMinutes": 15
        }
    },
    "creationTimestamp": 1647818095.423,
    "isLatestForTarget": true,
    "tags": {
        "PRODUCT": "GGv2 Deployment"
    }
}
asked 2 years ago743 views
4 Answers
1
Accepted Answer

I see two issues here. First, you need to use the actual thing name in the merge section of your deployment config. We don’t support interpolation for thing name yet. 

Additionally, from the component log, I see it’s trying to get the “thing_name” environment variable, which doesn’t exist. For guidance on setting environment variables, you can refer to the “Setenv” recipe section here: https://docs.aws.amazon.com/greengrass/v2/developerguide/component-recipe-reference.html#:~:text=the%20following%20information%3A-,Setenv,-(Optional)%20A%20dictionary

Cheers, Janice

answered 2 years ago
0

Have you looked in the logs for the component itself? That might have additional information for troubleshooting. You can post it here as well, if you still don't understand what is causing the problem.

answered 2 years ago
0
2022-03-22T04:19:55.988Z [WARN] (Copier) ancillary: stderr. File "/greengrass/v2/packages/artifacts-unarchived/ancillary/1.0.1/ancillary/main.py", line 2, in <module>. {scriptName=services.ancillary.lifecycle.Run, serviceName=ancillary, currentState=RUNNING}
2022-03-22T04:19:55.989Z [WARN] (Copier) ancillary: stderr. from src.gps import gps. {scriptName=services.ancillary.lifecycle.Run, serviceName=ancillary, currentState=RUNNING}
2022-03-22T04:19:55.990Z [WARN] (Copier) ancillary: stderr. File "/greengrass/v2/packages/artifacts-unarchived/ancillary/1.0.1/ancillary/src/gps.py", line 29, in <module>. {scriptName=services.ancillary.lifecycle.Run, serviceName=ancillary, currentState=RUNNING}
2022-03-22T04:19:55.991Z [WARN] (Copier) ancillary: stderr. thing_name = os.environ['thing_name']. {scriptName=services.ancillary.lifecycle.Run, serviceName=ancillary, currentState=RUNNING}
2022-03-22T04:19:55.991Z [WARN] (Copier) ancillary: stderr. File "/usr/lib/python3.7/os.py", line 678, in __getitem__. {scriptName=services.ancillary.lifecycle.Run, serviceName=ancillary, currentState=RUNNING}
2022-03-22T04:19:55.992Z [WARN] (Copier) ancillary: stderr. raise KeyError(key) from None. {scriptName=services.ancillary.lifecycle.Run, serviceName=ancillary, currentState=RUNNING}
2022-03-22T04:19:55.993Z [WARN] (Copier) ancillary: stderr. KeyError: 'thing_name'. {scriptName=services.ancillary.lifecycle.Run, serviceName=ancillary, currentState=RUNNING}
2022-03-22T04:19:56.048Z [INFO] (Copier) ancillary: Run script exited. {exitCode=1, serviceName=ancillary, currentState=RUNNING}
answered 2 years ago
0

I think i understand now, it failed because the component cant run unlike in version 1

answered 2 years 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