Code Monkey home page Code Monkey logo

Comments (15)

jacob-meacham avatar jacob-meacham commented on May 26, 2024 1

@petergaultney interesting, this isn't something I've seen myself - I'll take a look

from serverless-plugin-git-variables.

iamakulov avatar iamakulov commented on May 26, 2024

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.

iamakulov avatar iamakulov commented on May 26, 2024

Actually, I think this is related to this snippet:

return Promise.all([
this._getValue('sha1'),
this._getValue('commit'),
this._getValue('branch'),
this._getValue('isDirty'),
this._getValue('repository')
]).then(([sha1, commit, branch, isDirty, repository]) => {

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.

atz avatar atz commented on May 26, 2024

Seeing this intermittently (but frequently) on MacOSX Mojave, too.

from serverless-plugin-git-variables.

amanagrawal9 avatar amanagrawal9 commented on May 26, 2024

When it will be fixed???

from serverless-plugin-git-variables.

jacob-meacham avatar jacob-meacham commented on May 26, 2024

Release as 3.3.2

from serverless-plugin-git-variables.

james-hu avatar james-hu commented on May 26, 2024

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.

petergaultney avatar petergaultney commented on May 26, 2024

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.

jacob-meacham avatar jacob-meacham commented on May 26, 2024

@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.

petergaultney avatar petergaultney commented on May 26, 2024

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.

navrkald avatar navrkald commented on May 26, 2024

Hi @jacob-meacham we are still facing this issue. For more info, pls see PR: #55

from serverless-plugin-git-variables.

james-hu avatar james-hu commented on May 26, 2024

@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.

jacob-meacham avatar jacob-meacham commented on May 26, 2024

@james-hu sure thing - I've scheduled some time this week to take a look. Thanks!

from serverless-plugin-git-variables.

james-hu avatar james-hu commented on May 26, 2024

@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.

jacob-meacham avatar jacob-meacham commented on May 26, 2024

Released a fix in 4.1.0. Thanks!

from serverless-plugin-git-variables.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.