Aws-iot-greengrass : Lambdas are not running

Hello everyone!

I’m currently working with the aws-iot-greengrass snap over a RPi3 with UbuntuCore16.

I’ve followed the official instructions for deploying lambdas and I everything is OK. The lambdas are deployed to my RPi. I know this because I can see the deployments on :

/var/snap/aws-iot-greengrass/current/ggc_writable/deployments/lambdas/

The problem is that they are not running. I have some theories about why:

  • Lambdas I’m deploying are written on python 2.7 but UbuntuCore16 has python3.5 by default. If this was the problem I have 2 options:

    1. Upgrading my python from 3.5 to 3.6 (3.7 is not supported on this snap which in turns has GGC 1.8. Python3.7 is supported til GGC 1.9). As well, I’d have to upgrade my python lambda’s code to the same version (shouldn’t be difficult ).
    2. Installing python 2.7 on Ubuntu Core.

    In any of both cases I have to install a new python’s version, but I haven’t found the way of doing this.

  • The aws-iot-greengrass snap is not detecting that the lambda I deployed, is packaged in a virtual environment and needs to take those dependencies.

I think it isn’t anything related with permissions because I’ve given to the lambda root permissions (UID and GID, bot are 0). As well, the IAM role for this lambda has full access (just for testing purposes).

Any idea will be welcome!

Note that lambdas deployed with the snap don’t actually use python from the base snap, they use python from the root filesystem shipped with the snap. I don’t recall what version of python is shipped within the greengrass snap.

This sounds like the path of least resistance for you.

This is complicated because of a few things, 1 that you can’t install traditional packages on UC, 2 even if you could, the greengrass snap doesn’t use the root filesystem from Ubuntu Core, it ships it’s own root filesystem that the lambdas run inside of, so you would need to install the package to this root filesystem. I’d suggest taking this up with AWS as they maintain the snap.

This sounds like a problem taken up with AWS if your deployment isn’t propagating to the device properly.