You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
File too short on shared library libpcre2-8.so.0 #21
@cvanes I don't think sam-cli knows how to deal with symlinks properly (unlike Lambda itself). There are a bunch of issues open about it on that repo I believe
@fongie were you getting this error in a production Lambda, or just running sam locally?
You can get it running on sam cli, but you'll need to unzip the layer zip manually yourself and change your Layers configuration unfortunately. You can see a similar example of this over here: https://github.com/lambci/yumda#full-example-with-aws-sam
There's a PR open at sam-cli to fix the symlink issue, but it doesn't look like it's had much love recently: aws/aws-sam-cli#1482
Thanks! That explains it, and the example should get me started. I got the error running locally and the code never made it to production yet because of it. Is there reason to believe it would work if I pushed it to AWS?
Yep, absolutely – it's purely a bug in sam cli. If you use docker-lambda directly you should be able to get it to work locally (you'll just need to mount the layer directory manually)
Unrelated to sam-cli, this issue was resolved for me by ensuring git, if run within a child process within Lambda, is provided LD_LIBRARY_PATH (and also I believe PATH) env vars from the host Lambda process. Fwiw!
Activity
cvanes commentedon Mar 11, 2020
Same issue here when running locally using sam-cli. Is this layer compatible with sam-cli?
mhart commentedon Mar 11, 2020
@cvanes I don't think sam-cli knows how to deal with symlinks properly (unlike Lambda itself). There are a bunch of issues open about it on that repo I believe
@fongie were you getting this error in a production Lambda, or just running sam locally?
mhart commentedon Mar 11, 2020
You can get it running on sam cli, but you'll need to unzip the layer zip manually yourself and change your
Layersconfiguration unfortunately. You can see a similar example of this over here: https://github.com/lambci/yumda#full-example-with-aws-samThere's a PR open at sam-cli to fix the symlink issue, but it doesn't look like it's had much love recently: aws/aws-sam-cli#1482
fongie commentedon Mar 11, 2020
Thanks! That explains it, and the example should get me started. I got the error running locally and the code never made it to production yet because of it. Is there reason to believe it would work if I pushed it to AWS?
mhart commentedon Mar 11, 2020
Yep, absolutely – it's purely a bug in sam cli. If you use docker-lambda directly you should be able to get it to work locally (you'll just need to mount the layer directory manually)
ryanblock commentedon Sep 22, 2022
Unrelated to sam-cli, this issue was resolved for me by ensuring git, if run within a child process within Lambda, is provided
LD_LIBRARY_PATH(and also I believePATH) env vars from the host Lambda process. Fwiw!