Closed wookieb closed 4 years ago
Are you using any other layers or modifying any environment variables?
No sir :)
git-lambda2 is the only layer used
The only ENV variable I do set is "AWS_NODEJS_CONNECTION_REUSE_ENABLED=1"
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)
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! :)
Ah, you should've said! Ok, glad you solved the issue
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!
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