I seem to have the same issue. I can’t find a lock file and I can’t add a file via terminal or the github application. i get the same error — below is the log file.
2019-01-22T13:17:45.456Z — info: [ui] [AppStore] loading 1 repositories from store
2019-01-22T13:17:45.457Z — info: [ui] [AppStore] found account: cwbiggs (cwbiggs)
2019-01-22T13:17:46.233Z — info: [ui] launching: 1.5.1 (Mac OS 10.14.0)
2019-01-22T13:17:46.234Z — info: [ui] execPath: ‘/Applications/GitHub Desktop.app/Contents/Frameworks/GitHub Desktop Helper.app/Contents/MacOS/GitHub Desktop Helper’
2019-01-22T13:17:46.426Z — info: [ui] [AppStore.withAuthenticatingUser] account found for repository: PerceptionIsPresumption — cwbiggs (has token)
2019-01-22T13:17:46.428Z — info: [ui] [AppStore.withAuthenticatingUser] account found for repository: PerceptionIsPresumption — cwbiggs (has token)
2019-01-22T13:17:46.510Z — info: [ui] Stats reported.
2019-01-22T13:17:57.911Z — info: [ui] Executing fetch: git -c credential.helper= fetch —progress —prune origin (took 11.481s)
2019-01-22T13:18:01.520Z — info: [ui] Executing fetch: git -c credential.helper= fetch —progress —prune origin (took 15.085s)
2019-01-22T13:18:01.522Z — error: [ui] git -c credential.helper= fetch --progress --prune origin
exited with an unexpected code: 1.
remote: Enumerating objects: 3, done.
remote: Counting objects: 33% (1/3)
remote: Counting objects: 66% (2/3)
remote: Counting objects: 100% (3/3)
remote: Counting objects: 100% (3/3), done.
remote: Total 15 (delta 3), reused 3 (delta 3), pack-reused 12
error: cannot lock ref ‘refs/remotes/origin/gh-pages’: is at b1e5a83babab9f932c9b8c03aa6dab2a9b5cc5aa but expected 6bd01fc9a3cdd355245d78311dfe6cdcf0e5b8a3
From https://github.com/cwbiggs/PerceptionIsPresumption
! 6bd01fc..b1e5a83 gh-pages -> origin/gh-pages (unable to update local ref)
2019-01-22T13:18:43.928Z — error: [ui] git reset -- .
exited with an unexpected code: 128.
fatal: Unable to create ‘/Users/christopherbiggs/Google Drive/StephenCollaboration/PerceptionIsPresumption/.git/index.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.
(The error was parsed as 34: A lock file already exists in the repository, which blocks this operation from completing.)
2019-01-22T13:21:07.335Z — error: [ui] git reset -- .
exited with an unexpected code: 128.
fatal: Unable to create ‘/Users/christopherbiggs/Google Drive/StephenCollaboration/PerceptionIsPresumption/.git/index.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.
(The error was parsed as 34: A lock file already exists in the repository, which blocks this operation from completing.)
2019-01-22T13:21:15.191Z — error: [ui] git reset -- .
exited with an unexpected code: 128.
fatal: Unable to create ‘/Users/christopherbiggs/Google Drive/StephenCollaboration/PerceptionIsPresumption/.git/index.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.
(The error was parsed as 34: A lock file already exists in the repository, which blocks this operation from completing.)
Git uses index.lock
to know that some Git process—perhaps this one, if it just created index.lock
itself, or perhaps some other Git process—is busy doing things with the repository that require locking Git’s index. When a Git successfully creates this lock file, it then goes about its business, updating various internal databases, until it is done. It then deletes this lock file to indicate that it is done, and other Git commands can now get started, do their things, and finish.
If there is a bug in your Git system, it’s possible for a Git command to create index.lock
, start doing its work, and then crash, leaving the lock file behind. In this case, the correct thing to do is to upgrade to a non-buggy Git so that the problem does not recur, and also to remove the index.lock
file. (You can do this in either order but if the bug remains, some Git command(s) may leave the bogus lock behind.) Due to a fairly extensive test suite, this kind of bug is rare in Git these days—in the bad old days, it was more common, but now it should hardly ever occur.
If your computer itself crashes (due to a non-Git bug, or the power failing, or whatever) while Git is in the middle of one of these operations, it’s possible that Git never gets a chance to remove the index.lock
file. In this case, you just need to remove the index.lock
file manually. However, after a computer crash, other parts of Git’s internal databases might have been damaged by the crash, so it’s wise to run git fsck
. The git fsck
program prints a number of messages even on healthy systems so don’t be too alarmed about various «dangling commit» or «dangling blob» messages: these are just informative. (In general and ideally, your computer itself should never crash at all and your power should never fail, and people should not have frozen to death in Texas in February 2021, but the world is not always ideal.)
(Windows systems sometimes see bad behavior from some antivirus software. This might go away on its own in some cases. I avoid Windows, so I have no specific recommendations here, other than «avoid Windows».)
Last, there’s a problem that has become a common issue lately for some people because Cloud Storage is so attractive.1 Specifically, if you store a Git repository (the .git
directory) in some sort of cloud-storage system, or even in a shared-disk or shared-file-system setup across a virtual machine, the competition between different agents that are attempting to synchronize this storage area can corrupt your Git repository, including resurrecting bogus index.lock
files or even damaging Git’s internal databases. Don’t do this! Keep the Git repository in an un-shared, local-disk area.
1Well, at least superficially. There really are advantages, but personally I subscribe to the Lamport definition of a distributed system: A distributed system is one in which the failure of a computer you didn’t even know existed can render your own computer unusable.
Improve Article
Save Article
Improve Article
Save Article
Here we will create a new repository with GitHub desktop in a small illustrative react app. Here when we commit we are supposed to get an error in order to illustrate via error message as a lock file already exists in the repository, which blocks this operation from completing. Do check here we are demonstrating GitHub Desktop version1.3.4 on Windows OS.
Steps to Reproduce
- Add Local Repository. Choose Repository. Get redirected to create a new repository.
- Create a new repository in the project folder
- Commit(Try to) and get the error message: A lock file already exists in the repository, which blocks this operation from completing.
Expected Behavior: Commit goes through
Actual Behavior: Get Error Message: A lock file already exists in the repository, which blocks this operation from completing.
Error: If you go to commit your file in GitHub Desktop then you get this error.
We need to follow the below steps in order to solve the above ambiguity that is as follows depicted through visual aid for better understanding as here we are using GitHub Desktop:
Step 1: Open the folder in your system.
Step 2: Click on { 3. (…) after options }.
Step 3: Click view
Step 4: Hidden file and folder > Show hidden file and folder ( click on ) and click on ok.
Step 5: Open the .git folder and delete the index.lock.
Step 6: Now, open GitHub Desktop
Step 7: Click on the commit.
As seen from the above media Commit goes through and our problem is solved earlier where we were getting an error message.
Posting artikel baru ke blog berbasis Hugo via Github hosting mengalami error message: “A lock file already exists in the repository, which blocks this operation”.
Pesan error ini disebabkan saat app Github Desktop menjalankan perintah commit
atau git push
ke repo Github, komputer mati mendadak akibat padam listrik.
Solusi untuk mengatasi pesan error “A lock file already exists in the repository, which blocks this operation from completing” ternyata gampang sekali.
Cukup menghapus file index.lock
di dalam subfolder .git
yang berada dalam folder repository Hugo Github.
Melalui jendela terminal type: $ rm -rf ./.git/index.lock
Setelah itu, jalankan lagi perintah commit to master
dan push origin
. Simsalabim pesan error “A lock file already exists in the repository, which blocks this operation from completing” hilang seketika.
Menampilkan folder .Git yang tersembunyi di macOS
By default folder .git
terhidden yang berada di lokal repository.
Untuk menampilkan file dan folder yang tersembunyi di macOS tidak semudah di system Windows:
Melalui Windows Explorer -> pilih menu View -> Option -> Change folder and search options. Lalu klik tab View di bagian Change folder and search options. Kemudian centang Show hidden files, folders, and drives terakhir OK.
Salah satu cara mudah sistem macOS ‘view hidden files’ melalui jendela terminal:
Type: $ defaults write com.apple.Finder AppleShowAllFiles true
.
Setelah itu type lagi: $ killall Finder
.
Setelah itu, buka lagi folder repository Hugo dan folder .Git
sudah tampil.
Oya, untuk menyembunyikan lagi file dan folder di sistem macOS, cukup ganti perintah $ defaults write com.apple.Finder AppleShowAllFiles false
.
Perintah $ defaults write com.apple.Finder AppleShowAllFiles
memiliki dua opsi: true
or false
.
Jangan lupa untuk $ killall Finder
lagi.
I seem to have the same issue. I can’t find a lock file and I can’t add a file via terminal or the github application. i get the same error — below is the log file.
2019-01-22T13:17:45.456Z — info: [ui] [AppStore] loading 1 repositories from store
2019-01-22T13:17:45.457Z — info: [ui] [AppStore] found account: cwbiggs (cwbiggs)
2019-01-22T13:17:46.233Z — info: [ui] launching: 1.5.1 (Mac OS 10.14.0)
2019-01-22T13:17:46.234Z — info: [ui] execPath: ‘/Applications/GitHub Desktop.app/Contents/Frameworks/GitHub Desktop Helper.app/Contents/MacOS/GitHub Desktop Helper’
2019-01-22T13:17:46.426Z — info: [ui] [AppStore.withAuthenticatingUser] account found for repository: PerceptionIsPresumption — cwbiggs (has token)
2019-01-22T13:17:46.428Z — info: [ui] [AppStore.withAuthenticatingUser] account found for repository: PerceptionIsPresumption — cwbiggs (has token)
2019-01-22T13:17:46.510Z — info: [ui] Stats reported.
2019-01-22T13:17:57.911Z — info: [ui] Executing fetch: git -c credential.helper= fetch —progress —prune origin (took 11.481s)
2019-01-22T13:18:01.520Z — info: [ui] Executing fetch: git -c credential.helper= fetch —progress —prune origin (took 15.085s)
2019-01-22T13:18:01.522Z — error: [ui] git -c credential.helper= fetch --progress --prune origin
exited with an unexpected code: 1.
remote: Enumerating objects: 3, done.
remote: Counting objects: 33% (1/3)
remote: Counting objects: 66% (2/3)
remote: Counting objects: 100% (3/3)
remote: Counting objects: 100% (3/3), done.
remote: Total 15 (delta 3), reused 3 (delta 3), pack-reused 12
error: cannot lock ref ‘refs/remotes/origin/gh-pages’: is at b1e5a83babab9f932c9b8c03aa6dab2a9b5cc5aa but expected 6bd01fc9a3cdd355245d78311dfe6cdcf0e5b8a3
From https://github.com/cwbiggs/PerceptionIsPresumption
! 6bd01fc..b1e5a83 gh-pages -> origin/gh-pages (unable to update local ref)
2019-01-22T13:18:43.928Z — error: [ui] git reset -- .
exited with an unexpected code: 128.
fatal: Unable to create ‘/Users/christopherbiggs/Google Drive/StephenCollaboration/PerceptionIsPresumption/.git/index.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.
(The error was parsed as 34: A lock file already exists in the repository, which blocks this operation from completing.)
2019-01-22T13:21:07.335Z — error: [ui] git reset -- .
exited with an unexpected code: 128.
fatal: Unable to create ‘/Users/christopherbiggs/Google Drive/StephenCollaboration/PerceptionIsPresumption/.git/index.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.
(The error was parsed as 34: A lock file already exists in the repository, which blocks this operation from completing.)
2019-01-22T13:21:15.191Z — error: [ui] git reset -- .
exited with an unexpected code: 128.
fatal: Unable to create ‘/Users/christopherbiggs/Google Drive/StephenCollaboration/PerceptionIsPresumption/.git/index.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.
(The error was parsed as 34: A lock file already exists in the repository, which blocks this operation from completing.)
Спасибо, что открыли этот @leonsegal. Не могли бы вы загрузить файл журнала, чтобы мы могли более подробно разобраться, в чем может быть проблема?
Расположение журналов macOS: ~/Library/Application Support/GitHub Desktop/logs/*.desktop.production.log
Вы также можете получить доступ к файлам журнала, перейдя в меню файлов на GitHub Desktop и выбрав Help
> Show Logs in Finder
. Загрузите файл журнала того дня, когда у вас возникла эта ошибка.
Бревно:
2018-06-14T15:51:00.018Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: brand-iq - leonsegal (has token)
2018-06-14T15:51:00.019Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: brand-iq - leonsegal (has token)
2018-06-14T15:51:00.048Z - error: [ui] `git -c credential.helper= checkout --progress master --` exited with an unexpected code: 128.
fatal: Unable to create '/Users/leon/Sites/brand-iq/.git/index.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.
(The error was parsed as 34: A lock file already exists in the repository, which blocks this operation from completing.)
У меня нигде нет открытого окна терминала, поэтому я не думаю, что запущен другой процесс git (по крайней мере, не тот, который я инициировал).
Кроме того, в каталоге .git нет index.lock.
У меня нигде нет открытого окна терминала, поэтому я не думаю, что запущен другой процесс git (по крайней мере, не тот, который я инициировал).
@leonsegal эта ошибка возникает, когда операция Git, которая должна коснуться индекса репозитория, встречает существующую операцию, которая в настоящее время изменяет индекс, поэтому вторая операция не выполняется.
Это иногда происходит, когда несколько инструментов пытаются работать с одним и тем же репозиторием — используете ли вы другой инструмент вместе с Desktop, который также имеет интеграцию с Git?
Нет, это странная вещь (и почему я ее разместил).
Я использую phpstorm, в котором есть интеграция с git, но это новая ошибка после недавнего обновления.
Я выясню, не вызвана ли ошибка phpstorm.
ОБНОВИТЬ
Эта ошибка все еще появляется, даже когда phpstorm закрыт.
Каждый раз, когда я переключаюсь на другую ветку с помощью cmd + b в локальном репо, я получаю следующую модальную ошибку:
Кажется, что это довольно легко воспроизвести, особенно если это происходит без запущенного WebStorm.
Я новичок в этом — вы хотели, чтобы я воспроизвел это? Я рецензент?
Сделать снимок экрана?
Я также часто получаю эту ошибку при нажатии на ссылку «открыть это в GitHub Desktop», когда переключение веток локально работает нормально. Вот соответствующий журнал:
2018-08-08T15:56:58.790Z - error: [ui] `git -c credential.helper= checkout --progress **redacted** --` exited with an unexpected code: 128.
fatal: Unable to create '/Users/rehkugler/Documents/Development/**redacted**/.git/index.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.
(The error was parsed as 34: A lock file already exists in the repository, which blocks this operation from completing.)
Я не уверен, связано ли это с этим, но диалоговое окно с ошибкой также появляется дважды (то есть, когда я нажимаю «Закрыть», оно немедленно появляется снова. Щелчок «Закрыть» во втором диалоговом окне закрывает ошибку навсегда)
Спасибо за подробности. Мне удалось воспроизвести это, и я собираюсь посмотреть, сможем ли мы внедрить это в будущее обновление.
Привет, у меня такая же ошибка, как описано выше. Я приложу изображение настольной версии Github, которую я использую, и я использую MacOS High Sierra Version 10.13.5.
Мне удалось воспроизвести это последовательно, проверив PR в списке PR в 1.3.2-beta1
на macOS — будь то PR из местного филиала или форка.
Мне пока не удалось воспроизвести это в режиме разработки (чтобы лучше отладить) или воспроизвести на master
. Когда я сталкиваюсь с этим, кажется, что оформление заказа не завершается, и мне нужно сделать это снова (и я могу запускать его несколько раз 😞).
Для всех, кто сталкивался с этим, не могли бы вы поделиться шагами, которые вы выполнили, чтобы вызвать это? Я хотел бы подтвердить, что они похожи на мои, пока я попытаюсь собрать более подробное воспроизведение.
РЕДАКТИРОВАТЬ: я вижу, что @leonsegal упомянул эти шаги
Каждый раз, когда я переключаюсь на другую ветку с помощью cmd + b в локальном репо, я получаю следующую модальную ошибку:
…
Ошибка не появляется при смене ветвей с наведением и щелчком в меню.
Использование клавиатуры для проверки триггеров веток для меня тоже в режиме разработки, так что это отличный подспорье: tada:
Я открыл # 5368, чтобы обратиться к первоначальным шагам, о которых сообщалось, которые, как мне кажется, также решили проблему, которую я видел. Я бы хотел услышать какие-либо другие шаги воспроизведения от других, но если это единственные распространенные шаги, это должно быть исправлено в 1.3.3
.
Я также часто получаю эту ошибку, когда нажимаю ссылку «открыть это на рабочем столе GitHub».
Я посмотрю, смогу ли я воспроизвести это — это другой путь кода, чем тот, который я исправил в # 5368
@shiftkey Я тоже получаю эту ошибку. Я использую GitHub Desktop, и мне пришлось переименовать репозиторий, но я смог внести изменения сразу после этого, поэтому не думаю, что это проблема.
Другая проблема, которая у меня возникла, и я добавляю ее, хотя я не думаю, что она связана, заключалась в том, что рабочий стол GitHub не смог найти мой проект, и я вручную сопоставил его с моей локальной папкой. Не знаю, почему это произошло.
После этого внес несколько изменений, и когда я попытался зафиксировать подмножество изменений с помощью Github Destop, я получил точно такое же сообщение:
A lock file already exists in the repository, which blocks this operation from completing.
Если это поможет, я нахожусь в другой ветке, и мне нужно переключаться между ветвями, и именно тогда появляется это сообщение. Я вернулся к своей исходной ветке, в которой я был изначально, исключил несколько файлов, предназначенных для моей другой ветки, и все еще выдает сообщение об ошибке и не позволяет мне нажимать.
Затем я перешел в командную строку и попытался как минимум сохранить свои изменения напрямую через git. Это также бросило мне другое сообщение:
fatal: Unable to create 'M:/GitHub/repository-name/.git/index.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.
Cannot save the current index state
Я отказался от предлагаемого PR # 5368 из следующего выпуска, потому что нашел другое место, где есть такая же проблема с навигацией с клавиатуры и клавишей Enter , и мне нужен некоторый контекст: https://github.com/desktop/desktop/issues / 5344 # issuecomment -412365757
Но как только мы решим, что выбраться за дверь должно быть легко.
Я считаю, что это будет решено с помощью # 5952, который разрешит --no-optional-locks
для всех пользователей и будет доступен с 1.5.0 на следующей неделе.
Если кто-то все еще может активировать это в этой версии, я хотел бы получить обновленный журнал или набор шагов воспроизведения.
Была ли эта страница полезной?
0 / 5 — 0 рейтинги
October 25, 2019
PostgreSQL
You may receive this error when there are multiple IPs on the same server that use the same port. In this case, you cannot run the postgresql service. You may encounter an error like the following when you try to start PostgreSQL Service.
Start PostgreSQL
[root@test01 system]# systemctl start postgresql-11.service Job for postgresql—11.service failed because the control process exited with error code. See «systemctl status postgresql-11.service» and «journalctl -xe» for details. |
Check PostgreSQL Status
We will also see these errors when we check the status of the PostgreSQL service with the following script.
[root@test01 system]# systemctl status postgresql-11.service Oct 24 15:01:22 test01.mycompany.lokal systemd[1]: Starting PostgreSQL 11 database server... Oct 24 15:01:23 test01.mycompany.lokal postmaster[97373]: 2019—10—24 15:01:23.014 +03 [97373] LOG: listening on IPv6 address «::1», port 5432 Oct 24 15:01:23 test01.mycompany.lokal postmaster[97373]: 2019—10—24 15:01:23.014 +03 [97373] LOG: listening on IPv4 address «127.0.0.1», port 5432 Oct 24 15:01:23 test01.mycompany.lokal postmaster[97373]: 2019—10—24 15:01:23.014 +03 [97373] FATAL: lock file «/var/run/postgresql/.s.PGSQL.5432.lock» already exists Oct 24 15:01:23 test01.mycompany.lokal postmaster[97373]: 2019—10—24 15:01:23.014 +03 [97373] HINT: Is another postmaster (PID 38016) using socket file «/var/run/postgresq…SQL.5432»? Oct 24 15:01:23 test01.mycompany.lokal systemd[1]: postgresql—11.service: main process exited, code=exited, status=1/FAILURE Oct 24 15:01:23 test01.mycompany.lokal systemd[1]: Failed to start PostgreSQL 11 database server. Oct 24 15:01:23 test01.mycompany.lokal systemd[1]: Unit postgresql—11.service entered failed state. Oct 24 15:01:23 test01.mycompany.lokal systemd[1]: postgresql—11.service failed. |
Solution
When we delete locks in the following way, we can start postgresql without receiving these errors.
rm /var/run/postgresql/.s.PGSQL.5432.lock |
Note: You must have set the IP from postgresql.conf.
About dbtut
We are a team with over 10 years of database management and BI experience.
Our Expertises:
Oracle, SQL Server, PostgreSQL, MySQL, MongoDB, Elasticsearch, Kibana, Grafana.