Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Bamboo ant task, -Djava.io.tmpdir=/tmp/BAMTST-IBST-BL is not passed correctly during the build

David_Ren June 7, 2016

I've got a bamboo ant task, runs the build.xml and pass the java.io.tmpdir into the build.

You can see the bamboo command line the parameter is set:

command	07-Jun-2016 22:29:03	Beginning to execute external process for build 'Bamboo-Test - Integration Build - Sales - Test - Build Business Logic #31 (BAMTST-IBST-BL-31)'\n ... 
running command line: \n/qad/web/server/ant-1.8.4/bin/ant -Djava.io.tmpdir=/tmp/BAMTST-IBST-BL -f build.xml buildbl -v\n ... in: /dr01/bamboo/xml-data/build-dir/BAMTST-IBST-BL\n ... using extra environment variables: \nbamboo_capability_system_jdk_JDK_1_6_32=/usr/java/jdk1.6.0_33-

But I've checked the log that in fact, the build take java.io.tmpdir to /tmp and I guess its a default config from somewhere.

So do you guys nows why this can not pass correctly?

Also, I cannot find the place where this -Djava.io.tmpdir is configured, its not in Plan Configuration -> Tasks

and also cannot found in global variables, task->requirement, task->artifact.

image2016-6-8 14:30:31.png

4 answers

0 votes
David_Ren June 7, 2016

Following is a bamboo partial log, at the command line, the java.io.tmpdir is corrcet.

But After executing external process,  at the beginning of the build, it try to check if the java.io.tmpdir has the get-lib.xml and you can see its 

