Fails with this error:
Exception calling “GetResponse” with “0” argument(s): "The remote server returned an error: (401) Unauthorized."
At C:\Octopus\Work\20160610000305-12\Script.ps1:39 char:1
- [System.Net.WebResponse] $resp = $webRequest.GetResponse()
+ CategoryInfo : NotSpecified: ( , ParentContainsErrorRecordException
+ FullyQualifiedErrorId : WebException
The step failed: The remote script failed with exit code 1
This is posting to an internal hipchat server, running from the Octopus server (not a target machine).
I’m sorry to hear you’re having issues integrating with HipChat.
I assume you’re using the HipChat - Notify step template from our community library.
Looking at that script, it seems it passes HipChat an API token from the Octopus variable
$apitoken = $OctopusParameters['AuthToken']
From your error message, it would seem HipChat doesn’t like the token you are supplying. Could you confirm the value of that variable, and that it is configured in HipChat?
Yes, it’s the same token we use for all of our other Hipchat notifications.
That step template is contributed by the community. Unfortunately we don’t have experience with it in-house.
The best I can suggest is to take the script (provided on the library page) and test it outside of Octopus. Also, the comments thread on that page mentions a few known issues and resolutions.
I wish I could offer you a better answer. If you can’t resolve the issue, perhaps try contacting the contributor?
OK, so I figured this out. It WAS the token. Apparently you need to use specific room tokens (the global ones don’t work). Once I used a token specific to the room I posted to… it worked.