Special characters in the commit message causes Bamboo to crash if the file encoding is wrong

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

Committing a changeset with special characters causes Bamboo to fail with the following error message in the atlassian-bamboo.log file:

java.lang.RuntimeException: com.atlassian.bamboo.plugins.hg.HgCommandException: command [C:\Program
 Files\TortoiseHg\hg.exe, log, --follow, --style, 
C:\Windows\Temp\hg.style5963527991958284672.tmp, --rev, 
89b03bf5695c60657b57a7a817317632deafe4c2:0, --config, ui.ssh=ssh -o 
StrictHostKeyChecking=no -o BatchMode=yes, --limit, 1] failed. 
Working directory was `C:\Program Files\Atlassian\Application 
Data\Bamboo\xml-data\build-dir_hg-repositories-cache\7294473af8196ac76d70c34d76732c6012ae1153'.
 stderr:  stdout: <?xml version="1.0"?><log><logentry 
revision="25" 
node="89b03bf5695c60657b57a7a817317632deafe4c2"><author 
email="gcraimundo">gcraimundo</author><date>2012-07-02T11:52:39+01:00</date><parents></parents><msg
 xml:space="preserve">Teste com caracteres Tugas e não só - Coração, 
pé, sofá, à, ó, über, è, 
€</msg><paths><path>SaphetyTab/UnitTests/UnitTest1.cs</path></paths></logentry>
 
    at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:119)
 
    at com.atlassian.bamboo.executor.RetryingTaskExecutor.runTask(RetryingTaskExecutor.java:79)
 
    at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:174)
 
    at 
com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectionChangesWithRetry(DefaultChangeDetectionManager.java:396)
 
    at 
com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceLastBuild(DefaultChangeDetectionManager.java:256)
 
    at 
com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceRevisions(DefaultChangeDetectionManager.java:214)
 
    at 
com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceRevisions(DefaultChangeDetectionManager.java:139)
 
    at 
com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceLastBuildIfTriggered(DefaultChangeDetectionManager.java:118)
 
    at com.atlassian.bamboo.v2.trigger.ChangeDetectionListenerAction.process(ChangeDetectionListenerAction.java:95)
 
    at com.atlassian.bamboo.chains.ChainExecutionManagerImpl.createChainState(ChainExecutionManagerImpl.java:245)
 
    at com.atlassian.bamboo.chains.ChainExecutionManagerImpl.start(ChainExecutionManagerImpl.java:168)
 
    at sun.reflect.GeneratedMethodAccessor290.invoke(Unknown Source)
 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 
    at java.lang.reflect.Method.invoke(Unknown Source)
 
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
 
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
 
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
 
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
 
    at $Proxy81.start(Unknown Source)
 
    at sun.reflect.GeneratedMethodAccessor290.invoke(Unknown Source)
 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 
    at java.lang.reflect.Method.invoke(Unknown Source)
 
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
 
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
 
    at $Proxy82.start(Unknown Source)
 
    at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.startWithLockTaken(PlanExecutionManagerImpl.java:249)
 
    at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.access$100(PlanExecutionManagerImpl.java:40)
 
    at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$1.call(PlanExecutionManagerImpl.java:236)
 
    at com.atlassian.bamboo.plan.PlanExecutionManagerImpl$1.call(PlanExecutionManagerImpl.java:230)
 
    at com.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(ManagedLocks.java:324)
 
    at com.atlassian.bamboo.plan.PlanExecutionLockServiceImpl.lock(PlanExecutionLockServiceImpl.java:68)
 
    at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.doWithProcessLock(PlanExecutionManagerImpl.java:360)
 
    at com.atlassian.bamboo.plan.PlanExecutionManagerImpl.start(PlanExecutionManagerImpl.java:229)
 
    at com.atlassian.bamboo.plan.NonBlockingPlanExecutionServiceImpl$1.call(NonBlockingPlanExecutionServiceImpl.java:70)
 
    at com.atlassian.bamboo.plan.NonBlockingPlanExecutionServiceImpl$1.call(NonBlockingPlanExecutionServiceImpl.java:61)
 
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
 
    at java.util.concurrent.FutureTask.run(Unknown Source)
 
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 
    at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:50)
 
    at java.lang.Thread.run(Unknown Source)
 
Caused by: com.atlassian.bamboo.plugins.hg.HgCommandException: command [C:\Program
 Files\TortoiseHg\hg.exe, log, --follow, --style, 
C:\Windows\Temp\hg.style5963527991958284672.tmp, --rev, 
89b03bf5695c60657b57a7a817317632deafe4c2:0, --config, ui.ssh=ssh -o 
StrictHostKeyChecking=no -o BatchMode=yes, --limit, 1] failed. 
Working directory was `C:\Program Files\Atlassian\Application 
Data\Bamboo\xml-data\build-dir_hg-repositories-cache\7294473af8196ac76d70c34d76732c6012ae1153'.
 stderr:  stdout: <?xml version="1.0"?><log><logentry 
revision="25" 
node="89b03bf5695c60657b57a7a817317632deafe4c2"><author 
email="gcraimundo">gcraimundo</author><date>2012-07-02T11:52:39+01:00</date><parents></parents><msg
 xml:space="preserve">Teste com caracteres Tugas e não só - Coração, 
pé, sofá, à, ó, über, è, 
€</msg><paths><path>SaphetyTab/UnitTests/UnitTest1.cs</path></paths></logentry>
 
    at com.atlassian.bamboo.plugins.hg.HgCommandProcessor.runCommand(HgCommandProcessor.java:488)
 
    at com.atlassian.bamboo.plugins.hg.HgCommandProcessor.runCommand(HgCommandProcessor.java:446)
 
    at com.atlassian.bamboo.plugins.hg.HgCommandProcessor.getChangesetsSinceRevision(HgCommandProcessor.java:339)

 

Cause

This is usually the case of wrong file encoding in the OS bamboo wrapper config.

Resolution

Add the parameter wrapper.java.additional.x=-Dfile.encoding=UTF-8 to your $BAMBOO_INSTALL/conf/wrapper.cnf file, where x represents the next available digit in the list of additional configurable.

 

Last modified on Jun 27, 2013

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.