"Bad hg executable: No version string found"

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

There's a known issue with Fisheye/Crucible that persists until the latest version. The development team is already aware of the bug and work is being done in order to correct the problem, but for now, there's a workaround for customers who have servers with the defined locale being different than en_US.

Symptoms

The error message appears under the server configuration screen in Fisheye/Crucible and is presented below:

(Auto-migrated image: description temporarily unavailable)

The following appears on atlassian-fisheye.log when debugging is activated:

1 2 3 4 DEBUG [qtp305606643-220 ] fisheye ProfilingServletFilter-logRequest - start request POST /admin/editHgConfig.do?atl_token=f265d9bfa61c1f1ab83d2643c09d1242b0e6fa90&hgExecutable=C%3A%5CProgram%20Files%5CTortoiseHg%5Chg.exe sessionid=17qwbbi2wpv1f48do8lc8onhq DEBUG [qtp305606643-220 ] fisheye LoggingProcessMonitor-onBeforeStart - Starting process: C:\Program Files\TortoiseHg\hg.exe version DEBUG [qtp305606643-220 ] fisheye LoggingProcessMonitor-onAfterFinished - Finished process: C:\Program Files\TortoiseHg\hg.exe version took 125ms DEBUG [qtp305606643-220 ] fisheye ProfilingServletFilter-logRequest - end request in 219ms POST /admin/editHgConfig.do?atl_token=f265d9bfa61c1f1ab83d2643c09d1242b0e6fa90&hgExecutable=C%3A%5CProgram%20Files%5CTortoiseHg%5Chg.exe sessionid=17qwbbi2wpv1f48do8lc8onhq 200

Cause

This issue occurs because Fisheye executes a command on the system to look for the installed version of Mercurial and it expects an output in en_US format, so that it can parse the string and store the installed version in its configuration files. The command, the same for both DOS (Windows) or Unix (Linux, Mac) systems, is the following:

1 C:\> hg version

And here is the output in English locale systems:

1 2 3 4 5 6 Mercurial Distributed SCM (version 2.9.1) (see http://mercurial.selenic.com for more information) Copyright (C) 2005-2014 Matt Mackall and others This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

As the output pattern is not the same in a system set to a different locale and Fisheye has to parse it in a certain manner, its parsing formula does not work. Here is the output of the command on a Windows Server 2012 R2 system that has its locale defined as pt_BR.UTF-8. You can notice the totally different way the information is presented.

1 2 3 4 5 6 7 Sistema de controle de versÒo distribuÝdo Mercurial (versÒo 2.9.1) (veja http://mercurial.selenic.com para mais informaþ§es) Copyright (C) 2005-2014 Matt Mackall e outros Este software Ú livre; veja os fontes para condiþ§es de c¾pia. NÒo hß garantias, nem mesmo de adequaþÒo para qualquer prop¾sito em particular.

Workaround

In order to make Fisheye work without diving in your system's settings and change locale variables, an option that can prevent other softwares you use from running or change the expected behaviour of programs for your users, you can set Mercurial to report its version always in English (en_US.UTF-8). Follow the steps below to learn how to do that:

1. Open up the folder where you installed Mercurial;

Windows default installation path

TortoiseHg

1 C:\Program Files\TortoiseHg

Stand-alone Mercurial

1 C:\Program Files\Mercurial

Linux default installation directory

There's no default path on Linux, it's where you extracted the Fisheye/Crucible package when setting it up.

2. Rename the sub-folder locale to locale.orig (or anything different than the original name)

Why? Because it will prevent Mercurial from translating its output strings.

Please note that this can affect other applications relying on Mercurial's outputs.

Now, try to setup again the Hg executable path under Server settings in Fisheye's Administration page.

Updated on April 15, 2025

Still need help?

The Atlassian Community is here for you.