Sc.exe create failed with exit code: 1639

I am trying to use the Windows Service feature in a step and get the error "sc.exe create failed with exit code: 1639"
The tentacle is running on a “Windows Server 2012 R2 Datacenter, October 2014” box in Azure
I have previously run this same deployment on a “Windows Server 2012 Datacenter, October 2014” box successfully (notice the lack of R2)

How do I fix?

Here is the log information:

The Atomic.ManagedDns.Server service does not exist. It will be created.
sc.exe create "Atomic.ManagedDns.Server" binPath= "\"C:\Applications\Infrastructure\Atomic.ManagedDns.Server\1.0.0.17_1\Atomic.ManagedDns.Server.exe\" -c c:\ManageDnsConfig\config.json" DisplayName= "Atomic.ManagedDns.Server" depend= "" start= "auto"
DESCRIPTION:
        Creates a service entry in the registry and Service Database.
USAGE:
        sc <server> create [service name] [binPath= ] <option1> <option2>...
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>
       (default = own)
 start= <boot|system|auto|demand|disabled|delayed-auto>
       (default = demand)
 error= <normal|severe|critical|ignore>
       (default = normal)
 binPath= <BinaryPathName to the .exe file>
 group= <LoadOrderGroup>
 tag= <yes|no>
 depend= <Dependencies(separated by / (forward slash))>
 obj= <AccountName|ObjectName>
       (default = LocalSystem)
 DisplayName= <display name>
 password= <password>


Error    16:06:22
sc.exe create failed with exit code: 1639

Error    16:06:22
At C:\Program Files\Octopus Deploy\Tentacle\Scripts\Octopus.Features.WindowsSer

Error    16:06:22
vice_BeforePostDeploy.ps1:94 char:3

Error    16:06:22
+         throw "sc.exe create failed with exit code: $LastExitCode"

Error    16:06:22
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error    16:06:22
    + CategoryInfo          : OperationStopped: (sc.exe create f...exit code:  

Error    16:06:22
   1639:String) [], RuntimeException

Error    16:06:22
    + FullyQualifiedErrorId : sc.exe create failed with exit code: 1639

Fatal    16:06:22
PowerShell script returned a non-zero exit code: 1
Tentacle version 2.5.12.666

Hi Ryan,

Thanks for getting in touch! This issue was reported to us a few days ago.


If you check the thread we have a workaround you can use until we have a fix in 2.6

Sorry for the trouble!
Vanessa

I am unable to get that workaround to work. I have updated Octopus.Features.WindowsService_BeforePostDeploy.ps1 on lines 91, 105 & 115 (not in instructions, but likely needs to be changed as well).
I restarted the tentacles in case they were caching the scripts. Still didn’t work.

Any ideas?

Thanks,
Ryan

Seems not to be fixed in 2.6. Even made it worse for me because I didn’t have this issue in 2.5.x.

David, What OS version?

Sent from my Windows Phone


It’s a Windows Server 2008 R2 Enterprise with SP1.

David,

Can you send through the full deployment log of the failed deployment, if it has sensitive information in it, please raise a new support ticket and mark it as private.

Thank you and kind regards,
Henrik Andersson

Where can I find it? Or do I just copy it from the portal?

- David

On 26 Nov 2014 23:48, Henrik Andersson <tender2+ddd6f0aca37ea294de139115cb5df1205ec284f74@tenderapp.com> wrote:

// Please reply above this line
==================================================

From: Henrik Andersson (Support staff)

David,

Can you send through the full deployment log of the failed deployment, if it has sensitive information in it, please raise a new support ticket and mark it as private.

Thank you and kind regards,
Henrik Andersson

On Wed, Nov 26 at 02:29 PM, david.desloovere wrote:

It's a Windows Server 2008 R2 Enterprise with SP1.

Having trouble reading this? View this discussion online: sc.exe create failed with exit code: 1639.

To unsubscribe and stop receiving emails from http://help.octopusdeploy.com, visit this page

Hi David,

The following page shows how to grab a deployment log
http://docs.octopusdeploy.com/display/OD/Get+the+raw+output+from+a+task

Thanks
Vanessa

Thanks. I’ll open up a new (private) ticket.

Hi Ryan,

Which version of 2.6 ?

Vanessa

Hi Ryan,

The sc.exe issue was fixed in the latest version. 2.6.0.778

Your Octopus UI shows the Octopus version at the very bottom of the screen.
And also majority of the logs show it for tentacle such as: PowerShell script returned a non-zero exit code: 1 Tentacle version 2.6.0.751

Vanessa