Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forge attempts to pull in non-git folders, which results in a lockfile collision with git #109

Closed
tristanpemble opened this issue Nov 30, 2017 · 1 comment

Comments

@tristanpemble
Copy link
Contributor

@tristanpemble tristanpemble commented Nov 30, 2017

When using forge pull, it seems to be running git pull within any service that it finds, regardless of if it is a git repository, or if it has already tried to pull for the repository the service exists in. It should probably do something to make sure that it only pulls once per Git repository.

Reproducible from latest commit on https://github.com/forge-playground/development-environment

λ tree
.
├── README.md
├── forge.yaml
├── k8s
├── service.yaml
├── services
│   ├── local-example1
│   │   ├── k8s
│   │   └── service.yaml
│   └── local-example2
│       ├── k8s
│       └── service.yaml
└── workspace
    └── customer-portal
        ├── Dockerfile
        ├── k8s
        │   └── deployment.yaml
        └── service.yaml

9 directories, 8 files

λ forge pull
║ cloning git@github.com:forge-playground/admin-portal.git->.forge/admin-portal
║ cloning git@github.com:forge-playground/customer-portal.git->.forge/customer-portal
║ cloning git@github.com:forge-playground/payment-processor.git->.forge/payment-processor
║ cloning git@github.com:forge-playground/message-broker.git->.forge/message-broker
║ git pull
║ Already up-to-date.
║ [.forge/customer-portal] git pull
║ Already up-to-date.
║ [.forge/payment-processor] git pull
║ Already up-to-date.
║ [.forge/customer-portal/services/local-example3] git pull
║ Already up-to-date.
║ [.forge/customer-portal/services/local-example4] git pull
║ Already up-to-date.
║ [.forge/message-broker] git pull
║ Already up-to-date.
║ [services/local-example1] git pull
║ Already up-to-date.
║ [.forge/admin-portal] git pull
║ Already up-to-date.
║ [services/local-example2] git pull
║ Already up-to-date.
║ 83 tasks run, 0 errors
║

λ forge pull
║ [.forge/customer-portal] git pull
║ Already up-to-date.
║ [.forge/message-broker] git pull
║ Already up-to-date.
║ git pull
║ Already up-to-date.
║ [services/local-example1] git pull
║ fatal: Unable to create '/Projects/development-environment/.git/ORIG_HEAD.lock': File exists.
║
║ Another git process seems to be running in this repository, e.g.
║ an editor opened by 'git commit'. Please make sure all processes
║ are terminated then try again. If it still fails, a git process
║ may have crashed in this repository earlier:
║ remove the file manually to continue.
║ [.forge/admin-portal] git pull
║ Already up-to-date.
║ [services/local-example2] git pull
║ Already up-to-date.
║ [.forge/payment-processor] git pull
║ Already up-to-date.
║ [.forge/customer-portal/services/local-example3] git pull
║ Already up-to-date.
║ [.forge/customer-portal/services/local-example4] git pull
║ Already up-to-date.
║ 71 tasks run, 1 errors
║   local-example1: command '[services/local-example1] git pull' failed[128]: fatal: Unable to create '/Projects/development-environment/.git/ORIG_HEAD.lock': File exists.
║
║ Another git process seems to be running in this repository, e.g.
║ an editor opened by 'git commit'. Please make sure all processes
║ are terminated then try again. If it still fails, a git process
║ may have crashed in this repository earlier:
║ remove the file manually to continue.

notice how it is running git pull in services/*, and the error with lock files

@rhs
Copy link
Contributor

@rhs rhs commented Dec 1, 2017

This should be fixed in 0.3.21

@rhs rhs closed this Dec 1, 2017
rhs added a commit that referenced this issue Dec 1, 2017
rhs added a commit that referenced this issue Dec 1, 2017
real fix for #109
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.