Problems with symbolic links and Team City

Hi, there:

I'm trying to workaround a problem that a customer of our Plastic SCM plugin for TeamCity is getting. He has symbolic links in his workspace that are pointing to system directories and the user used by the TeamCity process doesn't have permissions there (say /root files). So, we have to do something with these items; I decided to add them as symlinks to the patch, but when the TC Agent checks the patch afterwards it gets a FileNotFound exception due to a Permission denied error. The error does not happen in our plugin, but in the TeamCity code. I have downloaded the source code for Mercurial plugin (has the same problem as ours) and the Git plugin (it seems that they are affected, too). The customer says that this doesn't happen in SVN, but the SVN plugin source code is not available, and if I download the binaries and dissasemble them JD-GUI says that the class is not valid.

So, I really don't know how should I solve this problem. Should I write a new text file when I get a symbolic link and add it to the patch?

This is the stack trace we got:

[2013-07-03 17:16:42,534]   INFO [rmal executor 3] -      jetbrains.buildServer.VCS - Symlink detected; returning symlink path: /home/mrvci/.BuildServer/system/caches/plasticscm/plasticscm_1/dist/target_x86/root_fs/var/lock/whoopsie/lock
[2013-07-03 17:16:42,541]   WARN [rmal executor 3] -      jetbrains.buildServer.VCS - Failed to build patch for build #130 {build id=165}, VCS root: repository "main"
  path "/"
    branch "/main"
    checkout "/main" {instance id=1, parent id=1}, due to error: java.io.FileNotFoundException: /home/mrvci/.BuildServer/system/caches/plasticscm/plasticscm_1/dist/target_x86/root_fs/var/lock/whoopsie/lock (Permission denied)
jetbrains.buildServer.vcs.VcsException: java.io.FileNotFoundException: /home/mrvci/.BuildServer/system/caches/plasticscm/plasticscm_1/dist/target_x86/root_fs/var/lock/whoopsie/lock (Permission denied)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildPatchForRoot(PatchComposer.java:163)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildPatch(PatchComposer.java:154)
    at jetbrains.buildServer.serverSide.impl.BuildTypeImpl.buildPatch(BuildTypeImpl.java:404)
    at jetbrains.buildServer.serverSide.impl.BuildStarter$2.call(BuildStarter.java:11)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:679)
Caused by: java.io.FileNotFoundException: /home/mrvci/.BuildServer/system/caches/plasticscm/plasticscm_1/dist/target_x86/root_fs/var/lock/whoopsie/lock (Permission denied)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:137)
    at com.codicesoftware.plugins.teamcity.PlasticPatchBuilder.buildPatchFromDirectory(PlasticPatchBuilder.java:229)
    at com.codicesoftware.plugins.teamcity.PlasticPatchBuilder.buildPatchFromDirectory(PlasticPatchBuilder.java:223)
    at com.codicesoftware.plugins.teamcity.PlasticPatchBuilder.buildPatchFromDirectory(PlasticPatchBuilder.java:223)
    at com.codicesoftware.plugins.teamcity.PlasticPatchBuilder.buildPatchFromDirectory(PlasticPatchBuilder.java:223)
    at com.codicesoftware.plugins.teamcity.PlasticPatchBuilder.buildPatchFromDirectory(PlasticPatchBuilder.java:223)
    at com.codicesoftware.plugins.teamcity.PlasticPatchBuilder.buildPatchFromDirectory(PlasticPatchBuilder.java:223)
    at com.codicesoftware.plugins.teamcity.PlasticPatchBuilder.buildPatchFromDirectory(PlasticPatchBuilder.java:223)
    at com.codicesoftware.plugins.teamcity.PlasticPatchBuilder.buildFullPatch(PlasticPatchBuilder.java:201)
    at com.codicesoftware.plugins.teamcity.PlasticPatchBuilder.buildPatch(PlasticPatchBuilder.java:37)
    at com.codicesoftware.plugins.teamcity.PlasticVcsSupport.buildPatch(PlasticVcsSupport.java:216)
    at jetbrains.buildServer.serverSide.impl.projectSources.BuildPatchUtil.buildPatch(BuildPatchUtil.java:2)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildCleanPatchToStream(PatchComposer.java:59)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.access$100(PatchComposer.java:60)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer$2.constructPatch(PatchComposer.java:2)
    at jetbrains.buildServer.serverSide.impl.projectSources.SmallPatchCache.getCachedCleanPatch(SmallPatchCache.java:13)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchCacheImpl.requestCachedPatch(PatchCacheImpl.java:20)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.getOrMakeCacheableCleanPatch(PatchComposer.java:102)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.makePatch(PatchComposer.java:76)
    at jetbrains.buildServer.serverSide.impl.projectSources.PatchComposer.buildPatchForRoot(PatchComposer.java:156)
    ... 8 more



Thanks in advance,
Luis

Please sign in to leave a comment.