pcal43 / fastback

Fast, incremental Minecraft world backups. Powered by Git.
https://pcal43.github.io/fastback/
GNU General Public License v2.0
133 stars 20 forks source link

LockFailedException On Auto-Backup #171

Closed Brittank88 closed 1 year ago

Brittank88 commented 2 years ago
[06:10:18] [pool-6-thread-36/INFO]: Starting auto-backup
[06:10:18] [pool-6-thread-36/INFO]: Preparing local backup snapshots/d117af03-fc97-47f5-8248-81e79a7c1dac/2022-11-03_06-10-18
[06:10:18] [pool-6-thread-36/INFO]: Disabling world save for 'git add'
[06:10:18] [pool-6-thread-36/INFO]: Adding 2361 new or modified files to index
[06:10:18] [pool-6-thread-36/INFO]: World save re-enabled.
[06:10:18] [pool-6-thread-36/ERROR]: auto-backup failed.
org.eclipse.jgit.api.errors.JGitInternalException: Exception caught during execution of add command
        at Not Enough Crashes deobfuscated stack trace.(1.19.2+build.28) ~[?:?]
        at org.eclipse.jgit.api.AddCommand.call(AddCommand.java:225) ~[org.eclipse.jgit-6.2.0.202206071550-r.jar-50d25e48-ffcf-4c5a-b39a-f4932197707d-nested.jar:?]
        at net.pcal.fastback.tasks.CommitTask.doCommit(CommitTask.java:92) ~[fastback-0.7.3+1.19.2.jar:?]
        at net.pcal.fastback.tasks.CommitTask.call(CommitTask.java:61) ~[fastback-0.7.3+1.19.2.jar:?]
        at net.pcal.fastback.tasks.CommitTask.call(CommitTask.java:40) ~[fastback-0.7.3+1.19.2.jar:?]
        at net.pcal.fastback.ModContext$AutosaveListener.lambda$run$0(ModContext.java:83) ~[fastback-0.7.3+1.19.2.jar:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
        at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: org.eclipse.jgit.errors.LockFailedException: Cannot lock /home/game-server/Minecraft/HGG/world/.git/index. Ensure that no other process has an open file handle on the lock file /home/game-server/Minecraft/HGG/world/.git/index.lock, then you may delete the lock file and retry.
        at org.eclipse.jgit.dircache.DirCache.lock(DirCache.java:221) ~[org.eclipse.jgit-6.2.0.202206071550-r.jar-50d25e48-ffcf-4c5a-b39a-f4932197707d-nested.jar:?]
        at org.eclipse.jgit.dircache.DirCache.lock(DirCache.java:292) ~[org.eclipse.jgit-6.2.0.202206071550-r.jar-50d25e48-ffcf-4c5a-b39a-f4932197707d-nested.jar:?]
        at org.eclipse.jgit.dircache.DirCache.lock(DirCache.java:258) ~[org.eclipse.jgit-6.2.0.202206071550-r.jar-50d25e48-ffcf-4c5a-b39a-f4932197707d-nested.jar:?]
        at org.eclipse.jgit.lib.Repository.lockDirCache(Repository.java:1285) ~[org.eclipse.jgit-6.2.0.202206071550-r.jar-50d25e48-ffcf-4c5a-b39a-f4932197707d-nested.jar:?]
        at org.eclipse.jgit.api.AddCommand.call(AddCommand.java:122) ~[org.eclipse.jgit-6.2.0.202206071550-r.jar-50d25e48-ffcf-4c5a-b39a-f4932197707d-nested.jar:?]
        ... 9 more
client_loop: send disconnect: Connection reset by peer

This happens on every occurrence of the auto-backup event.

Same system/game info as #167.

Brittank88 commented 2 years ago

Manually deleting index.lock in the .git folder has resolved this for now, however, I can't verify that this is a permanent solution, or if it will occur again. Will say something if it does happen again.

pcal43 commented 2 years ago

Yeah, I think this is just kind of how git works - I don't think there's anything reasonable I can do here.

My guess is that you shut the server down at some point in the middle of a git operation.

Lots of discussion about this on the internet: https://www.google.com/search?q=git+index.lock+file+exists

RealKomander commented 1 year ago

There's no index.lock in my .git folder, please help, I have the same issue