Mercurial Executable capability `/usr/bin/hg' does not seem to be a hg client.
Asked by overseerhsof:

Hello. I have a problem!

(com.atlassian.bamboo.repository.RepositoryException : java.lang.RuntimeException: com.atlassian.bamboo.repository.RepositoryException: Mercurial Executable capability \`/usr/bin/hg' does not seem to be a hg client. Is it properly set?)

<br />

How fix it?

root@[Bamboo:/opt#](http://Bamboo/opt) which hg  
/usr/bin/hg

hg version 2.8.2

**Bambo Executables:**

|--------------------------------------------------------------------------------------------------------------------|---------------------------------------|
| [JDK 1.7](http://212.75.211.248:8085/bamboo/admin/agent/viewCapabilityKey.action?capabilityKey=system.jdk.JDK+1.7) | /usr/lib/jvm/java-7-openjdk-amd64/jre |

|-----------------------------------------------------------------------------------------------------------------------------------------|-------------------|
| [Maven 2](http://212.75.211.248:8085/bamboo/admin/agent/viewCapabilityKey.action?capabilityKey=system.builder.mvn2.Maven+2) (Maven 2.x) | /usr/share/maven2 |

|------------------------------------------------------------------------------------------------------------------------|-------------|
| [Mercurial](http://212.75.211.248:8085/bamboo/admin/agent/viewCapabilityKey.action?capabilityKey=system.hg.executable) | /usr/bin/hg |

**Default Agent**

|--------------------------------------------------------------------------------------------------------------------|---------------------------------------|
| [JDK 1.7](http://212.75.211.248:8085/bamboo/admin/agent/viewCapabilityKey.action?capabilityKey=system.jdk.JDK+1.7) | /usr/lib/jvm/java-7-openjdk-amd64/jre |

|-----------------------------------------------------------------------------------------------------------------------------------------|-------------------|
| [Maven 2](http://212.75.211.248:8085/bamboo/admin/agent/viewCapabilityKey.action?capabilityKey=system.builder.mvn2.Maven+2) (Maven 2.x) | /usr/share/maven2 |

|------------------------------------------------------------------------------------------------------------------------|-------------|
| [Mercurial](http://212.75.211.248:8085/bamboo/admin/agent/viewCapabilityKey.action?capabilityKey=system.hg.executable) | /usr/bin/hg |

**[Atlassian Bamboo](http://www.atlassian.com/software/bamboo/) version 5.3 build 4101**

Did not help:

<https://confluence.atlassian.com/display/BAMKB/Mercurial+operations+fail+due+to+mis-configured+HG+capability>

<https://confluence.atlassian.com/display/BAMBOO/Defining+a+new+version+control+capability>


Answers:
author: David Lunsford [Agency Consulting Group]
body: I found my HG location by typing hg -v which resulted /

<br />

/home/\<username\>/bin/hg


author: Alexey Chystoprudov
body: Hello Igor,

Just tested Bamboo 5.3 with Mercurial 3.1.2 and it works as expected. Also checked output of "hg version" command for Mercurial 2.8.2, pattern is the same. So maybe issue is at permission level.

Can you please provide error message from log. It should have "Output: " prefix with ERROR log level. It contains output of "hg version" command. It will help us to understand what's wrong with "hg version" command.


author: overseerhsof
body: root@[Bamboo:/opt#](http://bamboo/opt) which hg  
/usr/bin/hg

hg version 2.8.2


author: Alexey Chystoprudov
body: Hello Igor,

Match string for HG capability is

```
"^Mercurial Distributed SCM \\(version (.*)\\)"
```

```
Can you please provide result text of "hg version" command
```

comments: author: Artem Bodrin
body: This regexp is not good idea: users with localized hg will suffer. Of course they can delete /usr/share/locale/../hg.mo, as i did but this don't seems right


Tags: bamboo-administration