/tmp/devel/get-libs.xml, but it should be /tmp/QRA-QRADSALESINT-BL/devel/get-libs.xml 
simple	07-Jun-2016 07:24:44	Build QRA - Integration Build - Sales - Build Business Logic #3115 (QRA-QRADSALESINT-BL-3115) started building on agent coli49Two
simple	07-Jun-2016 07:24:44	Remote Agent
simple	07-Jun-2016 07:24:44	Build working directory is /dr01/bamboo/xml-data/build-dir/QRA-QRADSALESINT-BL
simple	07-Jun-2016 07:24:44	Executing build QRA - Integration Build - Sales - Build Business Logic #3115 (QRA-QRADSALESINT-BL-3115)
simple	07-Jun-2016 07:24:44	Starting task 'Checkout Default Repository' of type 'com.atlassian.bamboo.plugins.vcs:task.vcs.checkout'
simple	07-Jun-2016 07:24:44	Running preRetrieveSourceCode task...
simple	07-Jun-2016 07:24:44	Build always requires a clean checkout
simple	07-Jun-2016 07:24:44	Cleaning build directory '/dr01/bamboo/xml-data/build-dir/QRA-QRADSALESINT-BL'
simple	07-Jun-2016 07:24:44	Updating source code to revision: 26328
simple	07-Jun-2016 07:24:44	Working directory '/dr01/bamboo/xml-data/build-dir/QRA-QRADSALESINT-BL' is empty. Checking out SVN URL 'http://subversion.qad.com/svn/qadmodule_repository/sales/trunk/build'
simple	07-Jun-2016 07:24:45	Updated source code to revision: 26328
simple	07-Jun-2016 07:24:45	Running postRetrieveSourceCode task...
simple	07-Jun-2016 07:24:45	Finished task 'Checkout Default Repository' with result: Success
simple	07-Jun-2016 07:24:45	Running pre-build action: VCS Version Collector
command	07-Jun-2016 07:24:45	Substituting variable: ${bamboo.DLC} with /qad/progress/dlc102b06
command	07-Jun-2016 07:24:45	Substituting variable: ${bamboo.DLC11} with /qad/progress/dlc113164
simple	07-Jun-2016 07:24:45	Starting task 'Build the Business Logic' of type 'com.atlassian.bamboo.plugins.ant:task.builder.ant'
command	07-Jun-2016 07:24:45	Beginning to execute external process for build 'QRA - Integration Build - Sales - Build Business Logic #3115 (QRA-QRADSALESINT-BL-3115)'\n ... running command line: \n/qad/web/server/ant-1.8.4/bin/ant -Djava.io.tmpdir=/tmp/QRA-QRADSALESINT-BL -f build.xml buildbl\n ... in: /dr01/bamboo/xml-data/build-dir/QRA-QRADSALESINT-BL\n ... using extra environment variables: \nbamboo_capability_system_jdk_JDK_1_6_32=/usr/java/jdk1.6.0_33-32\nbamboo_planRepository_2_repository_svn_username=svnuser\nbamboo_repository_revision_number=26328\nbamboo_repository_76251188_svn_repositoryUrl=http://subversion.qad.com/svn/qadmodule_repository/sales/trunk/build\nbamboo_repository_76251190_revision_number=26328\nbamboo_repository_76251190_branch_name=build\nbamboo_capability_agent_function_QRA_LinuxBuilds=true\nbamboo_buildKey=QRA-QRADSALESINT-BL\nbamboo_repository_76251190_svn_repositoryUrl=http://subversion.qad.com/svn/qadmodule_repository/sales/trunk/build\nbamboo_custom_76251188_svn_username=svnuser\nbamboo_capability_system_jdk_JDK_1_6_0_21=/usr/java/jdk1.6.0_21-32\nbamboo_custom_76251188_svn_revision_number=26328\nbamboo_repository_76251189_svn_repositoryUrl=http://subversion.qad.com/svn/qadmodule_repository/sales/trunk/build\nbamboo_shortJobName=Build Business Logic\nbamboo_svnuser_username=svnuser\nbamboo_buildResultsUrl=https://bamboo.qad.com/browse/QRA-QRADSALESINT-BL-3115\nbamboo_repository_76251188_svn_username=svnuser\nbamboo_planRepository_repositoryUrl=http://subversion.qad.com/svn/qadmodule_repository/sales/trunk\nbamboo_repository_76251187_previous_revision_number=26305\nbamboo_repository_76251189_svn_username=svnuser\nbamboo_agentId=32374786\nbamboo_repository_76251188_revision_number=26328\nbamboo_capability_system_jdk_JDK_1_8_0_45=/usr/java/jdk1.8\nbamboo_repository_76251188_previous_revision_number=26305\nbamboo_DLC=/qad/progress/dlc102b06\nbamboo_planRepository_1_repository_svn_username=svnuser\nbamboo_planRepository_revision=26328\nbamboo_planRepository_previousRevision=26325\nbamboo_repository_branch_name=trunk\nbamboo_capability_system_builder_script_Script=\nbamboo_custom_76251189_svn_revision_number=26328\nbamboo_repository_76251186_branch_name=trunk\nJAVA_HOME=/usr/java/jdk1.7\nbamboo_repository_76251186_name=Plan Repository\nbamboo_repository_76251187_branch_name=build\nbamboo_capability_HOSTNAME=COLI49\nbamboo_custom_76251186_svn_revision_number=26328\nANT_HOME=/qad/web/server/ant-1.8.4\nbamboo_capability_system_jdk_JDK_1_6_0_45=/usr/java/jdk1.6.0_45\nbamboo_devel_password=********\nbamboo_custom_76251189_svn_username=svnuser\nbamboo_custom_76251190_svn_lastchange_revision_number=25841\nbamboo_custom_76251187_svn_username=svnuser\nbamboo_planRepository_1_type=svn\nbamboo_planRepository_branchName=trunk\nbamboo_capability_system_jdk_JDK=/usr/java/jdk1.6\nbamboo_planRepository_type=svn\nbamboo_custom_svn_username=svnuser\nbamboo_planRepository_2_branchName=build\nbamboo_capability_system_builder_node_Node_js=/qad/local/bin/node-v0.12.4-linux-x64/bin/node\nbamboo_capability_system_builder_ant_Ant=/qad/web/server/ant-1.8.4\nbamboo_repository_76251189_branch_name=build\nbamboo_capability_system_builder_mvn3_Maven_3=/qad/web/server/apache-maven-3.1.1\nbamboo_repository_76251187_svn_repositoryUrl=http://subversion.qad.com/svn/qadmodule_repository/sales/trunk/build\nbamboo_planKey=QRA-QRADSALESINT\nbamboo_repository_76251188_branch_name=build\nbamboo_custom_76251187_svn_revision_number=26328\nbamboo_devel_username=devel\nbamboo_capability_long_builds=true\nbamboo_repository_76251186_revision_number=26328\nbamboo_repository_76251189_name=Build UI Repository\nbamboo_repository_76251189_revision_number=26328\nbamboo_planRepository_1_branchName=trunk\nbamboo_svnuser_password=********\nbamboo_DLC11=/qad/progress/dlc113164\nbamboo_resultsUrl=https://bamboo.qad.com/browse/QRA-QRADSALESINT-BL-3115\nbamboo_custom_svn_lastchange_revision_number=26326\nbamboo_repository_76251188_name=Build Business Logic Repository\nbamboo_repository_76251190_svn_username=svnuser\nbamboo_planRepository_1_name=Plan Repository\nbamboo_build_working_directory=/dr01/bamboo/xml-data/build-dir/QRA-QRADSALESINT-BL\nbamboo_shortPlanName=Integration Build - Sales\nbamboo_planRepository_name=Plan Repository\nbamboo_repository_76251186_previous_revision_number=26325\nbamboo_repository_svn_username=svnuser\nbamboo_repository_76251190_previous_revision_number=26305\nbamboo_buildNumber=3115\nbamboo_repository_76251186_svn_username=svnuser\nbamboo_repository_76251187_svn_username=svnuser\nbamboo_repository_76251187_name=Set Version Repository\nbamboo_capability_agent_function=DDEBuild\nbamboo_planName=QRA - Integration Build - Sales\nbamboo_shortPlanKey=QRADSALESINT\nbamboo_shortJobKey=BL\nbamboo_planRepository_2_name=Package Build Repository\nbamboo_repository_previous_revision_number=26325\nbamboo_buildTimeStamp=2016-06-07T07:24:45.548-07:00\nbamboo_capability_system_builder_mvn2_Maven_2=/dr01/maven/apache-maven-2.2.1\nbamboo_repository_76251190_name=Package Build Repository\nbamboo_capability_system_builder_ant_ANT_coli=/qad/web/server/ant-1.8.4\nbamboo_buildResultKey=QRA-QRADSALESINT-BL-3115\nbamboo_repository_76251189_previous_revision_number=26305\nbamboo_buildPlanName=QRA - Integration Build - Sales - Build Business Logic\nbamboo_capability_system_builder_ant_ANT_coli49=/usr/local/ant-1.8.1\nDLC=/qad/progress/dlc102b06\nbamboo_planRepository_1_revision=26328\nbamboo_custom_76251190_svn_username=svnuser\nbamboo_repository_name=Package Build Repository\nbamboo_planRepository_2_previousRevision=26305\nbamboo_custom_76251189_svn_lastchange_revision_number=25841\nbamboo_capability_system_builder_command_Bash=/bin/bash\nbamboo_repository_76251187_revision_number=26328\nbamboo_agentWorkingDirectory=/dr01/bamboo/xml-data/build-dir\nbamboo_planRepository_2_revision=26328\nbamboo_capability_system_git_executable=/qad/local/bin/git\nbamboo_planRepository_1_previousRevision=26325\nbamboo_repository_76251186_svn_repositoryUrl=http://subversion.qad.com/svn/qadmodule_repository/sales/trunk\nbamboo_capability_system_builder_mvn3_Maven_3_2_5=/qad/web/server/apache-maven-3.2.5\nbamboo_custom_76251186_svn_lastchange_revision_number=26326\nbamboo_custom_svn_revision_number=26328\nbamboo_planRepository_2_type=svn\nbamboo_custom_76251186_svn_username=svnuser\nbamboo_custom_76251187_svn_lastchange_revision_number=25841\nbamboo_planRepository_2_repositoryUrl=http://subversion.qad.com/svn/qadmodule_repository/sales/trunk/build\nbamboo_capability_NAME=coli49Two\nbamboo_working_directory=/dr01/bamboo/xml-data/build-dir/QRA-QRADSALESINT-BL\nbamboo_custom_76251190_svn_revision_number=26328\nbamboo_planRepository_repository_svn_username=svnuser\nbamboo_planRepository_1_repositoryUrl=http://subversion.qad.com/svn/qadmodule_repository/sales/trunk\nbamboo_capability_system_jdk_JDK_1_8=/usr/java/jdk1.8\nbamboo_custom_76251188_svn_lastchange_revision_number=25841\nbamboo_capability_system_jdk_JDK_1_6=/usr/java/jdk1.6\nbamboo_repository_svn_repositoryUrl=http://subversion.qad.com/svn/qadmodule_repository/sales/trunk\nDLC11=/qad/progress/dlc113164\nbamboo_capability_system_jdk_JDK_1_7=/usr/java/jdk1.7\nPATH=/usr/java/jdk1.7/bin:/usr/java/jdk1.8/bin:/bin/posix:/bin:/usr/bin:/usr/local/bin:/usr/contrib/bin:/usr/bin/X11:/usr/sbin:/usr/local/mysql/bin:/qad/local/bin:/qad/local/scripts\n
build	07-Jun-2016 07:24:45	Buildfile: /dr01/bamboo/xml-data/build-dir/QRA-QRADSALESINT-BL/build.xml
build	07-Jun-2016 07:24:45	      [get] Destination already exists (skipping): /tmp/devel/get-libs.xml
David_Ren June 7, 2016

