Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

svnPath is not set properly in proof build setup #1238

chetangeo ·
I have given svnPath=svnPath=D:\Subversion\bin\svn.exe in userattribute tab of user agent on the developers machine.
In quickbuild on server machine I have set subversion exe path under plugin management as ${node.getAttribute("svnPath")}. And in user attributes its set as svnPath=D:\SubversionClient\svn.exe
When I trigger a build from dev machine it gives following error.


java.io.IOException: Cannot run program "svn" (in directory "D:\quickbuild-3.1.2-windows-x86-32\quickbuild-3.1.2-windows-x86-32\bin"): CreateProcess error=2, The system cannot find the file specified
caused by: Cannot run program "svn" (in directory "D:\quickbuild-3.1.2-windows-x86-32\quickbuild-3.1.2-windows-x86-32\bin"): CreateProcess error=2, The system cannot find the file specified
caused by: CreateProcess error=2, The system cannot find the file specified.

The same case in with antPath.

Its giving following error :
java.io.IOException: Cannot run program "ant.bat" (in directory "E:\ProofBuildCheck"): CreateProcess error=267, The directory name is invalid
caused by: Cannot run program "ant.bat" (in directory "E:\ProofBuildCheck"): CreateProcess error=267, The directory name is invalid
caused by: CreateProcess error=267, The directory name is invalid
  • replies 11
  • views 9238
  • stars 0
robinshen ADMIN ·
This error occurs because the user attribute "svnPath" is not defined, and hence QuickBuild uses the default "svn" which can not be resolved in system path. Please double check user attribute of the node spitting out this error.
chetangeo ·
Hi Robin,

user attributes are set on user agent machine....
robinshen ADMIN ·
Hi Chetangeo,
The svnPath user attribute also needs to be set on QuickBuild server if it does not exist in system path of the server machine, since some operations need to be done on server even if you are running a proof build.
ikotlova ·
I am trying to avoid setting svnPath user attribute on each node. Instead binary_svn variable is set at the root level:

${groovy: if (node.getAttribute("WRAPPER_OS") == "windows") return "svn.exe"; else return "/usr/bin/svn"; }

I also configure Subversion plugin as follows:
${vars.getValue("binary_svn")}

The same is for other executables like ant, curl, jar, tar, ...

While the build is running on a Windows node I can look up proof build local changes. However after build completion it is impossible to look for local changes - the same error shows up:
Cannot run program "svn.exe" (in directory "/opt/quickbuild-6.0.28/bin"): error=2, No such file or directory

Why diff process does not resolve 'binary_svn' value correctly on the server?
Previously I somehow resolved this problem, but now cannot recall what the trick was.

Thanks much!
IK
robinshen ADMIN ·
Looks like QB is resolving the path correctly as "svn.exe", however since the "svn.exe" does not exist in PATH of server, QB complains it. You may either add it to server PATH and restart QB server, or specify full path to svn.exe on server amending your script.
ikotlova ·
Sorry, but I do not understand your response.

server - linux
build node - windows
user agent - windows

If local change gets executed on server then 'binary_svn' should resolve to '/usr/bin/svn'; /usr/bin is already in the PATH on server.
If local change gets executed on build/user node then 'binary_svn' should resolve to 'svn.exe'; svn.exe is already in the PATH in C:\Program Files\CollabNet\Subversion Client directory.

Thank you.
robinshen ADMIN ·
Sorry I was thinking your server is windows. I am trying to reproduce but failed to do that, what I am doing:
1. install fresh QB server on Linux, where /usr/bin/svn exists
2. install build agent and user agent on Windows, where svn.exe exists on PATH
3. create a test configuration, and configure a Subversion repository and enable proof build setting, with working copy point to the Subversion working directory on the windows node running user agent.
4. add a checkout step to checkout above subversion repository.
5. in root configuration, define variable "binary_svn" with value:
${groovy: if (node.getAttribute("WRAPPER_OS") == "windows") return "svn.exe"; else return "/usr/bin/svn"; }
6. in subversion plugin setting, define subversion executable path as:
${vars.getValue("binary_svn")}
7. make some change on subversion working copy mentioned above
8. run build, and examine local change produced above and it works fine.

Is this procedure cause issue at your side?
ikotlova ·
Yes, this is the procedure.

There are some differences:
- build agent is running in console mode; tried running it in service mode and hit the same error.
- SVN repository configuration in root (non-proof) is overridden in build configuration; tried to configure repository at root level with proof support and hit the same error.
- on user agent checked out SVN local copy refers to the /trunk while in build configuration SVN repository is configured several levels down (to save time) /trunk/level1/level2/level3/...; tried to change working copy on user agent with the same SVN link: /trunk/level1/level2/level3/ and hit the same error.

Also master step is set to run 'On node with specified resource'. Checkout step is set to run 'On the same node running parent step (or server if no parent)'.

If local changes are being checked is checkout step involved? If yes, then there is no parent and that is why server tries to run it?
robinshen ADMIN ·
I changed the checkout step to run on build agent, and reproduced the issue. The problem is that vars.getValue("binary_svn") in plugin setting will use variable value stored in the build after it completes, instead of re-evaluating the value from configuration, this is fine and necessary for most cases in order to display information about a completed build (for instance the build might have different repository details resolved via variables...). To work around this issue, please modify the plugin setting script to tell QB use variable value defined in configuration explicitly by doing below:

${groovy:
import com.pmease.quickbuild.Context;
Context.push(configuration);
try {
return vars.getValue("binary_svn")
\} finally {
Context.pop();
\}
}
ikotlova ·
Works perfectly - thanks so much, Robin!

You mentioned that originally in your environment checkout step was configured to be run on the server. Could you, please provide the details how to checkout on both server and build agent? As I understand this allows to perform checkout on build agent faster as the source gets updated on the server and then synchronized with the build agent on each build run, right? Thank you!
robinshen ADMIN ·
QB will not synchronize source on agent with server, it will always contact your SCM server to update agent source code. So checking out code both on server and agent does not make sense.