JsonSerializationException thrown when trying to deploy release

We recently upgraded Octopus Deploy from 3.1 to 3.4.14.

Previously we had an issue where releases would sometimes fail without a visible error. We would deploy the release, which featured the first step as a manual intervention. After proceeding past this, the deploy would fail but there would be no error in the Task Log.

After this, we upgraded to see if this would address the issue. Now, releases still seem to fail but we are seeing this error:

Newtonsoft.Json.JsonSerializationException: Error resolving type specified in JSON 'Octopus.Server.Orchestration.Deploy.DeploymentState, Octopus.Server'. Path 'StateObject.$type', line 1, position 444. ---> Newtonsoft.Json.JsonSerializationException: Could not find type 'Octopus.Server.Orchestration.Deploy.DeploymentState' in assembly 'Octopus.Server, Version=3.4.14.0, Culture=neutral, PublicKeyToken=null'.
   at Newtonsoft.Json.Serialization.DefaultSerializationBinder.GetTypeFromTypeNameKey(TypeNameKey typeNameKey)
   at Newtonsoft.Json.Utilities.ThreadSafeStore`2.AddValue(TKey key)
   at Newtonsoft.Json.Serialization.DefaultSerializationBinder.BindToType(String assemblyName, String typeName)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolveTypeName(JsonReader reader, Type& objectType, JsonContract& contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, String qualifiedTypeName)
   --- End of inner exception stack trace ---
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolveTypeName(JsonReader reader, Type& objectType, JsonContract& contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, String qualifiedTypeName)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadMetadataProperties(JsonReader reader, Type& objectType, JsonContract& contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue, Object& newValue, String& id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolvePropertyAndCreatorValues(JsonObjectContract contract, JsonProperty containerProperty, JsonReader reader, Type objectType)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObjectUsingCreatorWithParameters(JsonReader reader, JsonObjectContract contract, JsonProperty containerProperty, ObjectConstructor`1 creator, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Octopus.Core.RelationalStorage.RelationalTransaction.<Stream>d__33`1.MoveNext() in Z:\BuildAgent\work\cd33152532ae115f\source\Octopus.Core\RelationalStorage\RelationalTransaction.cs:line 403
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at Octopus.Core.RelationalStorage.RelationalTransaction.LoadRequired[T](String id) in Z:\BuildAgent\work\cd33152532ae115f\source\Octopus.Core\RelationalStorage\RelationalTransaction.cs:line 91
   at Octopus.Server.Web.Infrastructure.Api.LoadResponseDescriptor`2.Responder.TryLoadDocument(TModel& document, Response& errorResponse) in Z:\BuildAgent\work\cd33152532ae115f\source\Octopus.Server\Web\Infrastructure\Api\LoadResponseDescriptor.cs:line 60
   at Octopus.Server.Web.Infrastructure.Api.LoadResponseDescriptor`2.Responder.Execute() in Z:\BuildAgent\work\cd33152532ae115f\source\Octopus.Server\Web\Infrastructure\Api\LoadResponseDescriptor.cs:line 35
   at Octopus.Server.Web.Infrastructure.Api.Responder`1.Respond(TDescriptor options, NancyContext context) in Z:\BuildAgent\work\cd33152532ae115f\source\Octopus.Server\Web\Infrastructure\Api\Responder.cs:line 162
   at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
   at CallSite.Target(Closure , CallSite , Object , Object , NancyContext )
   at Octopus.Server.Web.Api.OctopusRestApiModule.<>c__DisplayClass0_0.<.ctor>b__0(Object o) in Z:\BuildAgent\work\cd33152532ae115f\source\Octopus.Server\Web\Api\OctopusRestApiModule.cs:line 46
   at CallSite.Target(Closure , CallSite , Func`2 , Object )
   at Nancy.Routing.Route.<>c__DisplayClass4.<Wrap>b__3(Object parameters, CancellationToken context)

This error doesn’t always happen, but at the moment it is happening more often than not. I thought it was just happening on releases created via Team City rather than directly in Octopus, but after testing this isn’t the case.

I do know that if we remove the Manual Intervention step, this seems to get rid of the problem. If I try to add it back in, the problem returns. Is there an issue with this process step?

Hi,

I am sorry that you are having these problems. But now we have an error message that seems like progress :slight_smile:
I don’t know if we are going to be able to replicate this as it might be based off a bad migration of data or structure based on changes we made.
Would we be able to get an export of this project so we can determine where the issue is? It would need to include the manual intervention.
http://docs.octopus.com/display/OD/Partial+Export for the project would be great.

Please let me know if this is possible and I will create a secure location for you to upload the file.

Vanessa

Hi Vanessa,

Yes, I can export the project in question. Please provide the location so I can upload this to you.

Thanks,

  • Alex

Hi Alex,

If you could please upload the exported files in a zip to the following location: https://file.ac/0a9yzKBowqM/
It is upload only, and it will not list the files once they are up (for privacy).

Vanessa

Hi Vanessa,

Can you provide an email address for yourself so I can contact you directly before uploading this file?

Hi Alex,

Either my name at octopus.com or even support@. I can also add a password to the file upload if you want :slight_smile:

Vanessa