Cannot create Tentacle.config via CLI

Hi all,

We’re trying to automate our Tentacle install, and running into a problem. We use the silent install feature of the MSI to install Tentacle, this works as expected - Tentacle is installed in C:\Program Files\Octopus Deploy\Tentacle. As expected (I think), no service or the like is setup.

Directly after install, there is no Tentacle.config file in the Tentacle program files directory. Running Octopus Tentacle Manager and going through the steps to create a new instance then creates this file, and I can see it is populated with the certificate, etc. However, if I uninstall Tentacle, delete its Program Files directory, reinstall Tentacle, and then try and use “tentacle.exe create-instance --config C:\Program Files\Octopus Deploy\Tentacle\Tentacle.config” it errors out telling me that it can’t read a non-existent file, however, the docs online state the --config parameter should point to a file to create.

When running the manual setup through the Tentacle Manager application, I see a step in the output like follows: “Creating non-existent configuration file”, but this doesn’t seem to happen when automating through the CLI.

What’s the correct way to go about automating this initial step of creating a Tentacle instance? This is with Tentacle 3.14.159, and the clients are Windows 10.

The exact output from create-instance:

PS C:\Program Files\Octopus Deploy\Tentacle> .\Tentacle.exe create-instance --instance "Tentacle" --
config "C:\Program Files\Octopus Deploy\Tentacle\Tentacle.config" --console
.\Tentacle.exe : 
===============================================================================
+ CategoryInfo          : NotSpecified: (===============...===============:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError

Configuration file C:\Program Files\Octopus Deploy\Tentacle\Tentacle.config could not be found.
System.Exception
at Octopus.Shared.Configuration.XmlFileKeyValueStore.LoadSettings(IDictionary`2 settingsToFill)
at Octopus.Shared.Configuration.DictionaryKeyValueStore.Load()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at Octopus.Shared.Configuration.DictionaryKeyValueStore.Read(String key)
at Octopus.Shared.Configuration.AbstractKeyValueStore.Get(String name, Nullable`1 protectionScope)
at Octopus.Shared.Configuration.HomeConfiguration.get_HomeDirectory()
at Octopus.Shared.Configuration.LoggingConfiguration.get_LogsDirectory()
at Octopus.Shared.Configuration.LogInitializer.InitializeLogs()
at Octopus.Shared.Configuration.ApplicationInstanceSelector.DoLoad()
at Octopus.Shared.Configuration.ApplicationInstanceSelector.get_Current()
at Octopus.Shared.Startup.OctopusProgram.TryLoadInstance()
at Octopus.Shared.Startup.OctopusProgram.Run()

Thanks in advance!

Hi Ben,

Thanks for getting in touch!

Sorry for the delay in getting back to you on this one. Are you able to confirm that this issue doesn’t occur on a machine that hasn’t had Tentacle installed previously? I’ve run the following commands after installing Octopus Tentacle 3.14.159 on a fresh Windows 10 machine and it has correctly configured and registered the Tentacle with my local test Octopus Server instance:

cd c:\Program Files\Octopus\Tentacle
tentacle.exe create-instance --instance "Tentacle_Testing" --config "C:\Octopus\Tentacle.config" --console
tentacle.exe new-certificate --instance "Tentacle_Testing" --if-blank --console
tentacle.exe configure --instance "Tentacle_Testing" --reset-trust --console
tentacle.exe configure --instance "Tentacle_Testing" --home "C:\Octopus" --app "C:\Octopus\Applications" --port "10933" --console
tentacle.exe configure --instance "Tentacle_Testing" --trust "Octopus_Thumbprint" --console
"netsh" advfirewall firewall add rule "name=Octopus Deploy Tentacle" dir=in action=allow protocol=TCP localport=10933
tentacle.exe register-with --instance "Tentacle_Testing" --server "http://Octopus_Server" --apiKey="API-APIKEYHERE" --role "web-server" --environment "QA" --comms-style TentaclePassive --console
tentacle.exe service --instance "Tentacle_Testing" --install --start --console

You will need to replace the Octopus Thumbprint, API Key and Server URI with your details but otherwise everything should work as planned.

What I suspect the issue is is that you have remnants of your previous install that haven’t been correctly cleaned up, we have instructions on how to removed Tentacle correctly here.

If this doesn’t resolve your issue can you please attach your Tentacle logs (c:\Octopus\Logs) so that I can investigate further.

I look forward to hearing from you shortly,

Regards,
Alex

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.