Release creation fails after upgrade to 2019.10.1 with invalid version string

After upgrading, octopus no longer likes the release version format we have been using. Here are logs from our teamcity instance, but I can also verify that previous releases no longer have valid names either.

I also don’t understand this message – the version it’s complaining about is NOT the version that we are sending it!

[Octopus Deploy] Release plan for ContosoCorp 2019.1023.6858-maste-r5794-031d849
[16:57:46][Octopus Deploy] Channel: ‘Default’ (this is the default channel)
[16:57:46][Octopus Deploy] # Name Version Source Version rules
[16:57:46][Octopus Deploy] — ------------- ---------------- ---------------- -------------------
[16:57:46][Octopus Deploy] 1 cc2 2019.1023.6858 User specified Allow any version
[16:57:46][Octopus Deploy] 2 cc3 2019.1023.6858 User specified Allow any version
[16:57:46][Octopus Deploy] 3 cc3.hangfire 2019.1023.6858 User specified Allow any version
[16:57:46][Octopus Deploy]
[16:57:46][Octopus Deploy] Creating release…
[16:57:47][Octopus Deploy] Octopus Server returned an error: ‘2019.809.6535-’ is not a valid version string
[16:57:47][Octopus Deploy] Parameter name: input
[16:57:47][Octopus Deploy] Error from Octopus Server (HTTP 500 InternalServerError)

This seems like a bug/regression, potentially related to this work? https://github.com/OctopusDeploy/Issues/issues/5886

The build Information page is also broken.

Found a stack trace as well

Unhandled error on request: http://SERVERURL:8888/api/Spaces-1/releases ec247335f6b947ab83dea3d62a3e4b4c by <anonymous> : '2019.809.6535-' is not a valid version string
Parameter name: input System.ArgumentException: '2019.809.6535-' is not a valid version string
Parameter name: input
   at Octopus.Versioning.Semver.SemVerFactory.CreateVersion(String input, Boolean preserveMissingComponents)
   at Octopus.Core.RelationalStorage.SemanticVersionReaderWriter.Write(Object target, Object value) in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Core\RelationalStorage\SemanticVersionReaderWriter.cs:line 26
   at Nevermore.RelationalTransaction.<Stream>d__43`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Octopus.Server.Communications.Packages.ReleaseCreation.ReleaseBuildInformationCalculator.DetermineBuildInformation(IOctopusQueryExecutor queryExecutor, Project project, IEnumerable`1 releaseSelectedPackages, IList`1 packageActions) in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Server\Communications\Packages\ReleaseCreation\ReleaseBuildInformationCalculator.cs:line 93
   at Octopus.Server.Web.Api.Rules.ReleaseWorkItemsRule.AfterMapBeforeStore(Release model, ReleaseResource resource, ISpecialRuleContext context) in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Server\Web\Api\Rules\ReleaseWorkItemsRule.cs:line 27
   at Octopus.Server.Web.Infrastructure.Api.Responder`1.ExecuteRegisteredRules[TRule](Action`2 ruleCallback) in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Server\Web\Infrastructure\Api\Responder.cs:line 318
   at Octopus.Server.Web.Infrastructure.Api.CreateResponseDescriptor`2.Responder.ExecuteRegistered() in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Server\Web\Infrastructure\Api\CreateResponseDescriptor.cs:line 66
   at Octopus.Server.Web.Infrastructure.Api.Responder`1.Respond(TDescriptor options, NancyContext context) in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Server\Web\Infrastructure\Api\Responder.cs:line 281
   at Octopus.Server.Web.Infrastructure.OctopusNancyModule.<>c__DisplayClass14_0.<get_Routes>b__1(Object o, CancellationToken x) in C:\buildAgent\work\abb2fbfce959a439\source\Octopus.Server\Web\Infrastructure\OctopusNancyModule.cs:line 122
   at Nancy.Routing.Route`1.<Invoke>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Nancy.Routing.DefaultRouteInvoker.<Invoke>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Nancy.Routing.DefaultRequestDispatcher.<Dispatch>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Nancy.NancyEngine.<InvokeRequestLifeCycle>d__22.MoveNext()

I was able to resolve this issue by running this query in the octo database. That timing looks like it’s around the time when we enabled the Teamcity release notes integration, unfortunately teamcity has already cleaned up all of the records of that particular deploy / release / build.

update dbo.BuildInformation 
set Version='2019.809.6535'
where Version='2019.809.6535-'

Hi Gabe,

My sincere apologies that this message fell through the cracks. This was a known issue and we released a patch to address it in 2019.10.2. It was actually caused as part of the changes when we renamed Package Metadata => Build Information. When we did that we also changed the internals of the code to treat the Version column as a SemVersion object (we translate it into that in memory to make comparisons easier and sorting work the way it should for SemVer). What we forgot to take in to account was the potential for existing data to not be SemVer compliant, as was the case with the records you had. In the current version you cannot push build information if the version isn’t SemVer compliant, so it should get picked up earlier.

Apologies for the inconvenience this caused and for the delay in getting a replay back to you.

Regards
Shannon