On a pretty new fresh install using AWS's getting started guide, I'm not getting user logs (in /greengrass/ggc/var/log/user), which makes it impossible to do any Greengrass lambda development.
Here are some symptoms:
- /greengrass/ggc/var/log/user is not being created (and when I manually create it and the subdirectories below it, user/us-east-1/, greengrassd blows away all those subdirectories)
- There's a message in /greengrass/ggc/var/log/system/localwatch/localwatch.log,
failed to list the user log directory, path: /greengrass/ggc/var/log/user - There are no other error messages in runtime.log, crash.log, or any of the other system logs.
I have a bunch of theories, but I'm not able to confirm this:
I've been swapping out SD cards on the same RPi, each with different versions of the Raspbian (Jessie, Stretch, different kernel versions) and different Greengrass groups on them. Could this swapping of SD cards be a cause (eg., either AWS or some other service they use like overlayFS be taking a fingerprint of the hardware)? On another RPi which I haven't done this swapping, I don't seem to have a problem.
Is there an issue with IAM settings for the group role? I would have thought that IAM only applies to cloud services, and not Greengrass services on a gateway.
Any insights anyone might have on this would be really appreciated!!!
I've only had this happen to me once. For me, a clean install of GG and core on a new system helped and removed all of the bugs. That said, there is one place in the console that you should check to verify that logs are enabled:
- Under Greengrass Group, select the group, then go to "settings" from there you'll see "Local logs configuration." Make sure that you have those on and re-deploy to activate.
As far as debugging lambda code, I recommend "python-lambda-local" to help debug lambda code for python. Also, don't forget that some of those file locations need sudo to be able to see the files and subfolders.