Comments (14)
Hey! Which Lambda runtime are you using?
from git-lambda-layer.
NodeJs 10
from git-lambda-layer.
Just re-read the readme. I misread it the first time apparently.
Switched the lambda to NodeJs 8.10 and get this:
START RequestId: d2270df8-6925-4922-b2ed-9857ca1d7237 Version: $LATEST
2019-10-02T12:27:23.873Z d2270df8-6925-4922-b2ed-9857ca1d7237 {"errorMessage":"Command failed: git clone ssh://tfs.company.com:22/tfs/Production/_git/terraform-haproxy /tmp/terraform-haproxy","errorType":"Error","stackTrace":["checkExecSyncError (child_process.js:601:13)","execSync (child_process.js:641:13)","exports.handler (/var/task/index.js:43:3)"]}
END RequestId: d2270df8-6925-4922-b2ed-9857ca1d7237
REPORT RequestId: d2270df8-6925-4922-b2ed-9857ca1d7237 Duration: 243.34 ms Billed Duration: 300 ms Memory Size: 128 MB Max Memory Used: 73 MB
I'm either going blind or there's no useful error in there. :(
from git-lambda-layer.
Well that's just the way you're invoking git with Node.js. I'm sure if you did something like:
execSync('git clone ...', { stdio: 'inherit' })
You'd be able to see the error (and I'm sure it's to do with SSH keys). See https://github.com/lambci/git-lambda-layer#complex-example-on-nodejs-w-ssh for how you might need to setup your SSH
from git-lambda-layer.
ok, so this is what I'm using:
execSync('git clone ssh://tfs.company.com:22/tfs/Production/_git/terraform-haproxy /tmp/terraform-haproxy', { encoding: 'utf8', stdio: 'inherit' })
return execSync('ls /tmp/terraform-haproxy', { encoding: 'utf8' }).split('\n')
This returns null:
return execSync('git --version', { encoding: 'utf8', stdio: 'inherit' })
If I run the commands on my desktop then they work fine.
from git-lambda-layer.
Yes, it will return null. That's how stdio: 'inherit'
works βΒ it outputs to stdout/stderr instead of returning. But then you can see the logs and so you'll be able to see where your problem is.
It doesn't look like you're specifying any ssh keys, so I'm pretty sure your ssh command won't work.
Unless there's an issue with this layer, then I'm going to close this issue
from git-lambda-layer.
Yeah, didn't include the whole as it's just your sample code with the known_hosts, key and url changed.
from git-lambda-layer.
Ok, well in that example I use stdio: 'inherit'
for the git clone command, and that will output any errors to the logs, so you can see them in CloudWatch
from git-lambda-layer.
ah ok, I see. I left the stdio: inherit part in but nothing is going to CloudWatch
from git-lambda-layer.
So I just did a straight clone from a public repo to rule out ssh config issues.
execSync('git clone https://github.com/phpredis/phpredis.git /tmp/terraform-haproxy', { encoding: 'utf8', stdio: 'inherit' })
That times out after 3 seconds. I'm assuming that if no explicit VPC is set then the lambda has internet access. Is that correct?
from git-lambda-layer.
I mean, it might be that the exception is killing the process before it has a chance to get the logs. You could try:
const { spawnSync } = require('child_process')
spawnSync('git', ['clone', 'ssh://tfs.company.com/tfs/Production/_git/terraform-haproxy', '/tmp/terraform-haproxy'], {stdio: 'inherit'})
instead (and then check the logs)
from git-lambda-layer.
When you say it times out after 3 seconds β do you mean you've only got a 3 second timeout for your Lambda? (in which case, increase it) Or that the git process exits after 3 seconds?
from git-lambda-layer.
ok, I've worked out the CloudWatch issue. It was an IAM role issue.
The git problem is that it can't resolve the hostname, which is odd because it resolves fine from other hosts in the vpc.
Anyway, I think it's safe to say that this is no longer your issue. Thankyou for your help. Much appreciated.
from git-lambda-layer.
No probs, good luck!
from git-lambda-layer.
Related Issues (20)
- Nodejs12 doesn't seem to be working with layer v3? HOT 2
- Lambda nodejs12.x - Permission denied (Public Key) HOT 2
- Could you add the build process? HOT 3
- File too short on shared library libpcre2-8.so.0 HOT 6
- Add support for git lfs HOT 4
- Cannot load PCRE HOT 6
- AccessDeniedException on Gov Cloud? HOT 4
- Python import git module error for AWS Lambda HOT 1
- Lambda -> Git SSH Authentication HOT 13
- Could not deploy because lambda with layer exceeded 250 mb... HOT 3
- How to use "git push" ? HOT 7
- Support for GIT v2.30.2 because of Security Vulnerability HOT 3
- [Question] Uploading my own zip file HOT 5
- Support for using layer.zip with AWS Lambda containers HOT 7
- Support for using aws cli executable
- clone with ssh protocol hit issues
- Support for arm64 lambdas HOT 3
- How can I create my own layer? HOT 4
- using layer with python in Lambda function HOT 2
- Update to latest versions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git-lambda-layer.