serverless-plugin-git-variables
serverless-plugin-git-variables copied to clipboard
Git Command Fails - Suspected Timeout
I'm getting on occasion erratic failures like the following:
Error --------------------------------------------------
Command failed: git describe --always --tags
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information ---------------------------
Operating System: win32
Node Version: 10.15.0
Serverless Version: 1.49.0
Enterprise Plugin Version: 1.3.6
Platform SDK Version: 2.1.0
I suspect that this may be due to the 1 second timeout on the git command. I feel that's a bit short (maybe 10 seconds would be more reasonable). Running the command git describe --always --tags directly always works fine.
@TimLudwinski thanks for the report! I'm happy to take a PR on this if you want to open one up - otherwise I hope to find time to plow through a couple of issues next week.
Hey @jacob-meacham, I've made the code changes to add a git timeout parameter and tested this locally. I'm not much of a javascript developer so I don't know how to build with babel or anything like that. Any help would be appreciated.
@TimLudwinski if you push the changes up and open a PR, I can take a look. Thanks!
I'm facing the same issue.
`Error: Command failed: git diff --stat
at ChildProcess.exithandler (child_process.js:308:12)
at ChildProcess.emit (events.js:315:20)
at ChildProcess.EventEmitter.emit (domain.js:467:12)
at maybeClose (internal/child_process.js:1048:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)`
Increasing the timeout in https://github.com/jacob-meacham/serverless-plugin-git-variables/blob/79ff4a5216ea2785bd27891114f78458c3790afa/src/index.js fixes it.