Return Code 0 when attempting to delete/publish/unpublish item
I have created a dynamic content module called Store. I am attempting to delete/publish/unpublish one of it's items. It is the only item that I am having issues making modifications to.
I have attempted to run a service trace but the output isn't providing much meaningful data. I have attached it.
I have noticed that in the database under sf_dynamic_content as well as in the stre table that there are 3 entries for the record (temp, live, master). Even when I am not editing the entry the temp record still exists in the table. Could that be related to the issue?
Trace output:
System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
Telerik.Sitefinity.Data.Linq.OpenAccess.OpenAccessQueryProvider`2.Execute(Expression expression)
Telerik.Sitefinity.Data.Linq.OpenAccess.OpenAccessQueryProvider`2.System.Linq.IQueryProvider.Execute[TResult](Expression expression)
System.Linq.Queryable.SingleOrDefault[TSource](IQueryable`1 source)
Telerik.Sitefinity.Taxonomies.TaxonomyManager.AdjustMarkedItemsCount(Type dataItemType, Guid taxonId, Int32 count, String itemProviderName, ContentLifecycleStatus statisticType)
Telerik.Sitefinity.Taxonomies.TaxonomyManager.AdjustMarkedItemsCount(IDataItem dataItem, Guid taxonId, Int32 count, ContentLifecycleStatus statisticType)
Telerik.Sitefinity.Taxonomies.Organizers.DefaultOrganizer.AdjustMarkedItems(ITaxonomyManager manager, Guid taxonId, Int32 adjustment, Boolean commitChanges)
Telerik.Sitefinity.Taxonomies.Organizers.DefaultOrganizer.Clear(String propertyName)
Telerik.Sitefinity.Data.WcfHelpers.ReflectionHelper.CopyProperties(Object source, Object& destination, CreateInstanceDelegate createDelegate, CanCopyPropertyDelegate canCopyPropertyDelegate, String propertyPath)
Telerik.Sitefinity.Data.WcfHelpers.ReflectionHelper.DeepCopy(Object source, Type type, CreateInstanceDelegate createDelegate, CanCopyPropertyDelegate canCopyPropertyDelegate, String propertyPath)
Telerik.Sitefinity.Data.WcfHelpers.DynamicFieldsDataContractSurrogate.GetDeserializedObject(Object obj, Type targetType)
System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeWithSurrogate(XmlReaderDelegator xmlReader, Type declaredType, DataContract surrogateDataContract, String name, String ns)
ReadItemContextOfDynamicContentBJvd3pKJFromJson(XmlReaderDelegator , XmlObjectSerializerReadContextComplexJson , XmlDictionaryString , XmlDictionaryString[] )
System.Runtime.Serialization.Json.JsonClassDataContract.ReadJsonValueCore(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)
System.Runtime.Serialization.Json.JsonDataContract.ReadJsonValue(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)
System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract& dataContract)
System.Runtime.Serialization.XmlObjectSerializerReadContextComplex.InternalDeserializeWithSurrogate(XmlReaderDelegator xmlReader, Type declaredType, DataContract surrogateDataContract, String name, String ns)
System.Runtime.Serialization.Json.DataContractJsonSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName)
System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver)
System.Runtime.Serialization.Json.DataContractJsonSerializer.ReadObject(XmlDictionaryReader reader, Boolean verifyObjectName)
System.ServiceModel.Dispatcher.SingleBodyParameterMessageFormatter.DeserializeRequest(Message message, Object[] parameters)
System.ServiceModel.Dispatcher.DemultiplexingDispatchMessageFormatter.DeserializeRequest(Message message, Object[] parameters)
System.ServiceModel.Dispatcher.UriTemplateDispatchFormatter.DeserializeRequest(Message message, Object[] parameters)
System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc& rpc)
System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
I manually deleted the Temp row's with the following query. I was then able to delete the row. Any ideas what would have caused this?
declare @id uniqueidentifier
set @id = (select base_id from sf_dynamic_content where url_name_ = 'new' and status = 1);
delete from stre_areas where base_id = @id
delete from stre_brands where base_id = @id
delete from stre where base_id = @id
delete from sf_dynmc_cntnt_sf_lnguage_data where base_id = @id
delete from sf_dynamic_content where base_id = @id
Hi Andrew,
We have seen other reports about this issue but we were not able to isolate the scenario.
In theory a temp item should never exist if you are not in editing mode, so it means that something has crashed with the item when it was saved.
The exception is related to the taxonomies statistics. I guess that this item has its taxonomy field updated. If you can remember what were the steps you did with the item before the problem occurred that could help a lot with detecting the steps to reproduce.
I am sorry for your inconvenience.
Kind regards,
Lilia Messechkova
the Telerik team
Thanks for the reply Lilia. Mentioning the taxonomy statistics has sparked something. I am having problems modifying certain dynamic module items, I am also having problems assigning certain custom taxonomies to dynamic modules. This appears to be related to the taxonomy statistics. I ran a query and noticed that the statistics where duplicated for a particular taxon:
select * from sf_taxonomy_statistic where taxon_id = '22174114-F1F1-4346-AE93-736C4D74653E'
I saw multiple entries for the same statistic_type and taxon_id
I deleted the duplicates and only left one entry remaining per statistic_type for that taxon. Afterwards I was then able to successfully save the entry.
I ran a query and noticed that there are about 87 other duplicated entries in the sf_taxonomy_statistic table. I want to verify that this is an appropriate solution. It doesnt appear that the id column in the sf_taxonomy_statistic table is related to any other tables so Im assuming deleting all duplicated rows is ok? I'd like a confirmation before rolling to production.
Here is the duplication query I am executing:
select count(taxon_id) as how_many_dupes, taxon_id,statistic_type
from sf_taxonomy_statistic
group by taxon_id, statistic_type
having count(taxon_id) > 1
Which version are you running? I remember this being an issue for us, but it was fixed a couple versions ago...
At the time they gave me this SP which cleaned things up, please backup your DB before running
/****** Object: StoredProcedure [dbo].[mp_sp_repairCategoryStats] Script Date: 2013-01-08 3:26:02 PM ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGO-- =============================================-- Author: Telerik-- What is this: Fixes the 500 Target Invocation-- exception that can sometimes occur if there's multiple-- stat objects for a category-- =============================================ALTER PROCEDURE [dbo].[mp_sp_repairCategoryStats]ASBEGIN/****** Script for SelectTopNRows command from SSMS ******/declare @T table( taxon_id uniqueidentifier, statistic_type int, data_item_type varchar(255), item_provider_name varchar(255), marked_count bigint, id uniqueidentifier, duplicated_count int ) insert into @TSELECT [taxon_id] ,[statistic_type] ,[data_item_type] ,item_provider_name ,sum(marked_items_count) as marked_count ,CAST(MIN(CAST(id AS BINARY(16))) AS UNIQUEIDENTIFIER) ,count(*)FROM [sf_taxonomy_statistic]group by taxon_id, data_item_type, statistic_type, item_provider_namehaving count(taxon_id) > 1 select count(*) from @T delete [sf_taxonomy_statistic]from [sf_taxonomy_statistic] as statinner join @T as tempon stat.taxon_id = temp.taxon_id and stat.data_item_type = temp.data_item_type and stat.statistic_type = temp.statistic_type and stat.item_provider_name = temp.item_provider_name and stat.id <> temp.id update statset marked_items_count = temp.marked_countfrom [sf_taxonomy_statistic] statinner join @T as tempon stat.id = temp.idEND