Octopus command works locally but not in Azure DevOps

server
#1

Hi

I am trying to setup Octopus with Azure DevOps but not able to understand what might be the issue here as the error message is not very clear.

When I run the command locally it works fine but the same command fails in the Build Agent in Azure Devops

dotnet-octo --list-projects --server http://octopusservername/ --apiKey=API-KeyName

This command works fine when executed from local system.

However when I run the command as part of my Build step I see the following error:

Unable to process response from server: Unexpected character encountered while parsing value: <. Path ‘’, line 0, position 0… Response content:
2020-02-18T20:29:18.4218483Z
2020-02-18T20:29:18.4218519Z Error from Octopus server (HTTP 200 OK)
2020-02-18T20:29:18.4218551Z Exit code: -7
2020-02-18T20:29:18.5060223Z ##[error]Cmd.exe exited with code ‘-7’.
2020-02-18T20:29:18.5368013Z ##[section]Finishing: CmdLine

(Kenneth Bates) #3

Hi @codeblue,

Thanks for getting in touch and confirming the same command works when executed from local system (which proves the URL and API key are correct). Another common reason why you’d see this HTML output (<) is when a proxy or something else in the network is in the way. Could you confirm that on your end?

If that seems fine, I expect we’d need your build logs to get more context and continue troubleshooting. Could you send that over if needed? Feel free to make this thread private or send it to support@octopus.com, and I can get it there. :slight_smile:

I hope this helps, and I look forward to hearing back!

Best regards,

Kenny

#4

Hi @Kenneth_Bates

Thanks for your response. How do I check what is the error related to proxy as Octopus command isn’t providing any information. Is there any command I can use from the CLI to verify any network or proxy related error?

(Kenneth Bates) #5

Hi @codeblue,

You’re quite welcome! We had another look, and it turns out the response content in the log snippet was stripped away in this thread, but we can see it in the raw text. The following is the response content (which should be JSON instead of the following HTML):

Response content: <html><head><title></title><meta name="revised" content="1.1.7" /></head><body></body></html>

Does that full HTML response text look familiar and point you in the right direction?
A couple other things to check: are you using the exact URL you use to access the web portal for this instance?
Interestingly, a solution to another case of this error was to create a new API key (reference this Stackoverflow thread).

I hope this helps, and I look forward to hearing back!

Best regards,

Kenny

(system) closed #6

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.