2

I am using HawtIo war in my code. When I run this code in local, it works fine, but on unix box I get the following exception:

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?

RichaS
  • 219
  • 3
  • 14

3 Answers3

3

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.

You may want to set hawtio.config.dir to point to a local filesystem location that your user account has read/write permissions for. 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.

The configuration guide for hawtio is at http://hawt.io/configuration/index.html

Stan Lewis
  • 388
  • 1
  • 4
2

Try with below command:

rm -f ./.git/index.lock

below link might helpful. Git - fatal: Unable to create '/path/my_project/.git/index.lock': File exists

Margi212
  • 143
  • 1
  • 10
  • If you believe that this question has the same answer as an existing question, you should be flagging to close as a duplicate of that question, not answering. – Nick Apr 05 '21 at 07:07
1

Hawtio tries to copy a git repo for showing things in Dashboards and Wiki tabs. You are probably facing a permissions issue in /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

hveiga
  • 6,725
  • 7
  • 54
  • 78
  • 1
    yeah - either that or you're running multiple JVMs of hawtio on the same machine, which are all using the same configuration in ~/.hawtio/config - in which case use different accounts or specify different configurations for the config dir: http://hawt.io/configuration/index.html - any particular reason you need to run multiple hawtio JVMs on the same machine? – James Strachan Jan 14 '14 at 17:07