Deploying Topshelf'ed service > 3.2.0 with Octopus

577 views
Skip to first unread message

Peter Hageus

unread,
May 9, 2016, 1:39:48 AM5/9/16
to topshelf-discuss
Hi. We still use Topshelf for our services even though we've started deploying and installing services with Octopus. This has worked fine until I created a new service, getting Topshelf 4.0, resulting in the following error when starting:
The Topshelf.Runtime.Windows.WindowsHostSettings service has not been installed yet. Please run 'EntryEvent.Supervisor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null install'.

Working my way backwards, 3.2.0 seems to be the last release that let you install with sc.exe. Looking through the release notes and commits and can't find anything related to this, is there any reason it doesn't work any more? 

(I realize we don't actually need Topshelf anymore, but it's nice to have a fallback and be able to install manually, not having to implement ServiceBase ourselves, etc)

/Peter
 

Peter Hageus

unread,
May 9, 2016, 6:36:52 AM5/9/16
to topshelf-discuss
Seems to have nothing to do with version, but I can't for the life of me figure out what the problem is. 

We have several services using 3.2.0, have worked like a charm for at least a year on 20+ servers.

Yesterday I deployed a new service using TS4.0 (on a machine already running several old services), had the error below.
Downgraded to 3.2.0, worked fine.

Today I deployed yet another new service to the same machine, used 3.2.0 from the beginning, same problem! 

Any ideas?

/Peter

Dru Sellers

unread,
May 9, 2016, 10:36:32 AM5/9/16
to topshelf...@googlegroups.com
I've never installed TS services using SC.exe - I've always just said "exe install" which is how we have TS set up to deploy in octo as well.

@Chris, any ideas on the sc.exe thing?

--
You received this message because you are subscribed to the Google Groups "topshelf-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topshelf-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Travis Smith

unread,
May 9, 2016, 10:44:07 AM5/9/16
to topshelf...@googlegroups.com
Using SC has never been a use case we've explicitly supported. The fact that it worked before is just a bonus. As Dru said, just using the Topshelf command line is the supported method.

If this is important to you and you can come up automated tests we can run in CI to validate, we could add this as an explicit use case. We also would take PRs for it and would work with you to get that in.
--
-Travis

Peter Hageus

unread,
May 9, 2016, 3:30:43 PM5/9/16
to topshelf...@googlegroups.com
Mystery solved. It works fine, when you name the service the same… I have a vague memory fixing a spelling error in the service name yesterday, probably when downgrading Topshelf. Must have been it, and my brain just misfired and drew the wrong conclusion.

The service today was plain and simple named differently in Octopus and Topshelf. Very obvious what the problem was when I started looking at the ts-source.

Keep up the good work!

/Peter

Stewart Rogers

unread,
May 10, 2016, 4:07:28 PM5/10/16
to topshelf-discuss
I just upgraded to Topshelf 4.0.0 and then again this morning to the update 4.0.1 and both are no longer starting via octopus... They worked fine before.. Trace below

