"cleartool: Error: Bad command line: unterminated quoted string." Any workaround ?

Hi,
I'm trying to use TeamCity 6.0 with ClearCase 7.0.1.8.
TeamCity runs on Windows XP machine. Build Agent is also installed on the same machine.
When I run my build I'm getting the follwoing error:

[2010-12-21 11:08:12,120]  DEBUG [rmal executor 9] -      jetbrains.buildServer.VCS - VCS connection problem in build configuration TEST:: Release build: Failed for the root 'Test Root' #1: cleartool: Error: Bad command line: unterminated quoted string
jetbrains.buildServer.vcs.VcsException: java.io.IOException: cleartool: Error: Bad command line: unterminated quoted string

    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.doGetLastVersion(ClearCaseConnection.java:243)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.getLastVersion(ClearCaseConnection.java:226)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.getLastVersionElement(ClearCaseConnection.java:211)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.SimpleDirectoryChildElement.createFullElement(SimpleDirectoryChildElement.java:50)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.CCParseUtil.readDirectoryVersionContent(CCParseUtil.java:48)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.processAllVersionsInternal(ClearCaseConnection.java:792)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.processAllVersionsInternal(ClearCaseConnection.java:805)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.processAllVersionsInternal(ClearCaseConnection.java:805)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.processAllVersionsInternal(ClearCaseConnection.java:805)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.processAllVersionsInternal(ClearCaseConnection.java:805)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.processAllVersionsInternal(ClearCaseConnection.java:805)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.processAllVersionsInternal(ClearCaseConnection.java:805)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.processAllVersions(ClearCaseConnection.java:771)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.structure.CacheElement.processAllVersions(CacheElement.java:93)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.processAllVersions(ClearCaseConnection.java:758)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.CCPatchProvider.buildPatch(CCPatchProvider.java:58)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseSupport.buildPatchForConnection(ClearCaseSupport.java:370)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseSupport.buildPatch(ClearCaseSupport.java:355)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseSupport$11.buildPatch(ClearCaseSupport.java:921)
    at jetbrains.buildServer.serverSide.impl.projectSources.BuildPatchUtil$1.buildPatch(BuildPatchUtil.java:1)
    at jetbrains.buildServer.vcs.VcsSupportUtil.buildPatch(VcsSupportUtil.java:93)
    at jetbrains.buildServer.serverSide.impl.projectSources.BuildPatchUtil.buildPatch(BuildPatchUtil.java:11)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildCleanPatchToStream(PatchComposer.java:73)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.access$100(PatchComposer.java:82)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer$2.constructPatch(PatchComposer.java:1)
    at jetbrains.buildServer.serverSide.impl.projectSources.SmallPatchCache.getCachedCleanPatch(SmallPatchCache.java:27)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchCacheImpl.requestCachedPatch(PatchCacheImpl.java:25)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.getOrMakeCacheableCleanPatch(PatchComposer.java:86)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.makePatch(PatchComposer.java:141)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildPatchForRoot(PatchComposer.java:101)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildPatch(PatchComposer.java:59)
    at jetbrains.buildServer.serverSide.impl.BuildTypeImpl.buildPatch(BuildTypeImpl.java:10)
    at jetbrains.buildServer.serverSide.impl.BuildTypeImpl$$FastClassByCGLIB$$a84db719.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at jetbrains.buildServer.serverSide.impl.auth.TeamCityMethodSecurityInterceptor.invoke(TeamCityMethodSecurityInterceptor.java:13)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.aop.framework.Cglib2AopProxy$FixedChainStaticTargetInterceptor.intercept(Cglib2AopProxy.java:582)
    at jetbrains.buildServer.serverSide.impl.BuildTypeImpl$$EnhancerByCGLIB$$b1bcb2b1.buildPatch(<generated>)
    at jetbrains.buildServer.serverSide.impl.BuildStarter$2.call(BuildStarter.java:0)
    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 java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: cleartool: Error: Bad command line: unterminated quoted string

    at jetbrains.buildServer.buildTriggers.vcs.clearcase.process.InteractiveProcess.executeAndReturnProcessInput(InteractiveProcess.java:65)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.executeAndReturnProcessInput(ClearCaseConnection.java:568)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.readVersionTree(ClearCaseConnection.java:271)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.doGetLastVersion(ClearCaseConnection.java:239)
    ... 45 more
[2010-12-21 11:08:12,120]   WARN [rmal executor 9] -      jetbrains.buildServer.VCS - Failed to build patch for build #1.1.504 {build id=13}, VCS root: clearcase: X:\myview\myproject\Source {id=1}, due to error: java.io.IOException: cleartool: Error: Bad command line: unterminated quoted string

