Hi I have a console application that lives for a long time. In my Deploy.ps1 I issue a command to launch this application. The problem is that The deployment step never completes presumably because the console application has not terminated.
Thanks for reaching out. By your question, i’m assuming it is Ok to move on with the deployment even if this console application hasn’t finished running (correct me if i’m wrong). If that is the case, then try to start the application using the start-process cmdlet. This will open a new process that will run this application on the background so your Deploy.ps1 wont be sitting there waiting for the application to finish.
This actually didn’t work for me in 2.6.5. I used Start-Process for a long-lived EXE, the Deploy.ps1 script did indeed exit, but Octopus never completed the deployment. It’ll only complete if I kill the process that was launched with Start-Process.
This may be helpful. I literally swapped our EXE with notepad.exe and shipped it through the pipeline. Interesting, that worked. So, there’s something that our EXE is doing that Octopus seems to want to hang on to. What could an EXE be doing that would cause Octopus to hang even though the Deploy.ps1 script exits properly?
Unfortunately I can’t distribute the binaries as they’re proprietary.
Could we just hop on a webex? I can set one up and show you the issue. Maybe in an hour?
I think I know the issue. The EXE is a long-running console app, it never exits (it should be a service, but it is what it is – a console app). Since it never terminates, Octopus hangs during the deployment indefinitely. The workaround seems to be to wrap the EXE with the windows task scheduler and have Octopus manage the scheduler for starting the service instead of starting the EXE directly.
I’ll let you know if this works.
-Drew
From: Horn, Drew
Sent: Wednesday, July 15, 2015 2:56 PM
To: 'Dalmiro Grañas’
Subject: RE: Long running console applications [Questions #4448]
Hey Dalmiro,
This may be helpful. I literally swapped our EXE with notepad.exe and shipped it through the pipeline. Interesting, that worked. So, there’s something that our EXE is doing that Octopus seems to want to hang on to. What could an EXE be doing that would cause Octopus to hang even though the Deploy.ps1 script exits properly?
Unfortunately I can’t distribute the binaries as they’re proprietary.
Could we just hop on a webex? I can set one up and show you the issue. Maybe in an hour?