Unable to delete project

Hi All,

I’ve recently taken to trying to clean up some obsolete projects within Octopus. This project has been cloned several times and can now be deleted as it’s been superseded. However when I go to click the “Delete Project” button on the confirmation screen I get the below error and subsequent stack trace.

Error resolving type specified in JSON ‘Octopus.Core.Resources.Forms.Paragraph, Octopus.Client’. Path ‘Form.Elements[0].Control.$type’, line 1, position 290.

Newtonsoft.Json.JsonSerializationException: Error resolving type specified in JSON ‘Octopus.Core.Resources.Forms.Paragraph, Octopus.Client’. Path ‘Form.Elements[0].Control.$type’, line 1, position 290. —> Newtonsoft.Json.JsonSerializationException: Could not find type ‘Octopus.Core.Resources.Forms.Paragraph’ in assembly ‘Octopus.Client, Version=4.0.9.0, Culture=neutral, PublicKeyToken=null’.
at Newtonsoft.Json.Serialization.DefaultSerializationBinder.GetTypeFromTypeNameKey(TypeNameKey typeNameKey)
at Newtonsoft.Json.Utilities.ThreadSafeStore2.AddValue(TKey key) at Newtonsoft.Json.Utilities.ThreadSafeStore2.Get(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.ResolvePropertyAndCreatorValues(JsonObjectContract contract, JsonProperty containerProperty, JsonReader reader, Type objectType)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObjectUsingCreatorWithParameters(JsonReader reader, JsonObjectContract contract, JsonProperty containerProperty, ObjectConstructor1 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.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, 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.ResolvePropertyAndCreatorValues(JsonObjectContract contract, JsonProperty containerProperty, JsonReader reader, Type objectType) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObjectUsingCreatorWithParameters(JsonReader reader, JsonObjectContract contract, JsonProperty containerProperty, ObjectConstructor1 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.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 Nevermore.RelationalTransaction.d__351.MoveNext() at Octopus.Core.Persistence.Indexes.DeletionDocumentUsageFinder.RelationshipBuilder2.FindUsages(IRelationalTransaction transaction, Object from, List1 referencingDocuments) in Z:\buildAgent\workDir\cd33152532ae115f\source\Octopus.Core\Persistence\Indexes\DeletionDocumentUsageFinder.cs:line 93 at Octopus.Core.Persistence.Indexes.DeletionDocumentUsageFinder.FindReferences[TDocument](IRelationalTransaction transaction, TDocument document) in Z:\buildAgent\workDir\cd33152532ae115f\source\Octopus.Core\Persistence\Indexes\DeletionDocumentUsageFinder.cs:line 44 at Octopus.Server.Web.Infrastructure.Api.DeleteOnBackgroundResponseDescriptor2.Responder.CheckForVetoRules(TModel model) in Z:\buildAgent\workDir\cd33152532ae115f\source\Octopus.Server\Web\Infrastructure\Api\DeleteOnBackgroundResponseDescriptor.cs:line 106
at Octopus.Server.Web.Infrastructure.Api.DeleteOnBackgroundResponseDescriptor2.Responder.Execute() in Z:\buildAgent\workDir\cd33152532ae115f\source\Octopus.Server\Web\Infrastructure\Api\DeleteOnBackgroundResponseDescriptor.cs:line 62 at Octopus.Server.Web.Infrastructure.Api.Responder1.Respond(TDescriptor options, NancyContext context) in Z:\buildAgent\workDir\cd33152532ae115f\source\Octopus.Server\Web\Infrastructure\Api\Responder.cs:line 145
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at Octopus.Server.Web.Api.OctopusRestApiModule.<>c__DisplayClass0_0.<.ctor>b__0(Object o) in Z:\buildAgent\workDir\cd33152532ae115f\source\Octopus.Server\Web\Api\OctopusRestApiModule.cs:line 46
at Nancy.Routing.Route.<>c__DisplayClass4.b__3(Object parameters, CancellationToken context)

Hi,

Thanks for getting in touch! It looks like an old reference in the data. If you could run the following query on your database (backup first), it should resolve your issue.

UPDATE dbo.Interruption SET Json = Replace(json, ', Octopus.Client', ', Octopus.Core')

This is a change we made in 3.4.3, and so that I can track down the cause, did you upgrade from an earlier version recently? Or was the project imported from an a previous version?

Hope that helps!

Robert W

Hi Robert,

Thanks for getting back to me so quickly. The query you provided seems to have done the job perfectly.

We do update about once a fortnight (if a new release is available) and the project has existed since version 3.1. It wasn’t imported from any previous version.

Let me know if you require any more information.

Kind Regards,
Ben

Hi Ben,

Awesome, thanks for letting me know. I’ve reviewed the code and figured out how it occured, it was a problem that only occured in 3.4.2 that I fixed incorrectly.

Regards,

Robert W

Thanks for all the help Robert!