Unable to configure agent service when --windowsLogonPassword value starts with "-" or contains "^" symbol
See original GitHub issueAgent Version and Platform
2.164.6 Windows
Azure DevOps Type and Version
dev.azure.com
What’s not working?
Unable to configure agent service when --windowsLogonPassword value starts with “-” or contains “^” symbol.
Example “-”
$password = “-bMBd9oVyEY1SJRJog8j”
.\config.cmd --unattended --url $url --auth pat --token $token --pool $pool --agent $agent --runAsService --windowsLogonAccount $user --windowsLogonPassword $password --replace
[2020-01-28 02:13:37Z ERR Agent] System.Exception: Invalid configuration provided for windowslogonpassword. Terminating unattended configuration.
at Microsoft.VisualStudio.Services.Agent.Listener.Configuration.PromptManager.ReadValue(String argName, String description, Boolean secret, String defaultValue, Func`2 validator, Boolean unattended)
at Microsoft.VisualStudio.Services.Agent.Listener.CommandSettings.GetArgOrPrompt(String name, String description, String defaultValue, Func`2 validator)
at Microsoft.VisualStudio.Services.Agent.Listener.CommandSettings.GetWindowsLogonPassword(String accountName)
at Microsoft.VisualStudio.Services.Agent.Listener.Configuration.WindowsServiceControlManager.ConfigureService(AgentSettings settings, CommandSettings command)
at Microsoft.VisualStudio.Services.Agent.Listener.Configuration.ConfigurationManager.ConfigureAsync(CommandSettings command)
at Microsoft.VisualStudio.Services.Agent.Listener.Agent.ExecuteCommand(CommandSettings command)
[2020-01-28 02:13:37Z ERR Terminal] WRITE ERROR: Invalid configuration provided for windowslogonpassword. Terminating unattended configuration.
This might be happening due to a parser logic. https://github.com/microsoft/azure-pipelines-agent/blob/c6f06f9decfddadcea8d8e54eb371cfb35fcd7c8/src/Microsoft.VisualStudio.Services.Agent/CommandLineParser.cs#L73-L105
Example “^”
$password = “b^MBd9oVyEY1SJRJog8j”
.\config.cmd --unattended --url $url --auth pat --token $token --pool $pool --agent $agent --runAsService --windowsLogonAccount $user --windowsLogonPassword $password --replace
[2020-01-28 02:16:43Z ERR Agent] System.Security.SecurityException: Invalid windows credentials entered. Try again or ctrl-c to quit
at Microsoft.VisualStudio.Services.Agent.Listener.Configuration.WindowsServiceControlManager.ConfigureService(AgentSettings settings, CommandSettings command)
at Microsoft.VisualStudio.Services.Agent.Listener.Configuration.ConfigurationManager.ConfigureAsync(CommandSettings command)
at Microsoft.VisualStudio.Services.Agent.Listener.Agent.ExecuteCommand(CommandSettings command)
[2020-01-28 02:16:43Z ERR Terminal] WRITE ERROR: Invalid windows credentials entered. Try again or ctrl-c to quit
With this one, I am not sure where it might be failing.
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (4 by maintainers)
Top Related StackOverflow Question
I set the env var VSTS_AGENT_INPUT_WINDOWSLOGONPASSWORD but then my powershell script containing the config.cmd in a Invoke always complains … An error occurred: MissingValueOptionError …
Where is documented that VSTS_AGENT_INPUT_WINDOWSLOGONPASSWORD can be used instead of setting it by --windowsLogonPassword?
This should be fixed by #2812 and will be in the next release of the agent