[英]org.eclipse.jgit.errors.LockFailedException when using Hawtio
I am using HawtIo war in my code.我在我的代码中使用 HawtIo 战争。 When I run this code in local, it works fine, but on unix box I get the following exception:
当我在本地运行此代码时,它工作正常,但在 unix 机器上我得到以下异常:
Failed to pull from remote repo io.hawt.git.RuntimeIOException: org.eclipse.jgit.api.errors.JGitInternalException: Stashing local changes did not successfully complete: io.hawt.git.RuntimeIOException: org.eclipse.jgit.api.errors.JGitInternalException: Stashing local changes did not successfully complete
at io.hawt.git.GitFacade.gitOperation(GitFacade.java:737)
at io.hawt.git.GitFacade$2.run(GitFacade.java:108)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Caused by: org.eclipse.jgit.api.errors.JGitInternalException: Stashing local changes did not successfully complete
at org.eclipse.jgit.api.StashCreateCommand.call(StashCreateCommand.java:327)
at io.hawt.git.GitFacade.gitOperation(GitFacade.java:730)
... 3 more
Caused by: org.eclipse.jgit.errors.LockFailedException: Cannot lock /remote/projusers/aptdevjboss/.hawtio/config/.git/index
at org.eclipse.jgit.dircache.DirCache.lock(DirCache.java:224)
at org.eclipse.jgit.dircache.DirCache.lock(DirCache.java:301)
at org.eclipse.jgit.dircache.DirCache.lock(DirCache.java:267)
at org.eclipse.jgit.lib.Repository.lockDirCache(Repository.java:1051)
at org.eclipse.jgit.api.StashCreateCommand.call(StashCreateCommand.java:225)
... 4 more
Please tell me what am I missing?请告诉我我错过了什么?
Also most likely what's happening is your home directory is on an NFS (or other distributed filesystem) share that doesn't support distributed locks, which is common enough.此外,最有可能发生的情况是您的主目录位于不支持分布式锁的 NFS(或其他分布式文件系统)共享上,这很常见。
You may want to set hawtio.config.dir to point to a local filesystem location that your user account has read/write permissions for.您可能希望将 hawtio.config.dir 设置为指向您的用户帐户具有读/写权限的本地文件系统位置。 You can set this either via a blueprint.properties file or building a custom hawtio-web.war with this parameter set as per our configuration guide.
您可以通过 blueprint.properties 文件进行设置,也可以根据我们的配置指南使用此参数设置构建自定义 hawtio-web.war。
The configuration guide for hawtio is at http://hawt.io/configuration/index.html hawtio 的配置指南位于http://hawt.io/configuration/index.html
Hawtio tries to copy a git repo for showing things in Dashboards and Wiki tabs. Hawtio 尝试复制 git 存储库以在仪表板和 Wiki 选项卡中显示内容。 You are probably facing a permissions issue in
/remote/projusers/aptdevjboss/.hawtio/config/.git/index
.您可能在
/remote/projusers/aptdevjboss/.hawtio/config/.git/index
面临权限问题。
Also, If you don't want to copy the git repo everytime you start hawtio, there is a offline version you can download: https://oss.sonatype.org/content/repositories/public/io/hawt/hawtio-default-offline/1.2.1/hawtio-default-offline-1.2.1.war另外,如果不想每次启动 hawtio 都复制 git repo,可以下载离线版本: https ://oss.sonatype.org/content/repositories/public/io/hawt/hawtio-default -offline/1.2.1/hawtio-default-offline-1.2.1.war
Try with below command:尝试使用以下命令:
rm -f ./.git/index.lock
rm -f ./.git/index.lock
below link might helpful.下面的链接可能会有所帮助。 Git - fatal: Unable to create '/path/my_project/.git/index.lock': File exists
Git - 致命:无法创建“/path/my_project/.git/index.lock”:文件存在
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.