Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot load PCRE #23

Closed
wookieb opened this issue May 4, 2020 · 6 comments
Closed

Cannot load PCRE #23

wookieb opened this issue May 4, 2020 · 6 comments

Comments

@wookieb
Copy link

wookieb commented May 4, 2020

Unfortunatelly I got this error when trying to use git in real AWS Lambda
/opt/bin/git: error while loading shared libraries: libpcre2-8.so.0: cannot open shared object file: No such file or directory

Runtime:
nodejs12.x

Used layer:
arn:aws:lambda:eu-central-1:553035198032:layer:git-lambda2:6

@mhart
Copy link
Member

mhart commented May 4, 2020

Are you using any other layers or modifying any environment variables?

@wookieb
Copy link
Author

wookieb commented May 4, 2020

No sir :)

git-lambda2 is the only layer used

The only ENV variable I do set is "AWS_NODEJS_CONNECTION_REUSE_ENABLED=1"

@mhart
Copy link
Member

mhart commented May 4, 2020

How are you executing git? Is it just like in the README, or are you perhaps not inheriting env variables?

Can you add this to your lambda somewhere?

const { execSync } = require('child_process')
console.log(execSync('ls -l /opt/lib/libpcre2*', {encoding: 'utf8'}))
console.log(process.env.LD_LIBRARY_PATH)

@wookieb
Copy link
Author

wookieb commented May 4, 2020

My friend. This is it! I was using simple-git and it didn't inherit env from process.
Adding git().env(process.env) helped!

Thank You so much! :)

@wookieb wookieb closed this as completed May 4, 2020
@mhart
Copy link
Member

mhart commented May 4, 2020

Ah, you should've said! Ok, glad you solved the issue

@wookieb
Copy link
Author

wookieb commented May 4, 2020

TBH I didn't even though that simple-git would omit ENV variables. For me it was obvious :/. Thank You for your quick help again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants