I’m getting an “sc.exe config failed with exit code: 1639” when deploying to a tentacle running on Windows 10, however the same deployment works fine on 8.1. It occurs with both sc config and sc create.
I’ve tried running the exact sc.exe command generated by octopus directly on Windows 10 in an elevated command prompt, and it works perfectly, so I think it could be some kind of change in WindowsService_BeforePostDeploy.ps1 permissions required to run sc on Windows 10? This is with build 10166, but it’s also been happening with previous builds.
Thanks,
Paul
The Barleycorn service already exists. It will be stopped and reconfigured.
Stopping the Barleycorn service
sc.exe config Barleycorn binPath= ““C:\program files\barleycornservice\barleycorn.winservice.exe”” DisplayName= “Barleycorn” depend= / start= delayed-auto
DESCRIPTION:
Modifies a service entry in the registry and Service Database.
USAGE:
sc config [service name] …
OPTIONS:
NOTE: The option name includes the equal sign.
A space is required between the equal sign and the value.
type= <own|share|interact|kernel|filesys|rec|adapt|userown|usershare>
start= <boot|system|auto|demand|disabled|delayed-auto>
error= <normal|severe|critical|ignore>
binPath= <BinaryPathName to the .exe file>
group=
tag= <yes|no>
depend= <Dependencies(separated by / (forward slash))>
obj= <AccountName|ObjectName>
DisplayName=
password=
Error 21:11:50
sc.exe config failed with exit code: 1639
Error 21:11:50
At C:\Program Files\Octopus Deploy\Tentacle\Scripts\Octopus.Features.WindowsSer
Error 21:11:50
vice_BeforePostDeploy.ps1:112 char:3
Error 21:11:50
throw "sc.exe config failed with exit code: $LastExitCode"
Thanks for reaching out. Desktop versions of Windows are not officially supported by us. Octopus is a server to server deployment tool, and for this reason we test it only on Server OSs. Here’s a lengthier explanation for this written by my colleague Vanessa
Thanks for replying Dalmiro. The issue appears to be with PS 5.0 - presumably this will affect Server 2016 (where it is installed by default) and any previous Server OS’s where PS 5.0 is installed.
I’ve updated Octopus.Features.WindowsService_BeforePostDeploy.ps1 to fix the problem. No doubt you’ll resolve this officially once you test on PS 5.
This works from a command prompt, but apparently not from PS. Stopping WindowsService_BeforePostDeploy.ps1 inserting the escaped quotes fixed the problem.
I’m having this exact same problem on Windows Server 2012 R2 Datacenter running Powershell version 5.0. Do your above responses mean that you will not support powershell 5 at this time?
We haven’t tested this again in the newer versions of Powershell 5/WMF 5 since we found the bug mentioned above. Powershell is an important piece of our architecture and its heavily used by our users, so we’ll do our best to support PS5 (which is still in preview/beta). We’ll update this thread once we test against the latest version of Powershell.
I’m having the same issue on windows server 2012 r2 with Powershell 5 Installed .
Is there a way to modify Octopus.Features.WindowsService_BeforePostDeploy.ps1 script on Octopus Server that’s getting deploy to Tentacles ?
I can create a PowerShell script as a workaround but I would rather modify existing script .
Or even better, you could submit a PR, and if makes sense we can add it to Calamari. Make sure though to make the script work for Powershell 5 and backwards (maybe an If (powershellversion -eq 5){ do stuff} would be the best).
That should be the same script yeah. Could you please send a deployment log so I can check which version of Calamari is being used during the deployment? If you don’t want that log shared in this public thread, you can send it to Support(at)Octopus(dot)com. Make sure to tell that you are coming from this thread on the email body.
1
Using Octopus Deploy 3.2.24
trying to promote a successful release to a new environment where this environment has PS-5 getting this error, any ETA when Octopus Deploy is going to support the built-in install windows service for Windows Server 2012R2 running PS-5?
Thanks
Nir
I’ve added a comment on the main github issue for this and I’m gonna bring it up to the team today/tomorrow. Try to add yourself to the watchlist of the issue below to get the latest updates.
Hi Dalmiro,
Thanks for this.
Yesterday I pulled the latest version of calamari (since I noticed in the release notes of 3.3.10 that there is a related fix), and tested it by building and pushing it to one of the target deployment machines which previously deployment had failed.
with the new version it works - so we’ll upgrade to 3.3.10 in the next day or 2 to finally solve this.