Windows Service installation step fails

We are using Octopus Deploy to install a Windows Service using the “Windows Service” feature in a deploy step. After upgrading Octopus Deploy from version 2.6.X (don’t know which exact version we ran) to version 3.1.5 the deploy step started failing. Attached is the raw log of a failed deployment.

I have tried to find the script D:\Market6\DemandView\DemandViewTaskDistributorService$DEVRS_RND_RP_CORE\Octopus.Features.WindowsService_BeforePostDeploy.ps1 involved in order to debug what’s going on, but I cannot find the script (or any of the other *.ps1 scripts listed in the raw log). It looks like the scripts briefly exist during deployment, but are quickly deleted. Is there a way to make them permanent, so that I can debug them? What is the source of these scripts, where does Octopus keep them? Documentation indicates that in version 2.X they were in C:\Program Files\Octopus Deploy\Scripts, have they been moved in version 3?

One detail worth noting is that the directory name we deploy to includes a “$” character (you can see that in the logs) - is it possible that that causes the failure?

Any help with this is appreciated.

Thanks,
Mattias

ServerTasks-4959.log.txt (12 KB)

Hi Mattias,

Thanks for getting in touch!

I have investigated the script in question and the reason you’re hitting this issue is because when we dot-source the feature script we use " instead of ' and this causes PS to try and evaluate the part of the path that starts with $ as a PS variable.

I have raised #2124 to have this fixed.

In the meantime, you could fork Calamari and modify this script and build your own custom version of Calamari (see the README for information on how to setup Octopus to use your custom version of Calamari) to get around the issue (until the official fix has been released)

Hope that helps!

Thank you and warm regards,
Henrik