Skip to content

Error on lambda deployment: /lambda/.lgd-nfy0

0

Hello. I'm deploying a Lambda function on AWS IoT Greengrass v2 running on a Raspberry Pi Zero 2W with Raspberry Pi OS Bookworm Lite LTS. This same function has worked before on other devices without issues, and I have not changed any configuration. I am using IoT Core to deploy my function (relay_controller) as a component and it has all the required permissions.

However, when running the function on this device, I get the following errors in the logs:

[ERROR] relay_controller: xCreatePipe: Can't set permissions (436) for /lambda/.lgd-nfy0, No such file or directory.
[ERROR] relay_controller: FATAL: lambda_runtime.py:163,Failed to import handler function "main.lambda_method" due to exception: [Errno 2] No such file or directory: '.lgd-nfy-3'.
[ERROR] relay_controller: FATAL: lambda_runtime.py:489,Failed to initialize Lambda runtime due to exception: [Errno 2] No such file or directory: '.lgd-nfy-3'.

That file is not explicitly used in my function, and I am not sure how Lambda works internally. Does anyone know what could be causing this issue?

asked 2 years ago376 views

1 Answer
0

The error you're encountering suggests that there's an issue with file permissions and directory access within the Lambda execution environment on your AWS IoT Greengrass v2 setup.

This problem is likely related to how Lambda sets up its execution environment and manages permissions for directories in the deployment package. By default, if Lambda doesn't have the necessary permissions to access directories in your deployment package, it attempts to set the permissions for those directories to 755 (rwxr-xr-x).

In your case, it seems that Lambda is unable to set these permissions or create the required temporary files (.lgd-nfy0 and .lgd-nfy-3) in the /lambda/ directory. This could be due to the specific configuration of your Raspberry Pi Zero 2W or how the IoT Greengrass v2 runtime is set up on your device.

To troubleshoot this issue, you can try the following steps:

  1. Ensure that the user running the Greengrass core has sufficient permissions to write to the /lambda/ directory.

  2. Check if there are any SELinux or AppArmor policies on your Raspberry Pi OS that might be restricting access to certain directories.

  3. Verify that there's enough free space on your device's storage.

  4. Review the Greengrass configuration to ensure that Lambda functions have the necessary permissions to create and modify files in their execution environment.

  5. If you're using a non-containerized Lambda function, make sure it's configured to inherit the correct resource owner permissions.

If the issue persists, you may need to examine the Greengrass core logs more closely to identify any additional error messages or permission-related issues that could be preventing the Lambda function from initializing properly.
Sources
Troubleshoot deployment issues in Lambda - AWS Lambda
Access machine learning resources from Lambda functions - AWS IoT Greengrass
Troubleshooting AWS IoT Greengrass - AWS IoT Greengrass

answered 2 years ago

  • None of the recommendations apply. That path is not used or referenced inside my functions, so it must be related to the execution or deployment process (or something else).

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.