It seems that at the beginning of the build, the java io tmp is not passed correctly.

Is there document that how bamboo uses the jvm? Or how to do the correct pass?

0 votes
David_Ren June 7, 2016

Hi @Peter, I'm not sure what the target name is correspondent to fork. But the top level build.xml do import other build.xml and call the target in there.  

Besides, I find the even in the top level build.xml, the java.io.tmpdir is not correct.

0 votes
Peter Harsfalvi June 7, 2016

This usually happens when the parent jvm forks into a separate jvm, and the system properties are not passed over. Please check the build.xml. Does it fork the build process? The solution is to pass the system property to the child jvm as well.

0 votes
David_Ren June 7, 2016

For further information:

Build.xml has this

coli49:92 /qad/local/90day_backups/user/dr2/bamboo-test-qra-sales-int $ grep -irn "java\.io\.tmpdir" *
build.xml:30:    <mkdir dir="${java.io.tmpdir}/${user.name}"/>
build.xml:34:        dest="${java.io.tmpdir}/${user.name}/get-libs.xml"
build.xml:38:    <include file="${java.io.tmpdir}/${user.name}/get-libs.xml"/>

Build log shows, as devel is for user.name:

build	07-Jun-2016 22:14:02	    [mkdir] Skipping /tmp/devel because it already exists.
build	07-Jun-2016 22:14:02	      [get] Destination already exists (skipping): /tmp/devel/get-libs.xml
build	07-Jun-2016 22:14:02	Importing file /tmp/devel/get-libs.xml from /dr01/bamboo/xml-data/build-dir/BAMTST-IBST-BL/build.xml

I also find this, not sure if is related. But my build is not a maven build.

https://jira.atlassian.com/browse/BAM-14416

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events