jetbrains.buildServer.vcs.VcsException: java.io.IOException: cleartool: Error: Bad command line: unterminated quoted string

    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.doGetLastVersion(ClearCaseConnection.java:243)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.getLastVersion(ClearCaseConnection.java:226)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.getLastVersionElement(ClearCaseConnection.java:211)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.SimpleDirectoryChildElement.createFullElement(SimpleDirectoryChildElement.java:50)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.CCParseUtil.readDirectoryVersionContent(CCParseUtil.java:48)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.processAllVersionsInternal(ClearCaseConnection.java:792)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.processAllVersionsInternal(ClearCaseConnection.java:805)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.processAllVersionsInternal(ClearCaseConnection.java:805)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.processAllVersionsInternal(ClearCaseConnection.java:805)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.processAllVersionsInternal(ClearCaseConnection.java:805)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.processAllVersionsInternal(ClearCaseConnection.java:805)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.processAllVersionsInternal(ClearCaseConnection.java:805)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.processAllVersions(ClearCaseConnection.java:771)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.structure.CacheElement.processAllVersions(CacheElement.java:93)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.processAllVersions(ClearCaseConnection.java:758)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.CCPatchProvider.buildPatch(CCPatchProvider.java:58)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseSupport.buildPatchForConnection(ClearCaseSupport.java:370)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseSupport.buildPatch(ClearCaseSupport.java:355)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseSupport$11.buildPatch(ClearCaseSupport.java:921)
    at jetbrains.buildServer.serverSide.impl.projectSources.BuildPatchUtil$1.buildPatch(BuildPatchUtil.java:1)
    at jetbrains.buildServer.vcs.VcsSupportUtil.buildPatch(VcsSupportUtil.java:93)
    at jetbrains.buildServer.serverSide.impl.projectSources.BuildPatchUtil.buildPatch(BuildPatchUtil.java:11)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildCleanPatchToStream(PatchComposer.java:73)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.access$100(PatchComposer.java:82)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer$2.constructPatch(PatchComposer.java:1)
    at jetbrains.buildServer.serverSide.impl.projectSources.SmallPatchCache.getCachedCleanPatch(SmallPatchCache.java:27)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchCacheImpl.requestCachedPatch(PatchCacheImpl.java:25)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.getOrMakeCacheableCleanPatch(PatchComposer.java:86)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.makePatch(PatchComposer.java:141)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildPatchForRoot(PatchComposer.java:101)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildPatch(PatchComposer.java:59)
    at jetbrains.buildServer.serverSide.impl.BuildTypeImpl.buildPatch(BuildTypeImpl.java:10)
    at jetbrains.buildServer.serverSide.impl.BuildTypeImpl$$FastClassByCGLIB$$a84db719.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at jetbrains.buildServer.serverSide.impl.auth.TeamCityMethodSecurityInterceptor.invoke(TeamCityMethodSecurityInterceptor.java:13)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.aop.framework.Cglib2AopProxy$FixedChainStaticTargetInterceptor.intercept(Cglib2AopProxy.java:582)
    at jetbrains.buildServer.serverSide.impl.BuildTypeImpl$$EnhancerByCGLIB$$b1bcb2b1.buildPatch(<generated>)
    at jetbrains.buildServer.serverSide.impl.BuildStarter$2.call(BuildStarter.java:0)
    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 java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: cleartool: Error: Bad command line: unterminated quoted string

    at jetbrains.buildServer.buildTriggers.vcs.clearcase.process.InteractiveProcess.executeAndReturnProcessInput(InteractiveProcess.java:65)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.executeAndReturnProcessInput(ClearCaseConnection.java:568)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.readVersionTree(ClearCaseConnection.java:271)
    at jetbrains.buildServer.buildTriggers.vcs.clearcase.ClearCaseConnection.doGetLastVersion(ClearCaseConnection.java:239)
    ... 45 more

I found on IBM web site that this error can be related to invalid usage of % character with cleartool.
https://www-304.ibm.com/support/docview.wss?rs=984&uid=swg21149187&ratlid=cctocbody
"The solution is to escape the % character by preceding each % with a second %".

Do you know any workaround to this issue? How could I confiugure TeamCity to run my builds successfuly?

My VCS Settings:
ClearCase view path: X:\myview
Relative path within the view: myproject\Source
Use ClearCase: BASE
Global Labeling: <disabled>

VCS checkout mode: Automatically on Server
Checkout Directory: <empty>
VCS labeling mode:Do not Label

5 comments
Comment actions Permalink

Hi Dariusz,

Could you please provide us with server logs (http://confluence.jetbrains.net/display/TCD6/Reporting+Issues#ReportingIssues-vcs)? We have to know a command which crashes ClearCase.

TIA,
Konstantin

0
Comment actions Permalink

Hi Konstantin,

Thanks for response.

Unfortunatelly I can't send you a full log file because of company policy but I found the command which
causes the error:

[2010-12-21 15:31:20,242]  DEBUG [Normal executor 4] - .clearcase.ClearCaseConnection - interactive execute: cleartool lsvtree -obs -all M:\myview\myproject\Source\.@@\main\release1\release2\3\MyApplication\.@@\main\release1\release2\1\Child1\.@@\main\release1\release2\2\Child2\.@@\main\release1\1\Child3\.@@\main\release1\1\Child4\.@@\main\release1\1\Child5\.@@\main\release1\release2\1\MyResponse'.cs
[2010-12-21 15:31:20,336]  DEBUG [Normal executor 4] - .clearcase.ClearCaseConnection - interactive execute: cleartool quit

It seems that we have in our repository the file with invalid character: MyResponse'.cs

I will try to rename it and try my build again.

Regards
Darek

0
Comment actions Permalink

HI Darek,

Thanks for your clarification. Seems it's really the issue source. Let us know if something wrong also.

BR,
Konstantin

0
Comment actions Permalink

Hi,

I fixed this bug and create the issue in our tracker: TW-14999.

The patch is attached to the issue.

0
Comment actions Permalink

Thank you Maxim for the quick fix.
I will test it today and let you know does it fix my issue.

Regards,
Darek

0

Please sign in to leave a comment.