TFS 2017 UPD3 on premise
agent version 2.111.1 and 2.122.1
Running on Ubuntu 14.04
TFS2015 UPD1 on premise migrated to TFS 2017 UPD3 on premise
Linux agent removes double quotes from CmdLine build tasks arguments.
This appears with agent version 2.111.1 (the former one we used) or latest 2.122.1 (we tried both).
This was not the case against a TFS2015 UPD1 instance; The side effect is that former CmdLine calls with double quotes in all our builds are now failing because of missing quotes.
As an example, we call the "cat" with two arguments a and b.
Here is the output with a TFS2015 UPD1 server, agent 2.111.1:
2018-03-23T10:16:22.2818850Z ==============================================================================
2018-03-23T10:16:22.2820540Z Task : Command Line
2018-03-23T10:16:22.2822070Z Description : Run a command line with arguments
2018-03-23T10:16:22.2823570Z Version : 1.0.12
2018-03-23T10:16:22.2825020Z Author : Microsoft Corporation
2018-03-23T10:16:22.2826500Z Help : [More Information](http://go.microsoft.com/fwlink/?LinkID=613735)
2018-03-23T10:16:22.2828040Z ==============================================================================
2018-03-23T10:16:23.0449210Z /bin/cat failed with return code: 1
2018-03-23T10:16:23.0484010Z ##[debug]filename=cat
2018-03-23T10:16:23.0514400Z Return code: 1
2018-03-23T10:16:23.0516270Z ##[debug]check path : /bin/cat
2018-03-23T10:16:23.0517800Z ##[debug]cat=/bin/cat
2018-03-23T10:16:23.0519380Z ##[debug]arguments=a "b"
2018-03-23T10:16:23.0521000Z ##[debug]workingFolder=/var/lib/vsoagent6/agent/_work/28/s
2018-03-23T10:16:23.0522610Z ##[debug]failOnStandardError=false
2018-03-23T10:16:23.0524060Z [command]/bin/cat a "b" <=========== as expected
and on TFS2017 with agent 2.122.1:
2018-03-23T10:33:47.7298080Z ##[section]Starting: Run cat
2018-03-23T10:33:47.7525320Z ==============================================================================
2018-03-23T10:33:47.7534760Z Task : Command Line
2018-03-23T10:33:47.7543970Z Description : Run a command line with arguments
2018-03-23T10:33:47.7553160Z Version : 1.1.3
2018-03-23T10:33:47.7562850Z Author : Microsoft Corporation
2018-03-23T10:33:47.7572630Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613735)
2018-03-23T10:33:47.7582610Z ==============================================================================
2018-03-23T10:33:47.9980960Z ##[debug]agent.workFolder=/var/lib/vsoagent8/agent/_work
2018-03-23T10:33:47.9997300Z ##[debug]loading inputs and endpoints
2018-03-23T10:33:48.0012760Z ##[debug]loading INPUT_FILENAME
2018-03-23T10:33:48.0028370Z ##[debug]loading INPUT_ARGUMENTS
2018-03-23T10:33:48.0042790Z ##[debug]loading INPUT_WORKINGFOLDER
2018-03-23T10:33:48.0056880Z ##[debug]loading INPUT_FAILONSTANDARDERROR
2018-03-23T10:33:48.0072270Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2018-03-23T10:33:48.0087090Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2018-03-23T10:33:48.0101740Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2018-03-23T10:33:48.0116790Z ##[debug]loaded 7
2018-03-23T10:33:48.0131190Z ##[debug]check path : /var/lib/vsoagent8/agent/_work/_tasks/CmdLine_d9bafed4-0b18-4f58-968d-86655b4d2ce9/1.1.3/task.json
2018-03-23T10:33:48.0146320Z ##[debug]set resource file to: /var/lib/vsoagent8/agent/_work/_tasks/CmdLine_d9bafed4-0b18-4f58-968d-86655b4d2ce9/1.1.3/task.json
2018-03-23T10:33:48.0160870Z ##[debug]system.culture=en-US
2018-03-23T10:33:48.0175640Z ##[debug]filename=cat
2018-03-23T10:33:48.0190410Z ##[debug]check path : /bin/cat
2018-03-23T10:33:48.0204510Z ##[debug]cat=/bin/cat
2018-03-23T10:33:48.0218950Z ##[debug]workingFolder=/var/lib/vsoagent8/agent/_work/2/s
2018-03-23T10:33:48.0233410Z ##[debug]testing directory '/var/lib/vsoagent8/agent/_work/2/s'
2018-03-23T10:33:48.0247390Z ##[debug]arguments=a "b"
2018-03-23T10:33:48.0261300Z ##[debug]/bin/cat arg: a "b"
2018-03-23T10:33:48.0275140Z ##[debug]failOnStandardError=false
2018-03-23T10:33:48.0289950Z ##[debug]exec tool: /bin/cat
2018-03-23T10:33:48.0304110Z ##[debug]Arguments:
2018-03-23T10:33:48.0318030Z ##[debug] a
2018-03-23T10:33:48.0333690Z ##[debug] b <===== quotation removed
2018-03-23T10:33:48.0343230Z [command]/bin/cat a b <===== quotation removed
Escaping with "\" gives a mixed result:
Tool: cat
Arguments: a \"b\"
will give:
018-03-23T10:33:48.1354200Z ==============================================================================
2018-03-23T10:33:48.1363510Z Task : Command Line
2018-03-23T10:33:48.1372380Z Description : Run a command line with arguments
2018-03-23T10:33:48.1381430Z Version : 1.1.3
2018-03-23T10:33:48.1390330Z Author : Microsoft Corporation
2018-03-23T10:33:48.1399330Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613735)
2018-03-23T10:33:48.1408440Z ==============================================================================
2018-03-23T10:33:48.3186630Z ##[debug]agent.workFolder=/var/lib/vsoagent8/agent/_work
2018-03-23T10:33:48.3210040Z ##[debug]loading inputs and endpoints
2018-03-23T10:33:48.3224040Z ##[debug]loading INPUT_FILENAME
2018-03-23T10:33:48.3237640Z ##[debug]loading INPUT_ARGUMENTS
2018-03-23T10:33:48.3251390Z ##[debug]loading INPUT_WORKINGFOLDER
2018-03-23T10:33:48.3265180Z ##[debug]loading INPUT_FAILONSTANDARDERROR
2018-03-23T10:33:48.3278840Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2018-03-23T10:33:48.3294510Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2018-03-23T10:33:48.3312470Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2018-03-23T10:33:48.3346010Z ##[debug]loaded 7
2018-03-23T10:33:48.3388590Z ##[debug]check path : /var/lib/vsoagent8/agent/_work/_tasks/CmdLine_d9bafed4-0b18-4f58-968d-86655b4d2ce9/1.1.3/task.json
2018-03-23T10:33:48.3403570Z ##[debug]set resource file to: /var/lib/vsoagent8/agent/_work/_tasks/CmdLine_d9bafed4-0b18-4f58-968d-86655b4d2ce9/1.1.3/task.json
2018-03-23T10:33:48.3418240Z ##[debug]system.culture=en-US
2018-03-23T10:33:48.3433060Z ##[debug]filename=cat
2018-03-23T10:33:48.3448040Z ##[debug]check path : /bin/cat
2018-03-23T10:33:48.3466110Z ##[debug]cat=/bin/cat
2018-03-23T10:33:48.3480360Z ##[debug]workingFolder=/var/lib/vsoagent8/agent/_work/2/s
2018-03-23T10:33:48.3499160Z ##[debug]testing directory '/var/lib/vsoagent8/agent/_work/2/s'
2018-03-23T10:33:48.3513960Z ##[debug]arguments=a \"b\" <========
2018-03-23T10:33:48.3527790Z ##[debug]/bin/cat arg: a \"b\" <========
2018-03-23T10:33:48.3545270Z ##[debug]failOnStandardError=false
2018-03-23T10:33:48.3559420Z ##[debug]exec tool: /bin/cat
2018-03-23T10:33:48.3573510Z ##[debug]Arguments:
2018-03-23T10:33:48.3594970Z ##[debug] a
2018-03-23T10:33:48.3609750Z ##[debug] \b" <===== mixed result
2018-03-23T10:33:48.3619430Z [command]/bin/cat a \b" <===== mixed result
This issue was initially tracked here:
https://github.com/Microsoft/vsts-agent/issues/1468
backslash is for escaping double quotes inside of double quotes.
If you just want to pass a b then pass a b
If you want to pass pass a and the literal value "b" then you should be able to typed a "\"b\"" in the input box.
Can you specify the real world example of what you're getting blocked with outside of the abstract a b example?
closing pending question above
Most helpful comment
backslash is for escaping double quotes inside of double quotes.
If you just want to pass a b then pass a b
If you want to pass pass a and the literal value "b" then you should be able to typed a "\"b\"" in the input box.
Can you specify the real world example of what you're getting blocked with outside of the abstract a b example?