13 Replies Latest reply on Sep 7, 2016 11:57 AM by Luciano Spagnuolo

    Failed to delete a Component Template "is in use in the property system"

    Luciano Spagnuolo

      I am attempting to delete a component template "bladelogic console auth" and receiving the following error on two of the components under it.
      Failed to delete object graph. Delete operation cannot be completed because the object 'BladeLogic console auth config (servername) (bladelogic console auth config (servername)' is in use in the Property System.

       

      I've searched but cannot seem to find the location, any help is appreciated.

       

      Lou Spagnuolo

        • 1. Re: Failed to delete a Component Template "is in use in the property system"
          Bill Robinson

          You probably have a smart group condition that directly references the template – eg ‘TEMPLATE equals /the/template’

          • 2. Re: Failed to delete a Component Template "is in use in the property system"
            Luciano Spagnuolo

            is there an easy way to find out which one?

            • 3. Re: Failed to delete a Component Template "is in use in the property system"
              Luciano Spagnuolo

              I just checked the dependencies of the component template and it shows none.

              • 4. Re: Failed to delete a Component Template "is in use in the property system"
                Bill Robinson

                it won't - being part of a smart group query isn't considered in the dependency mapping.  try the below queries.  for sqlserver change the || to +

                 

                WITH temp1 (group_id, path)

                AS

                (

                            select group_id, cast(name as varchar(1000))

                               from blgroup bg1

                               where parent_group_id = 0

                               UNION ALL

                          select bg1.group_id,

                                     cast(bg2.path || '/' || cast(bg1.name as varchar(100)) as varchar(1000))

                               from blgroup bg1

                               inner join temp1 bg2 on bg1.parent_group_id = bg2.group_id

                )

                select  temp1.path,t.name,t.bl_value_id from template t

                join temp1 on t.group_id = temp1.group_id

                where t.is_latest_version = 1

                and is_deleted = 0

                and t.name = 'YOUR_TEMPLATE';

                 

                get the bl_value_id for the template from the query above and run the below:

                 

                WITH temp1 (group_id, path)

                AS

                (

                            select group_id, cast(name as varchar(1000))

                               from blgroup bg1

                               where parent_group_id = 0

                               UNION ALL

                          select bg1.group_id,

                                     cast(bg2.path || '/' || cast(bg1.name as varchar(100)) as varchar(1000))

                               from blgroup bg1

                               inner join temp1 bg2 on bg1.parent_group_id = bg2.group_id

                )

                select  temp1.path,g.name from blgroup g

                join temp1 on g.parent_group_id = temp1.group_id

                join smart_group_query sgq on g.group_id = sgq.group_id

                join object_overflow_detail ood on sgq.object_overflow_id = ood.object_overflow_id

                where ( sgq.query_string like '%YOUR_BL_VALUE_ID%' or ood.value like '%YOUR_BL_VALUE_ID%');

                • 5. Re: Failed to delete a Component Template "is in use in the property system"
                  Luciano Spagnuolo

                  Bill, I get the following error when I try the sql query.  I did replace the || with +

                   

                   

                  Msg 102, Level 15, State 1, Line 19

                  Incorrect syntax near 'bl_value_id'.

                   

                  Lou Spagnuolo

                  • 6. Re: Failed to delete a Component Template "is in use in the property system"
                    Bill Robinson

                    which query were you running when you got that error ?

                     

                    what is on line 19 of the query you ran?

                     

                    what exactly did you run ?

                    • 7. Re: Failed to delete a Component Template "is in use in the property system"
                      Luciano Spagnuolo

                      I ran the below based on your query.  This is a SQL DB and the component template is called "Bladelogic console auth config"

                       

                       

                       

                       

                      temp1 (group_id, path)




                      select group_id, cast(name as varchar(1000))


                      from blgroup bg1

                       

                      where parent_group_id = 0

                       

                      UNION ALL


                      select bg1.group_id,

                       

                      cast(bg2.path + '/' + cast(bg1.name as varchar(100)) as varchar(1000))


                      from blgroup bg1

                       

                      inner join temp1 bg2 on bg1.parent_group_id = bg2.group_id




                        temp1.path,t.name,t.bl_value_id from template t



                      temp1 on t.group_id = temp1.group_id



                      t.is_latest_version = 1



                      is_deleted = 0



                      t.name = 'Bladelogic console auth config';



                      the bl_value_id for the template from the query above and run the below:



                      temp1 (group_id, path)




                      select group_id, cast(name as varchar(1000))


                      from blgroup bg1

                       

                      where parent_group_id = 0

                       

                      UNION ALL


                      select bg1.group_id,

                       

                      cast(bg2.path + '/' + cast(bg1.name as varchar(100)) as varchar(1000))


                      from blgroup bg1

                       

                      inner join temp1 bg2 on bg1.parent_group_id = bg2.group_id




                        temp1.path,g.name from blgroup g



                      temp1 on g.parent_group_id = temp1.group_id



                      smart_group_query sgq on g.group_id = sgq.group_id



                      object_overflow_detail ood on sgq.object_overflow_id = ood.object_overflow_id



                      ( sgq.query_string like '%YOUR_BL_VALUE_ID%' or ood.value like '%YOUR_BL_VALUE_ID%');

                       

                       

                       

                      ---Recent Errors when running the query---

                       

                       

                       

                      Msg 102, Level 15, State 1, Line 35

                       

                      Incorrect syntax near 'bl_value_id'.

                       

                       

                       

                      • 8. Re: Failed to delete a Component Template "is in use in the property system"
                        Bill Robinson

                        you either have a bad copy/paste into the community or you are missing some of the statements like 'with' on the first line and a number of other characters.

                        • 9. Re: Failed to delete a Component Template "is in use in the property system"
                          Luciano Spagnuolo

                          It was a bad paste. See below

                           

                           

                          temp1 (group_id, path)




                          select group_id, cast(name as varchar(1000))


                          from blgroup bg1

                           

                          where parent_group_id = 0

                           

                          UNION ALL


                          select bg1.group_id,

                           

                          cast(bg2.path + '/' + cast(bg1.name as varchar(100)) as varchar(1000))


                          from blgroup bg1

                           

                          inner join temp1 bg2 on bg1.parent_group_id = bg2.group_id




                            temp1.path,t.name,t.bl_value_id from template t



                          temp1 on t.group_id = temp1.group_id



                          t.is_latest_version = 1



                          is_deleted = 0



                          t.name = 'Bladelogic console auth config';


                          the bl_value_id for the template from the query above and run the below:


                          temp1 (group_id, path)




                          select group_id, cast(name as varchar(1000))


                          from blgroup bg1

                           

                          where parent_group_id = 0

                           

                          UNION ALL


                          select bg1.group_id,

                           

                          cast(bg2.path + '/' + cast(bg1.name as varchar(100)) as varchar(1000))


                          from blgroup bg1

                           

                          inner join temp1 bg2 on bg1.parent_group_id = bg2.group_id




                            temp1.path,g.name from blgroup g



                          temp1 on g.parent_group_id = temp1.group_id



                          smart_group_query sgq on g.group_id = sgq.group_id



                          object_overflow_detail ood on sgq.object_overflow_id = ood.object_overflow_id



                          ( sgq.query_string like '%YOUR_BL_VALUE_ID%' or ood.value like '%YOUR_BL_VALUE_ID%');


                          • 10. Re: Failed to delete a Component Template "is in use in the property system"
                            Bill Robinson

                            i'm not sure what to tell you.  so first you run this query:

                            WITH temp1 (group_id, path)

                            AS

                            (

                                        select group_id, cast(name as varchar(1000))

                                           from blgroup bg1

                                           where parent_group_id = 0

                                           UNION ALL

                                      select bg1.group_id,

                                                 cast(bg2.path + '/' + cast(bg1.name as varchar(100)) as varchar(1000))

                                          from blgroup bg1

                                           inner join temp1 bg2 on bg1.parent_group_id = bg2.group_id

                            )

                            select  temp1.path,t.name,t.bl_value_id from template t

                            join temp1 on t.group_id = temp1.group_id

                            where t.is_latest_version = 1

                            and is_deleted = 0

                            and t.name like 'Bladelogic console auth config';

                             

                            that should return output like this:

                            path                                                                                name               bl_value_id

                            Component Templates/CIS Compliance Content/CIS    CIS - AIX 7.1    2010912

                             

                            the bl_value_id will of course be different in your env.

                             

                            then use that bl_value_id in the next query:

                            WITH temp1 (group_id, path)

                            AS

                            (

                                        select group_id, cast(name as varchar(1000))

                                           from blgroup bg1

                                           where parent_group_id = 0

                                           UNION ALL

                                      select bg1.group_id,

                                                 cast(bg2.path || '/' || cast(bg1.name as varchar(100)) as varchar(1000))

                                           from blgroup bg1

                                           inner join temp1 bg2 on bg1.parent_group_id = bg2.group_id

                            )

                            select  temp1.path,g.name from blgroup g

                            join temp1 on g.parent_group_id = temp1.group_id

                            join smart_group_query sgq on g.group_id = sgq.group_id

                            join object_overflow_detail ood on sgq.object_overflow_id = ood.object_overflow_id

                            where ( sgq.query_string like '%YOUR_BL_VALUE_ID%' or ood.value like '%YOUR_BL_VALUE_ID%');

                             

                            so when i substitute in the bl_value_id from the first query i run this:

                            WITH temp1 (group_id, path)

                            AS

                            (

                                        select group_id, cast(name as varchar(1000))

                                           from blgroup bg1

                                           where parent_group_id = 0

                                           UNION ALL

                                      select bg1.group_id,

                                                 cast(bg2.path || '/' || cast(bg1.name as varchar(100)) as varchar(1000))

                                           from blgroup bg1

                                           inner join temp1 bg2 on bg1.parent_group_id = bg2.group_id

                            )

                            select  temp1.path,g.name from blgroup g

                            join temp1 on g.parent_group_id = temp1.group_id

                            join smart_group_query sgq on g.group_id = sgq.group_id

                            join object_overflow_detail ood on sgq.object_overflow_id = ood.object_overflow_id

                            where ( sgq.query_string like '%2010912%' or ood.value like '%2010912%');

                             

                            your paste still seems to be missing a lot of characters, and the 2nd query you pasted has the placeholder values, not the actual bl_value_id from the first query.

                            • 11. Re: Failed to delete a Component Template "is in use in the property system"
                              Luciano Spagnuolo

                              I gave up on pasting and typed the queries in.  The first query returns the following

                               

                              Component Templates/R&D Infrastructure/G273/production/applications/bmc/Bladelogic    Bladelogic console auth config    7467886

                               

                              When I use the number 7467886 from the first query in the 2nd query it seems to work (no errors) but nothing is found.

                              (0 row(s) affected)

                               

                              So that must mean that it isn't being used as part of any server groups.  I also cleaned up the component template i.e. deleted all parts and rules. Saved it then tried to delete it again.  The error I get is "Failed to delete object graph"

                              so the errors I get are

                              on the component template "Failed to delete object graph"
                              on the instance under the component template "Failed to delete object graph. Delete operation cannot be completed because the object 'Bladelogic console auth config (servername) (bladelogic console auth config (servername) is in use in the Property System.

                               

                              Thanks for the assistance

                              Lou Spagnuolo

                              • 12. Re: Failed to delete a Component Template "is in use in the property system"
                                Bill Robinson

                                it means that the template shouldn’t be in any smart groups, not just server smart groups.