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

Auto-commit throwing many errors #11322

Open
edalzell opened this issue Jan 7, 2025 · 3 comments · May be fixed by #11327
Open

Auto-commit throwing many errors #11322

edalzell opened this issue Jan 7, 2025 · 3 comments · May be fixed by #11327
Labels

Comments

@edalzell
Copy link
Contributor

edalzell commented Jan 7, 2025

Bug description

Seeing errors in git feature.

Strange thing is that everything seems to be working.

Should these be suppressed or is there something actually wrong here?

How to reproduce

Not sure, sorry.

Logs

Request URL: https://www.zakat.org
Request data: []
Error: {"message":"Process Class: Git\nCommand: git add /home/forge/www.zakat.org/config /home/forge/www.zakat.org/content /home/forge/www.zakat.org/users /home/forge/www.zakat.org/resources/blueprints /home/forge/www.zakat.org/resources/fieldsets /home/forge/www.zakat.org/resources/forms /home/forge/www.zakat.org/resources/users /home/forge/www.zakat.org/resources/preferences.yaml /home/forge/www.zakat.org/resources/sites.yaml /home/forge/www.zakat.org/storage/revisions\nError: fatal: Unable to create '/home/forge/www.zakat.org/.git/index.lock': File exists.\n\nAnother git process seems to be running in this repository, e.g.\nan editor opened by 'git commit'. Please make sure all processes\nare terminated then try again. If it still fails, a git process\nmay have crashed in this repository earlier:\nremove the file manually to continue.","context":[],"level":400,"level_name":"ERROR","channel":"production","datetime":"2025-01-07T11:47:08.451290-08:00","extra":[]}
Request URL: https://www.zakat.org
Request data: []
Error: {"message":"Process Class: Git\nCommand: git -c "user.name=Asrar Jaber" -c "[email protected]" commit -m "Content saved [BOT]"\nError: fatal: Unable to create '/home/forge/www.zakat.org/.git/index.lock': File exists.\n\nAnother git process seems to be running in this repository, e.g.\nan editor opened by 'git commit'. Please make sure all processes\nare terminated then try again. If it still fails, a git process\nmay have crashed in this repository earlier:\nremove the file manually to continue.","context":[],"level":400,"level_name":"ERROR","channel":"production","datetime":"2025-01-07T11:47:09.067227-08:00","extra":[]}
Request URL: https://www.zakat.org
Request data: []
Error: {"message":"Process Class: Git\nCommand: 'git' 'push' '--porcelain'\nError: error: failed to push some refs to '[email protected]:transformstudios/zakat-v3'","context":[],"level":400,"level_name":"ERROR","channel":"production","datetime":"2025-01-07T11:47:10.148766-08:00","extra":[]}


### Environment

```yaml
Environment
Application Name: Zakat Foundation of America
Laravel Version: 11.37.0
PHP Version: 8.3.15
Composer Version: 2.8.3
Environment: local
Debug Mode: ENABLED
URL: zakat.test
Maintenance Mode: OFF
Timezone: America/Los_Angeles
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: NOT CACHED

Drivers
Broadcasting: null
Cache: file
Database: mysql
Logs: stack / daily
Mail: smtp
Queue: sync
Session: file

Livewire
Livewire: v3.5.18

Statamic
Addons: 13
Sites: 4 (zakat.org (EN), zakat.org (AR), zfinstitute.com (ZFI), zakat.org (TR))
Stache Watcher: Disabled
Static Caching: Disabled
Version: 5.45.0 PRO

Statamic Addons
aryehraber/statamic-captcha: 1.14.0
edalzell/forma: 3.0.1
jacksleight/statamic-bard-mutator: 2.3.1
jacksleight/statamic-distill: 0.8.2
jonassiewertsen/statamic-livewire: 3.8.1
statamic-rad-pack/runway: 7.13.4
statamic/seo-pro: 6.5.0
transformstudios/events: 5.4.4
transformstudios/front: 3.0.1
transformstudios/github: dev-main
transformstudios/neon: dev-main
transformstudios/review: 5.0
transformstudios/simple: 5.10.2

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

@aaronbushnell
Copy link
Contributor

Sounds like this might happen if there are concurrent git commands running at the same time. Maybe ps aux | grep git could show where and how that happened? Does removing the .git/index.lock fix the issue? https://stackoverflow.com/a/38004193

If this occurred because of Statamic's git processes maybe those should be using a mutex lock to prevent another git process from running at the same time.

@edalzell
Copy link
Contributor Author

edalzell commented Jan 7, 2025

Does removing the .git/index.lock fix the issue?

By the time I check, there isn't a lock file.

@edalzell
Copy link
Contributor Author

edalzell commented Jan 7, 2025

If this occurred because of Statamic's git processes maybe those should be using a mutex lock to prevent another git process from running at the same time.

This is likely the correct solution, use the withoutOverlap on the job middleware: https://laravel.com/docs/11.x/queues#preventing-job-overlaps. Note to whomever implements this, you need to set the retries because released jobs go back in the queue.

@edalzell edalzell added the git label Jan 7, 2025
@edalzell edalzell linked a pull request Jan 7, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants