I’ve created a lambda and a layer with all my dependencies. None of the libraries work, so I’m guessing the issue is in the layer. The entire error looks like this:
Response
{
“errorMessage”: “Unable to import module ‘lambda_function’: No module named ‘bs4′”,
“errorType”: “Runtime.ImportModuleError”,
“requestId”: “07778ffe-7fa0-4c60-938b-c6be48bc86e5”,
“stackTrace”: []
}
Function Logs
START RequestId: 07778ffe-7fa0-4c60-938b-c6be48bc86e5 Version: $LATEST
LAMBDA_WARNING: Unhandled exception. The most likely cause is an issue in the function code. However, in rare cases, a Lambda runtime update can cause unexpected function behavior. For functions using managed runtimes, runtime updates can be triggered by a function change, or can be applied automatically. To determine if the runtime has been updated, check the runtime version in the INIT_START log entry. If this error correlates with a change in the runtime version, you may be able to mitigate this error by temporarily rolling back to the previous runtime version. For more information, see https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html
[ERROR] Runtime.ImportModuleError: Unable to import module ‘lambda_function’: No module named ‘bs4’
Traceback (most recent call last):END RequestId: 07778ffe-7fa0-4c60-938b-c6be48bc86e5
REPORT RequestId: 07778ffe-7fa0-4c60-938b-c6be48bc86e5 Duration: 1.72 ms Billed Duration: 2 ms Memory Size: 128 MB Max Memory Used: 35 MB
Request ID
07778ffe-7fa0-4c60-938b-c6be48bc86e5
I’ve tried creating new layers, versions of layers, lambdas, downgrading lambda and layer, changing handler, both python and python/lib/python3.x/site-packages paths, removing all the code, but nothing has worked. I’ve been at it for about 2 hours but there error is always the same. Any help would be appreciated.