Comments (15)
@petergaultney interesting, this isn't something I've seen myself - I'll take a look
from serverless-plugin-git-variables.
Can confirm that this happens to me too ā although on every run, not just on the first one.
Unlike @petergaultney, Iām using Windows.
from serverless-plugin-git-variables.
Actually, I think this is related to this snippet:
serverless-plugin-git-variables/src/index.js
Lines 99 to 105 in a6a33f5
I tried rewriting the snippet locally to use sequential await
instead of map
& Promise.all
, and the error stopped happening.
Let me submit a PR.
from serverless-plugin-git-variables.
Seeing this intermittently (but frequently) on MacOSX Mojave, too.
from serverless-plugin-git-variables.
When it will be fixed???
from serverless-plugin-git-variables.
Release as 3.3.2
from serverless-plugin-git-variables.
Maybe it is not actually resolved? I already upgraded to 3.3.2 and still see this:
[2019-07-14T23:37:47.166Z] Error --------------------------------------------------
[2019-07-14T23:37:47.166Z]
[2019-07-14T23:37:47.166Z] Command failed: git write-tree
[2019-07-14T23:37:47.166Z] fatal: Unable to create '/home/jenkins/workspace/s_XXXXXXX-services_develop/.git/index.lock': File exists.
[2019-07-14T23:37:47.166Z]
[2019-07-14T23:37:47.166Z] Another git process seems to be running in this repository, e.g.
[2019-07-14T23:37:47.166Z] an editor opened by 'git commit'. Please make sure all processes
[2019-07-14T23:37:47.166Z] are terminated then try again. If it still fails, a git process
[2019-07-14T23:37:47.166Z] may have crashed in this repository earlier:
[2019-07-14T23:37:47.166Z] remove the file manually to continue.
BTW, I run several sls deploy
concurrently from the same git repo in different directories for different Lambda functions.
A backoff-then-retry may resolve the issue, I think.
from serverless-plugin-git-variables.
BTW, I run several
sls deploy
concurrently from the same git repo in different directories for different Lambda functions.
Yeah, if you're running these in parallel outside the plugin it would still be possible to have the failure.
A backoff-then-retry may resolve the issue, I think.
It would be very nice if the plugin would handle this. More to the point, it seems weird to me that this is not a read-only operation.
What if instead of doing git write-tree
and then git diff-index
, the plugin did either _exec('git status --porcelain 2>/dev/null| egrep "^(M| M)" | wc -l') > 0
(for both uncommitted and untracked) or simply _exec('git diff --stat') !== ''
(for uncommitted but ignoring untracked files)? Then this would neatly skip the entire issue even in parallel deployment situations.
https://stackoverflow.com/questions/2657935/checking-for-a-dirty-index-or-untracked-files-with-git
from serverless-plugin-git-variables.
@petergaultney I like this suggestion - I'd like to avoid your first idea because that makes a number of assumptions about the environment (and would fail on Windows in particular), but the second feels very reasonable. I'll have to think a bit about whether I want to release this as a breaking change or not but I'm earmarking a bit of time next week to plow through some of the issues that have piled up in this project
from serverless-plugin-git-variables.
I've tried out the PR referenced above from @alanning and it doesn't seem to solve the core problem, which is that the underlying implementation to get the git dirty status is not read-only with respect to git
itself.
I'm considering trying to fix this in our own fork. If/when I do, I'll make a PR.
from serverless-plugin-git-variables.
Hi @jacob-meacham we are still facing this issue. For more info, pls see PR: #55
from serverless-plugin-git-variables.
@jacob-meacham could we re-open this? The issue is still unsolved and there are two PRs related to this one.
from serverless-plugin-git-variables.
@james-hu sure thing - I've scheduled some time this week to take a look. Thanks!
from serverless-plugin-git-variables.
@jacob-meacham I've created a new pull request for this #62. Could you have a look and see if this can be merged?
from serverless-plugin-git-variables.
Released a fix in 4.1.0. Thanks!
from serverless-plugin-git-variables.
Related Issues (20)
- Add client-side validation of git variables
- Git remote HOT 1
- Cannot install - Node 8 only? HOT 2
- Injected variables not included in `serverless print` HOT 2
- Refactor to use NodeGit HOT 1
- Release 3.3.0 fails with invalid git command HOT 5
- Git Command Fails - Suspected Timeout HOT 4
- Wrong values in env vars HOT 3
- "Rejects on bad git command" test fails
- Document isDirty HOT 1
- Display GIT_USER and GIT_EMAIL by default HOT 1
- Failing build when more then one tag points to commit HOT 4
- GIT_USER and GIT_EMAIL are not exported by default HOT 2
- Old version of babel-runtime with deprecated core-js HOT 4
- Feature request: Add support for commit subject HOT 1
- Staged changes are not counted as 'dirty' by git:isDirty HOT 1
- Approached unrecognized configuration variable sources: "git". HOT 7
- Not works for Windows HOT 1
- Integration with Serverless Framework v3 HOT 3
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 serverless-plugin-git-variables.