Exception has been thrown by the target of an invocation - d

Posted by Community Admin on 04-Aug-2018 14:25

Exception has been thrown by the target of an invocation - documents and events added via UI

All Replies

Posted by Community Admin on 25-Aug-2012 00:00

We have several documents and news articles that cannot be modifed (eg update the categories, change properties), unpublished (to then try republishing) or deleted (to recreate).

Trying any of these actions returns "Exception has been thrown by the target of an invocation."

All of these items were added using the standard admin UI (not progmatically) and all of them are only accessed/modified via the standard out of the box Sitefinity (ie displayed in standard events widget).

We need to figure out what is causing this, how to resolve it for these events/documents and how to prevent it.

Posted by Community Admin on 25-Aug-2012 00:00

Update: Resolved by Support (via SQ Lscript to rebuild the taxonomy stats).

Posted by Community Admin on 13-Sep-2012 00:00

I am also running into this with 2 Sitefinity sites..Can you give more specifics on what you did please?

Thanks!

Posted by Community Admin on 13-Sep-2012 00:00

Support inidcated that they beleived it was an issue with the taxonomy (there response listed below). We appear to run into this every ~2 weeks and I have had to run the script a few times (which could indicate an area which could stand some Telerik love). YMMV, usual precautions about backups apply etc etc.

Start Telerik response ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The experienced problem might indicate issue with the generated taxonomy statistics in previous usages of the categories module. Would it be possible for you to run the below SQL query against your site's database, and let me know if any issues persist? Please make sure to backup your database beforehand.

/****** 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 @T

SELECT

      [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_name

having count(taxon_id) > 1

    

select count(*) from @T

    

delete [sf_taxonomy_statistic]

from

      [sf_taxonomy_statistic] as stat

inner join

      @T as temp

on

      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 stat

set

      marked_items_count = temp.marked_count

from

      [sf_taxonomy_statistic] stat

inner join

      @T as temp

on

      stat.id = temp.id

This thread is closed