Greengrass Lambdamanager fails when I set up a LegacySubscriptionRouter

0

Hi, I'm setting up GreengrassV2 and the Modbus adapter on a RPI3b. I'm running

  • aws.greengrass.Modbus: 2.1.8
  • aws.greengrass.LegacySubscriptionRouter: 2.1.11
  • aws.greengrass.LambdaManager: 2.3.2

I'm using more or less default for everything, I just added a USB modbus adapter as a device by merging the following through the UI

{
  "lambdaExecutionParameters": {
    "EnvironmentVariables": {
      "ModbusLocalPort": "/dev/ttyUSB0"
    }
  },
  "containerParams": {
    "memorySize": 525312,
    "mountROSysfs": false,
    "volumes": {},
    "devices": {
      "0": {
        "path": "/dev/ttyUSB0",
        "permission": "rw",
        "addGroupOwner": true
      }
    }
  }
}

and set up the LegacySubscriptionRouter to read from the topic

{
    "subscriptions": {
      "aws-greengrass-modbus": {
        "id": "aws-greengrass-modbus",
        "source": "component:aws.greengrass.Modbus",
        "subject": "modbus/adapter/response",
        "target": "cloud"
      }
    }
  }

Howver this breaks the LambdaManager:

2023-11-15T10:24:21.627Z [WARN] (Serialized listener processor) com.aws.greengrass.lambdamanager.LambdaManager: service-invalid-state-error. Invalid reported state. {serviceName=aws.greengrass.LambdaManager, currentState=BROKEN, newState=ERRORED}
2023-11-15T10:24:21.635Z [ERROR] (Serialized listener processor) com.aws.greengrass.lambdamanager.LambdaManager: service-errored. {serviceName=aws.greengrass.LambdaManager, currentState=BROKEN}
com.aws.greengrass.lambdamanager.system.v1subscription.InvalidArnException: The provided arn is not in proper format, arn: modbus/adapter/response
	at com.aws.greengrass.lambdamanager.system.v1subscription.RouteTable.parseArnType(RouteTable.java:163)
	at com.aws.greengrass.lambdamanager.system.v1subscription.RouteTable.convertConfigToRoute(RouteTable.java:110)
	at com.aws.greengrass.lambdamanager.system.v1subscription.RouteTable.addRoute(RouteTable.java:98)
	at com.aws.greengrass.lambdamanager.system.v1subscription.RouteTable.loadRoutesFromConfig(RouteTable.java:59)
	at com.aws.greengrass.lambdamanager.system.RouterLambda.loadSubscription(RouterLambda.java:60)
	at com.aws.greengrass.lambdamanager.LambdaManager.reloadV1Subscription(LambdaManager.java:351)
	at com.aws.greengrass.lambdamanager.LambdaManager.lambda$install$1(LambdaManager.java:147)
	at com.aws.greengrass.config.Topics.childChanged(Topics.java:439)
	at com.aws.greengrass.config.Topics.childChanged(Topics.java:461)
	at com.aws.greengrass.config.Topics.childChanged(Topics.java:461)
	at com.aws.greengrass.config.Topics.childChanged(Topics.java:461)
	at com.aws.greengrass.config.Topics.childChanged(Topics.java:461)
	at com.aws.greengrass.config.Topics.lambda$remove$9(Topics.java:418)
	at com.aws.greengrass.dependency.Context$1.run(Context.java:68)

Any tips why? Seems it expects the source to an ARN, but I'm using the LegacySubscriptionRouter from the dev guide: https://docs.aws.amazon.com/greengrass/v2/developerguide/modbus-rtu-protocol-adapter-component.html#modbus-rtu-protocol-adapter-component-output-data

Does it actually need an ARN instead here?

Haakon
asked 5 months ago198 views
3 Answers
2
Accepted Answer

Hello,

The error shows that you actually configured the "target" with the value "modbus/adapter/response" instead of setting that as the subject and target as cloud.

Please make sure you reset all legacy subscription router configuration by using "RESET": [""] in the deployment configuration update and try merging the correct configuration once again. https://docs.aws.amazon.com/greengrass/v2/developerguide/update-component-configurations.html#reset-configuration-update

You can view the current configuration on the device using the local debug console or local Greengrass CLI components. If you inspect the configuration you would see the problem that I'm talking about.

Cheers,

Michael

AWS
EXPERT
answered 5 months ago
profile pictureAWS
EXPERT
Greg_B
reviewed 5 months ago
0

Spot on, thanks! I tried that configuration first, but I had actually set up the correct setting after that, but missed the "" in the RESET[""].

I'm retrying the deployment right now, but it gets stuck on "Queued", perhaps because there's a broken component? Seen that happen earlier when there's an issue on an already deployed component, any tips on how to get past that?

Haakon
answered 5 months ago
  • Is the deployment actually in progress on the device, or is the group in progress? You are deploying to a thing group rather than an individual device. Because you deploy to a group, the group-level deployment is always active until it is cancelled. Even if all devices in a group have completed the deployment the deployment at the group level remains active so that any newly added devices will also get the deployment.

    Check the status of deployment by looking at the individual job executions at the thing (device) level. If that is in progress then the deployment is not yet done on the device.

  • In a response which it seems you just deleted, you showed that "RESET" was underneath "MERGE". This is not correct and will not fix the problem. Make sure you are properly configuring "RESET" which is a sibling key to "MERGE". If you use the AWS Console, the reset option is the box above the merge option.

  • Hi! Sorry for editing the history here, I realized my own mistake so I figured I'd remove it before you read it!

  • If you still have a problem with the deployment after correcting the merge/reset you may wish to restart Greengrass on the device which will ensure that it picks up the latest deployment you made.

  • Seems to do the tricks, yeah! Thanks for helping out :)

0

Seems there's little functionality for monitoring what's happening during a deployment, are there logs for that somewhere? The job says "In progress - Rollout completed", but there's little other info available.

Haakon
answered 5 months 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