Deploying my application fails on layer creation with a file permission error.
I tried to chmod -R 755 the layer build directory in git bash, but it had no effect.
CREATE_FAILED
AWS::Lambda::LayerVersion
OpencvLayer641c5be385
Layer conversion failed: Some files do not have read permissions;
(Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException;
Request ID: b212fad5-ef52-4386-b1de-d391533f9c68)
Deployment to complete
sam --version: SAM CLI, version 1.7.0I was able to get my code working by moving all of my dependencies into my Lambda.
See the dev branch of my repo.
But with my bundle being almost 190MB with 99% being dependencies,
this is not a good way to develop quickly having to constantly re-uploading my dependencies.
I am getting this exact error with my Node.js app. Thankfully my bundle is only 13.8MB but still, not ideal. This is what I am doing as a workaround too.
I have the same code as I had a few weeks back (that worked) and my code runs fine when run locally. The only change (I haven't rolled-back) is the change to SAM CLI 1.7.0... unless I'm missing something :(
@dan-mba I've uninstalled v1.7.0 and installed v1.6.2 and it runs fine 馃憤
Hey @dan-mba, is this layer being managed in the same template? Or is it an external layer? Can you post a copy of the SAM template?
@singledigit The template is in my repo here.
The source for the layer is only the requirements.txt for the dependencies. They contain platform specific modules, which is why I have to build with container.
FYI, I was having this exact problem (python). I downgraded to SAM 1.6.2, re-deployed my layer stack, and still had the problem. Then I re-deployed my function stack using 1.6.2 and it worked. Also note that I'm having trouble getting my layer to be assigned via the SAM function template. My layer is in a different stack. So my scenario at the moment is:
Anyway, bottom line: if you're having this problem after reverting to 1.6.2, make sure you re-deploy the layers and functions.
This is a regression in v1.7.0 and the team is currently working on a fix. Thanks for reporting!!
Had the same issue. I tried multiple SAM versions, from 1.6.0 to 1.8.0 on both Window and Linux (WSL2), looking at same files.
I have both a layer and function in the same template.
I then recreated a new blank folder structure and copied the same files in again, did a chmod -R +r * and it then deployed :-)
Now, I had initially created the files in Cloud9 and then downloaded onto my local Windows machine. So, maybe that did something strange to the permissions.
So, try a copy of the files, may help.
@dan-mba closing this as SAM cli version 1.9.0 is now out with a fix for this issue. Please re-open this issue if you update and see the same problem, or file a new issue if you find other issues. Thanks again for reporting this!
Most helpful comment
This is a regression in v1.7.0 and the team is currently working on a fix. Thanks for reporting!!