Error when applying Licence key

I had to update the licence on one of our Octopus servers today when we found out existing licence had expired. We bought new licences a few months back but when I’ve gone to apply the new licence I get an error:

2018-05-21 11:12:57.8222      1 FATAL  Data at the root level is invalid. Line 1, position 1.
System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
   at System.Xml.Linq.XDocument.Parse(String text, LoadOptions options)
   at Octopus.Server.Licensing.LicenseKey.Parse(String licenseText) in Y:\Work\refs\tags\3.4.5\source\Octopus.Server\Licensing\LicenseKey.cs:line 71
   at Octopus.Server.Licensing.LicenseComplianceChecker.CheckCompatibility(License license, OctopusRelease candidate) in Y:\Work\refs\tags\3.4.5\source\Octopus.Server\Licensing\LicenseComplianceChecker.cs:line 49
   at Octopus.Server.Commands.LicenseCommand.Start() in Y:\Work\refs\tags\3.4.5\source\Octopus.Server\Commands\LicenseCommand.cs:line 83
   at Octopus.Shared.Startup.AbstractCommand.Octopus.Shared.Startup.ICommand.Start(String[] commandLineArguments, ICommandRuntime commandRuntime, OptionSet commonOptions) in Y:\Work\refs\tags\3.4.5\source\Octopus.Shared\Startup\AbstractCommand.cs:line 58
   at Octopus.Shared.Startup.OctopusProgram.Start(ICommandRuntime commandRuntime) in Y:\Work\refs\tags\3.4.5\source\Octopus.Shared\Startup\OctopusProgram.cs:line 221
   at Octopus.Shared.Startup.ConsoleHost.Run(Action`1 start, Action shutdown) in Y:\Work\refs\tags\3.4.5\source\Octopus.Shared\Startup\ConsoleHost.cs:line 72
   at Octopus.Shared.Startup.OctopusProgram.Run() in Y:\Work\refs\tags\3.4.5\source\Octopus.Shared\Startup\OctopusProgram.cs:line 94

I upgraded the server from 3.4.5 to 2018.5.1 but am still faced the the same error.

I’m using this command to upgrade the licence:

Octopus.Server license --licenseBase64="<licence key here>"

Has anyone had this problem before?

Hi John,

Thanks for getting in touch!

Sorry that you ran into this issue, our documentation (well, the entire feature really) could be better explained. What you need to do here is encode your entire licence key into Base64 so that this command will work. So, for example, you could do this in Powershell

$b = [System.Text.Encoding]::UTF8.GetBytes('<License Signature="lRUzvuqiuzk11Th2/qlP8k1MRmivKsElzSDmL1RAxk5djkLwixRclK2UOyZm18a3W/5vDclkvPeNb/87uVQ==">
  <LicensedTo>Octopus Deploy</LicensedTo>
  <LicenseKey>99999-99999-99999-99999</LicenseKey>
  <Version>2.0<!-- License Schema Version --></Version>
  <ValidFrom>2018-05-22</ValidFrom>
  <MaintenanceExpires>2020-05-22</MaintenanceExpires>
  <ProjectLimit>Unlimited</ProjectLimit>
  <MachineLimit>10</MachineLimit>
  <UserLimit>Unlimited</UserLimit>
  </License>')
[System.Convert]::ToBase64String($b)

That will produce your full licence key in Base 64 which you can then use as input to this command.

I hope that helps, please let me know if you have any other questions!

Regards,
Alex

Thanks for your response, Alex. That seems to have done the trick, cheers!

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