Uploaded image for project: 'Grouper'
  1. Grouper
  2. GRP-1726

PITUtils.deleteInactiveRecords has a constraint violation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.1, 2.4.0, 2.3.0.patch
    • Component/s: API
    • Labels:
      None

      Description

      From: grouper-users-request@internet2.edu grouper-users-request@internet2.edu On Behalf Of James Babb
      Sent: Tuesday, April 03, 2018 8:05 AM
      To: grouper-users@internet2.edu Mailing List <grouper-users@internet2.edu>
      Subject: [grouper-users] Running in to problem with PITUtils.deleteInactiveRecords

      I am running in to a foreign key constraint when deleteInactiveRecords gets to the PITGroupSet purge step:

      groovy:000> edu.internet2.middleware.grouper.pit.PITUtils.deleteInactiveRecords(new Date(time), true);
      Done deleting 0 attributeAssignValues from point in time that ended before: 2016-04-02 21:18:13.336
      Done deleting 0 roleSets from point in time that ended before: 2016-04-02 21:18:13.336
      Done deleting 0 attributeAssignActionSets from point in time that ended before: 2016-04-02 21:18:13.336
      Done deleting 0 attributeAssigns from point in time that ended before: 2016-04-02 21:18:13.336
      Done deleting 0 attributeAssignActions from point in time that ended before: 2016-04-02 21:18:13.336
      Done deleting 0 attributeDefNameSets from point in time that ended before: 2016-04-02 21:18:13.336
      Done deleting 0 attributeDefNames from point in time that ended before: 2016-04-02 21:18:13.336
      Done deleting 0 memberships from point in time that ended before: 2016-04-02 21:18:13.336
      ERROR edu.internet2.middleware.grouper.internal.dao.GrouperDAOException:
      Problem in HibernateSession: HibernateSession (5d8d0a4): new, notReadonly, READ_WRITE_NEW, notActiveTransaction, session (82e65ec),
      Exception in executeUpdate: ByHqlStatic, query: 'delete from PITGroupSet where id in (:TPTBKTZM0, :TPTBKTZM1, :TPTBKTZM2, :TPTBKTZM3, :TPTBKTZM4, :TPTBKTZM5, :TPTBKTZM6, :TPTBK
      TZM7, :TPTBKTZM8, :TPTBKTZM9, :TPTBKTZM10, :TPTBKTZM11, :TPTBKTZM12, :TPTBKTZM13, :TPTBKTZM14, :TPTBKTZM15, :TPTBKTZM16, :TPTBKTZM17, :TPTBKTZM18, :TPTBKTZM19, :TPTBKTZM20, :TP
      TBKTZM21, :TPTBKTZM22, :TPTBKTZM23, :TPTBKTZM24, :TPTBKTZM25, :TPTBKTZM26, :TPTBKTZM27, :TPTBKTZM28, :TPTBKTZM29, :TPTBKTZM30, :TPTBKTZM31, :TPTBKTZM32, :TPTBKTZM33, :TPTBKTZM3
      4, :TPTBKTZM35, :TPTBKTZM36, :TPTBKTZM37, :TPTBKTZM38, :TPTBKTZM39, :TPTBKTZM40, :TPTBKTZM41, :TPTBKTZM42, :TPTBKTZM43, :TPTBKTZM44, :TPTBKTZM45, :TPTBKTZM46, :TPTBKTZM47, :TPT
      BKTZM48, :TPTBKTZM49, :TPTBKTZM50, :TPTBKTZM51, :TPTBKTZM52, :TPTBKTZM53, :TPTBKTZM54, :TPTBKTZM55, :TPTBKTZM56, :TPTBKTZM57, :TPTBKTZM58, :TPTBKTZM59, :TPTBKTZM60, :TPTBKTZM61
      , :TPTBKTZM62, :TPTBKTZM63, :TPTBKTZM64, :TPTBKTZM65, :TPTBKTZM66, :TPTBKTZM67, :TPTBKTZM68, :TPTBKTZM69, :TPTBKTZM70, :TPTBKTZM71, :TPTBKTZM72, :TPTBKTZM73, :TPTBKTZM74, :TPTB
      KTZM75, :TPTBKTZM76, :TPTBKTZM77, :TPTBKTZM78, :TPTBKTZM79, :TPTBKTZM80, :TPTBKTZM81, :TPTBKTZM82, :TPTBKTZM83, :TPTBKTZM84, :TPTBKTZM85, :TPTBKTZM86, :TPTBKTZM87, :TPTBKTZM88,
      :TPTBKTZM89, :TPTBKTZM90, :TPTBKTZM91, :TPTBKTZM92, :TPTBKTZM93, :TPTBKTZM94, :TPTBKTZM95, :TPTBKTZM96, :TPTBKTZM97, :TPTBKTZM98, :TPTBKTZM99)', cacheable: null, cacheRegion:
      null, tx type: null, tx type: nullBind var[0]: 'Param (class java.lang.String): 'TPTBKTZM0'->'8bcdbc8364074e63a95ea51532fde76b', Bind var[1]: 'Param (class java.lang.String): '
      TPTBKTZM1'>'6565e202ce7e45caad895274b4c8d8d4', Bind var[2]: 'Param (class java.lang.String): 'TPTBKTZM2'>'54a8ef39b5fc4836af423b1b237592d4', Bind var[3]: 'Param (class java.l
      ang.String): 'TPTBKTZM3'>'91a1a79a39cb4debb7fee4d03602dac6', Bind var[4]:...Bind var[97]: 'Param (class java.lang.String): 'TPTBKTZM97'>'0ee7a5e49dd74125a3b82e47d5759cb3', Bind var[98]: 'Param (class java.lang.String): 'TPTBKTZM98'>'d74d03a2b36a469a806216d35ec658eb'Bind var[99]: 'Param (class java.lang.String): 'TPTBKTZM99'>'8cd18ca2bea649f0bd886a9908783b6d',
      at edu.internet2.middleware.grouper.hibernate.HibernateSession._internal_hibernateSessionCatch (HibernateSession.java:589)
      at edu.internet2.middleware.grouper.hibernate.HibernateSession.callbackHibernateSession (HibernateSession.java:711)
      at edu.internet2.middleware.grouper.hibernate.ByHqlStatic.executeUpdateInt (ByHqlStatic.java:583)
      at edu.internet2.middleware.grouper.hibernate.ByHqlStatic.executeUpdate (ByHqlStatic.java:564)
      at edu.internet2.middleware.grouper.hibernate.ByHqlStatic.deleteInBatches (ByHqlStatic.java:541)
      at edu.internet2.middleware.grouper.internal.dao.hib3.Hib3PITGroupSetDAO.deleteInactiveRecords (Hib3PITGroupSetDAO.java:415)
      at edu.internet2.middleware.grouper.pit.PITUtils.deleteInactiveRecordsHelper (PITUtils.java:125)
      at edu.internet2.middleware.grouper.pit.PITUtils.deleteInactiveRecords (PITUtils.java:61)
      at edu.internet2.middleware.grouper.pit.PITUtils$deleteInactiveRecords.call (Unknown Source)

      --leads to--

      2018-04-03 06:32:26,061: [main] WARN SqlExceptionHelper.logExceptions(127) - - SQL Error: 2292, SQLState: 23000
      2018-04-03 06:32:26,062: [main] ERROR SqlExceptionHelper.logExceptions(129) - - ORA-02292: integrity constraint (GROUPERTST.FK_PIT_GS_PARENT_ID) violated - child record found

      --leads to--

      CONSTRAINT "FK_PIT_GS_PARENT_ID" FOREIGN KEY ("PARENT_ID") REFERENCES "GROUPERTST"."GROUPER_PIT_GROUP_SET" ("ID") ENABLE

      Wondering if there is a specific order that records in PIT_GROUP_SET must be deleted?

      Thanks all!


      James Babb
      Identity Management Lead
      Division of Information Technology
      University of Wisconsin-Madison
      james.babb@wisc.edu

        Attachments

          Activity

            People

            Assignee:
            chris.hyzer@at.internet2.edu Chris Hyzer (upenn.edu)
            Reporter:
            chris.hyzer@at.internet2.edu Chris Hyzer (upenn.edu)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Smart Checklist