-
Bug
-
Resolution: Fixed
-
Medium
-
5.6.0
-
None
During the specification of the build task we can specify something of the nature:
/t:Release /p:BuildVersion="1.0.0.${bamboo.buildNumber}" /p:ProductsToRelease="JIRA;Bamboo;Fisheye"
During execution of the task, Bamboo takes off the quotes around the property value which cause the build to fail because the semicolon in this case are used as property separator and hence the remaining part will be an invalid expression as reproetd in the microsoft KB article at http://msdn.microsoft.com/en-us/library/xx2ke5d2%28v=vs.80%29.aspx. Here is a sample of the build log:
MSBUILD : error MSB1006: Property is not valid.
If the quotes were not removed, all the three options will be considered as values of the property ProductsToRelease
- is duplicated by
-
BAM-14659 MSBuild task keep failing with error "MSBUILD : error MSB1008: Only one project can be specified."
-
- Closed
-
-
BAM-13608 "Options" input box for MSBuild Task of Bamboo cannot handle parameters with multiple values which contain space symbol
-
- Closed
-
- is related to
-
BAM-14659 MSBuild task keep failing with error "MSBUILD : error MSB1008: Only one project can be specified."
-
- Closed
-
- relates to
-
BAM-15879 MSBUILD throws "Only one project can be specified" if there is a space in the directory
-
- Closed
-
-
BDEV-6911 Failed to load
-
BDEV-8861 Loading...
- was cloned as
-
BDEV-5798 Loading...
[BAM-11561] Auto removal of quotes from MSBuild options resulting in errors
We've just encountered the same issue that David mentioned (we use proj files too) after upgrading from 5.6.2 to 5.8.1. Any word on a fix for this?
I upgraded Bamboo to v5.8.0 from v5.3.3 on 17 March 2015. I have only just found that I have a number of builds that now fail with MSB1008: Only one project can be specified. Many of these builds have requirements rather more complex that simply building a .sln file so we use MSBuild targets files frequently. The circumstances described in this issue and in the comments implies that it is triggered when passing an MSBuild parameter with a space in it in the {{Options }} field of the job.
What we have found is that the path to the Project File field of the job is also affected. If this field also contains a path, none of the directories in that path can contain a space.
The only option for us was to rename any directories in any paths to targets files that contained spaces. This was unfortunate because there were many and all were under source control which meant wholesale copying, renaming and deleting of numerous paths.
james.sweeney ATM it looks like Bamboo is trying to create response file in some special Windows directory and it might be not available to another process. Please make sure your remote agent on Windows has properly set java.io.tmpdir property (ie. you can configure it to agent-home/tmp directory). You can confgure this property using conf/wrapper.conf file in agent-home directory (search for wrapper.java.additional. option)
I'm stuck between a rock and a hard place on this one. Running 5.7.2, specifying bamboo.plugin.dotnet.msbuild.useResponseFile=true results in "MSBUILD : error MSB1022: Response file does not exist" while setting it false gives us the quoting error. We're only running .net on remote agents, so I've got no idea if this work on local agents, as the local machine is running CentOS. Time to file a support ticket i guess.
@Esther Asenjo
Is there a fix for this issue in 5.7.x at this time?
Is there updated documentation you can point me to?
Hi markgillespie,
Sorry to hear you are having issues with this task. There has been a significant amount of work on it, and a result of this we deal with the parameters in a different way in 5.7. We're working in updating the documentation to reflect this, covering pre 5.5, 5.6 and 5.7 itself. It will be available by next week. I will update this issue, and track down that this actually solves your problems.
Sorry for any inconveniences again! We're working on fixing it.
Cheers,
Esther
Not working for us. I also wish Atlassian were consistent with their documentation. We use Windows Service, and I guess I am assuming correct, that I need to set this as such:
tomcat7w.exe //ES//Bamboo
Java tab,
To clear up the confusion
MSBuild task in Bamboo 5.6.0 provides workaround for the argument parsing problems in form of optional use of msbuild's response file. In order to activate this workaround one needs to set
bamboo.plugin.dotnet.msbuild.useResponseFile system property to true on all agents (and on Bamboo server if you use local agents).
Remote agents.
If you're starting agent manually you simply provide -Dbamboo.plugin.dotnet.msbuild.useResponseFile=true on the command line. If your agent is run as a service then make a change in the $BAMBOO_AGENT_HOME/conf/wrapper.conf configuration file:
# The Bamboo Agent home configuration file wrapper.java.additional.1=-Dbamboo.home=/home/bamboo/bamboo-agent-home wrapper.java.additional.2=-Dbamboo.agent.ignoreServerCertName=false wrapper.java.additional.3=-Dbamboo.plugin.dotnet.msbuild.useResponseFile=true
Bamboo server
- stop Bamboo
- add -Dbamboo.plugin.dotnet.msbuild.useResponseFile=true to JVM_REQUIRED_ARGS in $BAMBOO_INSTALL/bin/setenv.sh
- start Bamboo
Please leave a comment if that helped.
It still doesn't work for me.
I'm running Bamboo OnDemand 5.6 (Version: 5.6-OD-01-0070; Build number: 4409).
My MSBuild task config is:
Executable: MSBuild v4.0 (32bit) Project File: ERP.sln Options: /p:Configuration=${bamboo.buildConfiguration} /p:Platform=${bamboo.buildPlatform}
The buildPlatform variable is specified with quotes, like this:
"Any CPU"
Log output from the task (still failing):
command 06-Aug-2014 09:39:03 Substituting variable: ${bamboo.buildConfiguration} with Debug command 06-Aug-2014 09:39:03 Substituting variable: ${bamboo.buildPlatform} with "Any CPU" simple 06-Aug-2014 09:39:03 Starting task 'Build ERP.sln' of type 'com.atlassian.bamboo.plugin.dotnet:msbuild' command 06-Aug-2014 09:39:03 Beginning to execute external process for build 'ERP Lead Management - ERP-QA - Build QA branch #8 (ERPLEADS-ERPQA-JOB1-8)'\n ... running command line: \nC:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /p:Configuration=Debug /p:Platform="Any CPU" ERP.sln\n ... in: C:\build-dir\ERPLEADS-ERPQA-JOB1\ERPServices\n ... using extra environment variables:\nbamboo_buildPlatform="Any CPU"\n build 06-Aug-2014 09:39:07 Microsoft (R) Build Engine Version 4.0.30319.1 build 06-Aug-2014 09:39:07 [Microsoft .NET Framework, Version 4.0.30319.269] build 06-Aug-2014 09:39:07 Copyright (C) Microsoft Corporation 2007. All rights reserved. build 06-Aug-2014 09:39:07 build 06-Aug-2014 09:39:07 MSBUILD : error MSB1008: Only one project can be specified. build 06-Aug-2014 09:39:07 Switch: ERP.sln build 06-Aug-2014 09:39:07 build 06-Aug-2014 09:39:07 For switch syntax, type "MSBuild /help" simple 06-Aug-2014 09:39:07 Failing task since return code of [C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /p:Configuration=Debug /p:Platform="Any CPU" ERP.sln] was 1 while expected 0 simple 06-Aug-2014 09:39:07 Finished task 'Build ERP.sln' with result: Failed
My workaround has been to run the following command from a Script task:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe ERP.sln /p:Configuration=${bamboo.buildConfiguration} /p:Platform=${bamboo.buildPlatform}
This works, but I would like use the MSBuild task going forward.
How do I get this to work?
Mitch
Thanks for the reply. It is expected that it doesn't work so I don't need any proof for that
I am sorry. I misquoted. I have to use "Dev Server" on the command line with the quotes or it fails with the "one project" error. I've initialized bamboo remote agent service using the wrapper.conf change you specified. I need to reconfigure my project to have the space again to test it all out, but I'm a bit hesitant to do it since it doesn't gain me anything and the system works fine without the space. (We use CI with stash, tickets, etc so i have to go through quite a lot of rigamarole to change it back)
If you really need me to test it, let me know and I will.
Yes, that string above works from the command line on the build agent. I don't need to use the quotes.
What shell are you using? Can I see the screenshot of this operation? Can I see logs of this operation with additional options /clp:ShowCommandLine /v:diag?
If you're starting agent manually you simply provide -Dbamboo.plugin.dotnet.msbuild.useResponseFile=true on the command line. If your agent is run as a service then make a change in the $BAMBOO_AGENT_HOME/conf/wrapper.conf configuration file:
# The Bamboo Agent home configuration file wrapper.java.additional.1=-Dbamboo.home=/home/bamboo/bamboo-agent-home wrapper.java.additional.2=-Dbamboo.agent.ignoreServerCertName=false wrapper.java.additional.3=-Dbamboo.plugin.dotnet.msbuild.useResponseFile=true
I just noticed your response above about not being sure what I meant. Yes, that string above works from the command line on the build agent. I don't need to use the quotes. Still not sure what to change on the build agent.
We are having a bit of trouble figuring out which file on the build agent to change.
Mitch
I'm not sure if your comment means that you were able to use that option string in any previous version of bamboo-dotnet-plugin. I don't think it was ever possible. Are you able to use the following options from command line?
msbuild.exe /T:Build /p:DeployOnBuild=True /p:PublishProfile=Dev Server
I think it can't work, you need to quote property values which contain spaces otherwise you'll get an error.
msbuild.exe /T:Build /p:DeployOnBuild=True /p:PublishProfile="Dev Server"
I've also updated the above instructions in case of using remote agents.
Changing my environment so that I could use
/T:Build /p:DeployOnBuild=True /p:PublishProfile=DevServer
has bandaid-fixed the problem for now, but the space bug still exists.
There is no edit comment. I would like to add that our build options are
/T:Build /p:DeployOnBuild=True /p:PublishProfile=Dev Server
They have worked until our latest upgrade to Bamboo version 5.5.1 build 4306 - 21 May 14
We are experiencing the exact same problem. I am attempting to test the 5.6.x fix as well, so far no luck.
Rainer
Please download most recent version of the plugin from https://bitbucket.org/atlassian/bamboo-dotnet-plugin/downloads. In order to install it into Bamboo please do the following
- stop Bamboo
- backup existing atlassian-bamboo-plugin-dotnet from $BAMBOO_INSTALL/atlassian-bamboo/WEB-INF/lib and remove it
- copy downloaded atlassian-bamboo-plugin-dotnet to $BAMBOO_INSTALL/atlassian-bamboo/WEB-INF/lib
- add -Dbamboo.plugin.dotnet.msbuild.useResponseFile=true to JVM_REQUIRED_ARGS in $BAMBOO_INSTALL/bin/setenv.sh
- start Bamboo
Edit:
In case of using remote agents make sure you set property bamboo.plugin.dotnet.msbuild.useResponseFile for remote agents as well.
Please let me know if it worked for you
We were upgrading from Bamboo 5.4.1 to Bamboo 5.5.1. The described bug may have been introduced in any version between.
Sure, I add the interesting lines of the build logs in question.
Build #314 (before upgrading to 5.5.1):
... simple 23-May-2014 21:54:40 Finished task 'Build building addon' command 23-May-2014 21:54:40 Substituting variable: ${bamboo.capability.WiX 3.7} with "C:\Program Files (x86)\WiX Toolset v3.7\" command 23-May-2014 21:54:40 Substituting variable: ${bamboo.capability.Qt 4.8.5} with C:\Development\Qt\Qt485_VS2010_64bit command 23-May-2014 21:54:40 Substituting variable: ${bamboo.capability.Qt 4.8.5} with C:\Development\Qt\Qt485_VS2010_64bit simple 23-May-2014 21:54:40 Starting task 'Build setup extensions' of type 'com.atlassian.bamboo.plugin.dotnet:msbuild' command 23-May-2014 21:54:40 Beginning to execute external process for build 'Inpho Software - Inpho Trunk - Build software and package it #314 (IS-IMAIN-JOB1-314)'\n ... running command line: \nC:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /m /t:Rebuild /p:Configuration=Release;Platform=Any CPU /clp:NoItemAndPropertyList;ErrorsOnly;ShowTimestamp setup\extension\build\setup_extension.sln\n ... in: C:\Development\bamboo\xml-data\build-dir\IS-IMAIN-JOB1\source\n ... using extra environment variables: \nWIX=C:\Program Files (x86)\WiX Toolset v3.7\\nbamboo_ISPatch=0\nbamboo_ISMinor=0\nQTDIR=C:\Development\Qt\Qt485_VS2010_64bit\nbamboo_ISMajor=0\nbamboo_DistributionDirectory=D:\htdocs\Software\IS\IS-trunk-latest\nPath=C:\Development\Qt\Qt485_VS2010_64bit\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin\n build 23-May-2014 21:54:40 Microsoft (R) Build Engine version 4.0.30319.18408 build 23-May-2014 21:54:40 [Microsoft .NET Framework, version 4.0.30319.18444] build 23-May-2014 21:54:40 Copyright (C) Microsoft Corporation. All rights reserved. build 23-May-2014 21:54:40 simple 23-May-2014 21:54:41 Finished task 'Build setup extensions' ...
Build #315 (right after upgrading):
... simple 26-May-2014 21:36:25 Finished task 'Build building addon' command 26-May-2014 21:36:25 Substituting variable: ${bamboo.capability.WiX 3.7} with "C:\Program Files (x86)\WiX Toolset v3.7\" command 26-May-2014 21:36:25 Substituting variable: ${bamboo.capability.Qt 4.8.5} with C:\Development\Qt\Qt485_VS2010_64bit command 26-May-2014 21:36:25 Substituting variable: ${bamboo.capability.Qt 4.8.5} with C:\Development\Qt\Qt485_VS2010_64bit simple 26-May-2014 21:36:25 Starting task 'Build setup extensions' of type 'com.atlassian.bamboo.plugin.dotnet:msbuild' command 26-May-2014 21:36:25 Beginning to execute external process for build 'Inpho Software - Inpho Trunk - Build software and package it #315 (IS-IMAIN-JOB1-315)'\n ... running command line: \nC:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /m /t:Rebuild /p:Configuration=Release;Platform="Any CPU" /clp:NoItemAndPropertyList;ErrorsOnly;ShowTimestamp setup\extension\build\setup_extension.sln\n ... in: C:\Development\bamboo\xml-data\build-dir\IS-IMAIN-JOB1\source\n ... using extra environment variables: \nWIX=C:\Program Files (x86)\WiX Toolset v3.7\\nbamboo_ISPatch=0\nbamboo_ISMinor=0\nQTDIR=C:\Development\Qt\Qt485_VS2010_64bit\nbamboo_ISMajor=0\nbamboo_DistributionDirectory=D:\htdocs\Software\IS\IS-trunk-latest\nPath=C:\Development\Qt\Qt485_VS2010_64bit\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin\n build 26-May-2014 21:36:25 Microsoft (R) Build Engine version 4.0.30319.18408 build 26-May-2014 21:36:25 [Microsoft .NET Framework, version 4.0.30319.18444] build 26-May-2014 21:36:25 Copyright (C) Microsoft Corporation. All rights reserved. build 26-May-2014 21:36:25 build 26-May-2014 21:36:25 MSBUILD : error MSB1008: Only one project can be specified. build 26-May-2014 21:36:25 Switch: setup\extension\build\setup_extension.sln build 26-May-2014 21:36:25 build 26-May-2014 21:36:25 For switch syntax, type "MSBuild /help" simple 26-May-2014 21:36:25 Failing task since return code of [C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /m /t:Rebuild /p:Configuration=Release;Platform="Any CPU" /clp:NoItemAndPropertyList;ErrorsOnly;ShowTimestamp setup\extension\build\setup_extension.sln] was 1 while expected 0 simple 26-May-2014 21:36:25 Finished task 'Build setup extensions' ...
Build #316 (with the msbuild.rsp fix):
... simple 27-May-2014 10:02:24 Finished task 'Build building addon' simple 27-May-2014 10:02:24 Starting task 'Create MSBuild Option string (Bamboo 5.5.1 workaround)' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script' command 27-May-2014 10:02:24 Beginning to execute external process for build 'Inpho Software - Inpho Trunk - Build software and package it #316 (IS-IMAIN-JOB1-316)'\n ... running command line: \nC:\Users\bob\AppData\Local\Temp\IS-IMAIN-JOB1-316-ScriptBuildTask-3064587793140893624.bat\n ... in: C:\Development\bamboo\xml-data\build-dir\IS-IMAIN-JOB1\source\setup\extension\build\n ... using extra environment variables: \nbamboo_ISPatch=0\nbamboo_ISMinor=0\nbamboo_ISMajor=0\nbamboo_DistributionDirectory=D:\htdocs\Software\IS\IS-trunk-latest\n simple 27-May-2014 10:02:24 Finished task 'Create MSBuild Option string (Bamboo 5.5.1 workaround)' command 27-May-2014 10:02:24 Substituting variable: ${bamboo.capability.WiX 3.7} with "C:\Program Files (x86)\WiX Toolset v3.7\" command 27-May-2014 10:02:24 Substituting variable: ${bamboo.capability.Qt 4.8.5} with C:\Development\Qt\Qt485_VS2010_64bit command 27-May-2014 10:02:24 Substituting variable: ${bamboo.capability.Qt 4.8.5} with C:\Development\Qt\Qt485_VS2010_64bit simple 27-May-2014 10:02:24 Starting task 'Build setup extensions' of type 'com.atlassian.bamboo.plugin.dotnet:msbuild' command 27-May-2014 10:02:24 Beginning to execute external process for build 'Inpho Software - Inpho Trunk - Build software and package it #316 (IS-IMAIN-JOB1-316)'\n ... running command line: \nC:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe setup\extension\build\setup_extension.sln\n ... in: C:\Development\bamboo\xml-data\build-dir\IS-IMAIN-JOB1\source\n ... using extra environment variables: \nWIX=C:\Program Files (x86)\WiX Toolset v3.7\\nbamboo_ISPatch=0\nbamboo_ISMinor=0\nQTDIR=C:\Development\Qt\Qt485_VS2010_64bit\nbamboo_ISMajor=0\nbamboo_DistributionDirectory=D:\htdocs\Software\IS\IS-trunk-latest\nPath=C:\Development\Qt\Qt485_VS2010_64bit\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin\n build 27-May-2014 10:02:24 Microsoft (R) Build Engine version 4.0.30319.18408 build 27-May-2014 10:02:24 [Microsoft .NET Framework, version 4.0.30319.18444] build 27-May-2014 10:02:24 Copyright (C) Microsoft Corporation. All rights reserved. build 27-May-2014 10:02:24 simple 27-May-2014 10:02:25 Finished task 'Build setup extensions' ...
The problem is the "Any CPU" platform specifier that is handled different in Bamboo 5.5.1.
Rainer, Philip
Can you please attach build logs from the failing build? It would be great if I could see build log from the successful plan execution with pre-5.5 Bamboo.
With Bamboo 5.5.1 this also happens for MSBuild Options like
/p:Configuration="Any CPU";Platform=x64;...
In this case, the "quoted quotes" workaround does not work.
A workaround we found is to place all the options as a single line in a msbuild.rsp file in the directory where the build solution or project resides and run the MSBuild task with empty Options.
You could try to quote quotes in your parameters to preserve them (using single quotes).
So, instead of
/p:ProductsToRelease="JIRA;Bamboo;Fisheye"
use
/p:ProductsToRelease='"'JIRA;Bamboo;Fisheye'"'
This workaround
May work for MSBuild, but it doesn't work for MSDeploy at all. (We have it installed as a Command executable)