Details
-
Bug
-
Resolution: Fixed
-
Medium
-
2.1.1
-
None
Description
We check whether or not the build was run on the agent after we try and retrieve the source code directory. Perforce throws an error if it can't find the directory (because it only exists on the remote agent) which is being passed to the user rather than the appropriate 'nice' error message.
We are using Perforce and most of our plans are built on remote agents using Perforce clients which can be used only the agent's machine with the workspace not being managed by Bamboo. Whenever we try to display a plan's working files we get the error message 'An unexpected error has occurred' and the following is written in the server's log file
INFO [http-8080-1] [CmdLineExecutor] Executing: c:/programs/Perforce/p4.exe clients
INFO [http-8080-1] [CmdLineExecutor] Executing: c:/programs/Perforce/p4.exe client -o bamboo_07h122913_GenericPackage1.0_GenericPackage
ERROR [http-8080-1] [ViewBuildFiles] Failed to calculate build file directory
com.atlassian.bamboo.repository.RepositoryException: Unable to extract client root from Perforce, therefore could not evaluate where the source will be checked out to.
at com.atlassian.bamboo.repository.perforce.PerforceManager.getClientRoot(PerforceManager.java:172)
at com.atlassian.bamboo.repository.perforce.PerforceRepository.getSourceCodeDirectory(PerforceRepository.java:638)
at com.atlassian.bamboo.build.ViewBuildFiles.doExecute(ViewBuildFiles.java:53)When you execute the command 'p4.exe client -o ...' on a command line, however, the root directory is printed correctly. This directory does not exist on the server, but only on the agent machine.