12:55:50
Info
Executing script on 'Development Integration Server'
12:55:50
Info
This Tentacle is currently busy performing a task that cannot be run in conjunction with any other task. Please wait...
12:55:51
Info
Extracting package: C:\Octopus\Files\SecureCommunication-EncryptionService-Server.001.000.000.107.nupkg-0ddfb6e0-9629-4dba-ae7e-60a313929d3e
12:55:52
Info
Substituting variables in: C:\Octopus\Work\20160510195549-116\InstallAndStart.ps1
12:55:53
Info
INFO: TopShelf Operation [install] started.
12:55:53
Info
Octopus => CustomInstallationDirectory: [C:/MicroServices/EncryptionService].
12:55:53
Info
INFO: TopShelf Execute [C:\MicroServices\EncryptionService\Console.exe install].
12:55:53
Info
Configuration Result:
12:55:53
Info
[Success] Name CellTrustEncryptionService, [Success] DisplayName CellTrust-SecureCommunication-EncryptionService (Instance: 9908df2f17f82332d65da86a79d932a6), [Success] Description Version: "1.0.0.107", Installed :"2016.05.10-12.55.52", "Copyright ? CellTrust 2016 "SecureCommunication-EncryptionService", Directory: "C:\MicroServices\EncryptionService", [Success] InstanceName 9908df2f17f82332d65da86a79d932a6, [Success] ServiceName CellTrustEncryptionService$9908df2f17f82332d65da86a79d932a6
12:55:53
Info
Topshelf v4.0.0.0, .NET Framework v4.0.30319.42000
12:55:53
Info
Running a transacted installation.
12:55:53
Info
Beginning the Install phase of the installation.
12:55:53
Info
Installing CellTrust-SecureCommunication-EncryptionService (Instance: 9908df2f17f82332d65da86a79d932a6) service
12:55:53
Info
[Topshelf.Nancy] Installing NancyHost.
12:55:53
Info
[Topshelf.Nancy] Started Installing NancyHost for Uri "https://localhost:7011/".
12:55:53
Info
[Topshelf.Nancy] Deleting Sslcerts from port "7011".
12:55:53
Info
[Topshelf.Nancy] Sslcerts deleted from port "7011".
12:55:53
Info
[Topshelf.Nancy] Deleting firewall port "7011".
12:55:53
Info
[Topshelf.Nancy] Firewall port deleted: "7011".
12:55:53
Info
[Topshelf.Nancy] Deleting URL "https://localhost:7011/" reservations.
12:55:53
Info
[Topshelf.Nancy] Could not delete URL "https://localhost:7011/" reservation for prefix "https://localhost:7011/" because it does not exist. Treating as a success.
12:55:53
Info
[Topshelf.Nancy] URL "https://localhost:7011/" reservation for prefix "https://localhost:7011/" deleted.
12:55:53
Info
[Topshelf.Nancy] Adding firewall rule "CellTrustEncryptionService:9908df2f17f82332d65da86a79d932a6.FirewallRule" for port "7011".
12:55:54
Info
[Topshelf.Nancy] Firewall rule "CellTrustEncryptionService:9908df2f17f82332d65da86a79d932a6.FirewallRule" added for port "7011".
12:55:54
Info
[Topshelf.Nancy] Adding Url "https://localhost:7011/" reservation for one prefix: "https://localhost:7011/".
12:55:54
Info
[Topshelf.Nancy] URL https://localhost:7011/ reservation added.
12:55:54
Info
[Topshelf.Nancy] Adding Sslcert "Celltrust Server SecureCommunication-EncryptionService CT02037WV V1 Self Signed" to port "7011".
12:55:54
Info
[Topshelf.Nancy] Sslcert "Celltrust Server SecureCommunication-EncryptionService CT02037WV V1 Self Signed" added to port "7011".
12:55:54
Info
[Topshelf.Nancy] Completed Installing NancyHost for Uri "https://localhost:7011/".
12:55:54
Info
[Topshelf.Nancy] Started Installing NancyHost for Uri "https://CT02037WV:7010/".
12:55:54
Info
[Topshelf.Nancy] Deleting Sslcerts from port "7010".
12:55:54
Info
[Topshelf.Nancy] Sslcerts deleted from port "7010".
12:55:54
Info
[Topshelf.Nancy] Deleting firewall port "7010".
12:55:54
Info
[Topshelf.Nancy] Firewall port deleted: "7010".
12:55:54
Info
[Topshelf.Nancy] Deleting URL "https://CT02037WV:7010/" reservations.
12:55:54
Info
[Topshelf.Nancy] Could not delete URL "https://CT02037WV:7010/" reservation for prefix "https://ct02037wv:7010/" because it does not exist. Treating as a success.
12:55:54
Info
[Topshelf.Nancy] URL "https://CT02037WV:7010/" reservation for prefix "https://ct02037wv:7010/" deleted.
12:55:54
Info
[Topshelf.Nancy] Adding firewall rule "CellTrustEncryptionService:9908df2f17f82332d65da86a79d932a6.FirewallRule" for port "7010".
12:55:54
Info
[Topshelf.Nancy] Firewall rule "CellTrustEncryptionService:9908df2f17f82332d65da86a79d932a6.FirewallRule" added for port "7010".
12:55:54
Info
[Topshelf.Nancy] Adding Url "https://CT02037WV:7010/" reservation for one prefix: "https://ct02037wv:7010/".
12:55:54
Info
[Topshelf.Nancy] URL https://CT02037WV:7010/ reservation added.
12:55:54
Info
[Topshelf.Nancy] Adding Sslcert "Celltrust Server SecureCommunication-EncryptionService CT02037WV V1 Self Signed" to port "7010".
12:55:54
Info
[Topshelf.Nancy] Sslcert "Celltrust Server SecureCommunication-EncryptionService CT02037WV V1 Self Signed" added to port "7010".
12:55:54
Info
[Topshelf.Nancy] Completed Installing NancyHost for Uri "https://CT02037WV:7010/".
12:55:54
Info
[Topshelf.Nancy] NancyHost Installed.
12:55:54
Info
Installing service CellTrustEncryptionService$9908df2f17f82332d65da86a79d932a6...
12:55:54
Info
Service CellTrustEncryptionService$9908df2f17f82332d65da86a79d932a6 has been successfully installed.
12:55:54
Info
The Install phase completed successfully, and the Commit phase is beginning.
12:55:54
Info
The Commit phase completed successfully.
12:55:54
Info
The transacted install has completed.
12:55:54
Info
INFO: TopShelf Operation [install] completed successfully.
12:55:54
Info
INFO: TopShelf Operation [start] started.
12:55:54
Info
Octopus => CustomInstallationDirectory: [C:/MicroServices/EncryptionService].
12:55:54
Info
INFO: TopShelf Execute [C:\MicroServices\EncryptionService\Console.exe start].
12:55:55
Info
Configuration Result:
12:55:55
Info
[Success] Name CellTrustEncryptionService, [Success] DisplayName CellTrust-SecureCommunication-EncryptionService (Instance: 9908df2f17f82332d65da86a79d932a6), [Success] Description Version: "1.0.0.107", Installed :"2016.05.10-12.55.54", "Copyright ? CellTrust 2016 "SecureCommunication-EncryptionService", Directory: "C:\MicroServices\EncryptionService", [Success] InstanceName 9908df2f17f82332d65da86a79d932a6, [Success] ServiceName CellTrustEncryptionService$9908df2f17f82332d65da86a79d932a6
12:55:55
Info
Topshelf v4.0.0.0, .NET Framework v4.0.30319.42000
12:55:55
Info
Topshelf.Hosts.StartHost Error: 0 : The service failed to start., System.InvalidOperationException: Cannot start service CellTrustEncryptionService$9908df2f17f82332d65da86a79d932a6 on computer '.'. ---> System.ComponentModel.Win32Exception: The service did not respond to the start or control request in a timely fashion
12:55:55
Info
--- End of inner exception stack trace ---
12:55:55
Info
at System.ServiceProcess.ServiceController.Start(String[] args)
12:55:55
Info
at Topshelf.Runtime.Windows.WindowsHostEnvironment.StartService(String serviceName, TimeSpan startTimeOut)
12:55:55
Info
at Topshelf.Hosts.StartHost.Run()
12:55:55
Info
INFO: TopShelf Operation [start] completed successfully.
---------------------------------------------------------------------------------------------------------------------------------------------

Casper Thygesen

unread,
Sep 29, 2016, 5:06:26 AM9/29/16
to topshelf-discuss
I also have the issue now:
"...start or control request in a timely fashion..."

There is nothing useful in the eventlog.
Reply all
Reply to author
Forward
0 new messages