Unable to configure agent service when --windowsLogonPassword value starts with "-" or contains "^" symbol

See original GitHub issue

Agent 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:closed
  • Created 4 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
smartmetacommented, Jun 10, 2020

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?

1reaction
jtpettycommented, Mar 6, 2020

This should be fixed by #2812 and will be in the next release of the agent

Read more comments on GitHub >

github_iconTop Results From Across the Web

Self-hosted Windows agents - Azure Pipelines
This article describes how to configure a self-hosted agent. If you're using Azure DevOps Services and a Microsoft-hosted agent meets your ...
Read more >
Unable to make Azure Agent Service run as my self
1 Answer. Change the logon user on DevOps agent services won't work. If you'd like to run the agent with specific account, you...
Read more >
Azure DevOps Agent won't start and shows: Error 1 ...
I changed my user to Local System (NT AUTHORITY\SYSTEM) in services.msc and it worked as intended. Azure Pipelines Agent Service.
Read more >
Configure your Azure DevOps agents to run in ...
Finally, execute the command ./run.sh to connect to the server and begin executing queued jobs. Since containers are stateless and all data that ......
Read more >
Use the ServiceNow DevOps extension for Azure DevOps
Install and configure DevOps extension for Azure DevOps to send build and release notifications from your Azure pipeline to ServiceNow DevOps application.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found