Error: Unrecognized command line arguments: API-XXXXXX
(where API-XXXXXX is a valid API key)
It doesn’t always fail, but consistently does 2/3 of the time.
Failure doesn’t show up in the status of the Powershell.DSC extension in the Azure Portal. Azure Extensions Status infor shows:
[
{
“name”: null,
“status”: “Ready”,
“message”: null,
“code”: null,
“operation”: null
},
{
“name”: null,
“status”: “Success”,
“message”: “DSC configuration was applied successfully.”,
“code”: 2,
“operation”: null
}
]
We’re not sure why this would fail and it seems to work consistently for us. The first error suggests that maybe the arguments aren’t being escaped properly, or perhaps some extra spaces somewhere. Are you using the same registration details on every machine? Do you know if there are any differences between the VM’s it fails on and the ones it succeeds on? Were there any other details in the logs on the VM? This page has a section at the bottom on finding the logs:
Finally had a few minutes to look into this again, and seeing the same issue.
The VMs are identical in every way but the machine name, and IP address. I am building them from a single powershell script that builds 3 machines in a row. The last time I ran the script (just a few minutes ago), 1 of them succeeded, and 2 failed.
To get around the issue, I have been just deleting the machines that fail and commenting out the ones that work in the script, until I have all the machines built and added to octopus.
I have pulled the log file from one of the failing machines and attached them (after scrubbing for sensitive data).
OK I think I see the issue. It looks like at times its not able to get the public IP address every time. I just did a comparison between a successful and a failed DcsExtensionHandler.* file.
The successful one shows (around line 91 or so):
Public IP address: XX.XX.XX.XX
Where the failure one shows:
Public IP address:
This will not be a problem for me once this issue is resolved:
And this pull request is merged (and what ever build process is completed):