"Hang-On" status for a Deploy after a step failed.

eldadcohenil's Avatar

eldadcohenil

08 Nov, 2017 03:13 PM

Hi,

How to disable the "hang-on" status when there is an issue with one step, How to fail all the other steps ?

Thanks in Advanced

  1. Support Staff 1 Posted by Alex Rolley on 09 Nov, 2017 03:10 AM

    Alex Rolley's Avatar

    Hi,

    Thanks for getting in touch!

    Sorry to hear that you are having problems with your deployment. So that I can assist with the problem that you are having can you please provide some more information? When you are talking about the "hang-on" status are you referring to steps that have failed and are pending manual intervention or steps that have not completed and are in a hung state?

    With steps that are pending manual intervention you can select "cancel" in the top right corner which will abort the release and prevent any other steps from running. This will also work for a deployment that has a step that is in a hung state. If, however, you are wanting a process that will automatically cancel a step/deployment when a step has hung (or run for over a certain amount of time) that is not something that we support at this point in time.

    Please let me know if I have misunderstood your question or if there is anything else that I can assist with,

    Regards,
    Alex

  2. 2 Posted by eldadcohenil on 09 Nov, 2017 05:15 AM

    eldadcohenil's Avatar

    Hi ,

    Thanks for answering my question in detailed.
    The issue is that in my ci pipeline process you have no clue why a step is hang-on.
    For example the step have not found a package in the repo , the step will hang-on and the ci process will also hang-on.
    I am looking for some error code when running the octo.exe so my pipeline script in jenkins can fail.
    Thanks

  3. Support Staff 3 Posted by Ben Pearce on 13 Nov, 2017 06:28 AM

    Ben Pearce's Avatar

    Hi,

    In order for me to assist you with you problem, can you please provide me some addtional information.
    What is the octo.exe command line you are executing from Jenkins? Please include the command and parameters you are passing, feel free to remove any api keys or passwords in the command.
    If you run the command directly from a command line what is the output and and return code you get? You may be able to get this information from the output log from previous runs.

    The octo.exe command should always return an output code, 0 for success and non-zero for error, but I am not aware of a situation which would cause the step to hang. If you are running octo.exe from within a script you may not be handling the return codes correctly.

    If you provide me with as much information as you can I can try and help you find a solution.

    Regards
    Ben

  4. 4 Posted by eldadcohenil on 13 Nov, 2017 10:39 AM

    eldadcohenil's Avatar

    Hi,

    I am running two commands from Jenkins File in my pipeline

    bat "Octo.exe push --package MyApp.Website.1.1.0.zip --package MyApp.Database.1.1.0.zip --replace-existing --server http://my.octopus.url --apiKey API-XXXXXXXXXXXXXXXX"

    bat ""C:\Tools\Octo\Octo.exe" create-release ....(same as before)... --deployto=Development --progress"

    There are cases where the deploy process is been stuck "Hang-On" and there is no response to my command. My CI server can not response for that kind of status.
    My workaround is to limit the time of the job.
    any other suggestions.

    Thanks

  5. Support Staff 5 Posted by Ben Pearce on 14 Nov, 2017 12:18 AM

    Ben Pearce's Avatar

    Hi,

    The commands that you are running are not likely to be causing the process to hang, I'm not ruling it out but the push and create-release commands don't execute any long running processes on the server.

    I notice that each of your executable lines is prefixed with bat, does this indicate a particular step type in Jenkins or is it a script which is wrapping the Octo.exe commands. If it is a script, could this be hiding the return code of the command?

    Do you have any output from your Jenkins log which might show the last thing to happen before it hangs?

    Regards
    Ben

  6. 6 Posted by eldadcohenil on 14 Nov, 2017 03:05 PM

    eldadcohenil's Avatar

    Hi,

    The bat command is inside my Jenkins file in one of my stages.
    my last step check if my app is up , I am running a small EXE application that return exit code 0/-1. Then in my process step (PS script) I if my app returned and EXIT according to it.
    I had a case where I run my deploy process , I had a status when I exited with -1 from the step and the deploy process was still hang ON. I had to cancel it manually.
    Any suggestions.

    Thanks

  7. Support Staff 7 Posted by Ben Pearce on 15 Nov, 2017 12:17 PM

    Ben Pearce's Avatar

    Hi,

    The --progress and --deployto flag in the create-release command actually also waits for the deployments to complete.
    Are you able to provide a copy of your server and tentacle logs when this issue is occurring (if possible) and also some screen shots of your process?

    Regards
    Ben

  8. 8 Posted by eldadcohenil on 15 Nov, 2017 12:24 PM

    eldadcohenil's Avatar

    Hi,

    1. Can you please provide for me where to take Tentacle logs.
    2. Is there a way to cancel deployment process via CLI ?

  9. Support Staff 9 Posted by Ben Pearce on 15 Nov, 2017 02:28 PM

    Ben Pearce's Avatar

    Hi,

    The logs locations are documented here

    There is a timeout parameter available on the create-release command for Octo.exe. There is no way to cancel a deployment from the command line but you can do it via the Task API.

    Regards
    Ben

  10. 10 Posted by eldadcohenil on 17 Nov, 2017 08:57 AM

    eldadcohenil's Avatar

    Hi,

    Question regrading timeout parameter.
    The timeout parameter will cancel the deployment process once it over ?

    Thanks

  11. Support Staff 11 Posted by Ben Pearce on 20 Nov, 2017 12:42 AM

    Ben Pearce's Avatar

    Hi,

    If you specify the --cancelontimeout parameter, along with the --deploymenttimeout, Octo.exe will cancel the task for you. I think this will do what you need.

    Regards
    Ben

  12. 12 Posted by eldadcohenil on 20 Nov, 2017 01:12 PM

    eldadcohenil's Avatar

    Hi,

    OK I added the parameter mentoied above.
    Scenario:
    Deploy process started , Wrong package name was entered in one of the step.
    Error raised on deploy process
    Deploy is in Hang-On status , also Jenkins job is in an Hang-On status.

    After time out period the deploy process was canceled,
    That made the trick.
    Thanks

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac