Uploaded image for project: 'MidPoint'
  1. MidPoint
  2. MID-6122

Couldn't find container of type 'class com.evolveum.midpoint.repo.sql.data.common.container.RAssignment' with id '369'

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.2
    • Fix Version/s: 4.1
    • Component/s: None
    • Labels:
    • Subscription:
      Active subscription
    • Backport Version:

      Description

      This is corner-case problem with unfortunate impact on our IdM-IdM integration.

      When assignment is stored with activation/validTo in the past, but effectiveStatus of the assignment is still set to enabled, e.g. like this:

          <assignment id="369">
              <targetRef oid="e6215415-2bce-42b1-8b98-58c5b8229b9e" relation="org:default" type="c:RoleType">
              </targetRef>
              <activation>
                  <effectiveStatus>enabled</effectiveStatus>
                  <validFrom>2020-03-18T00:00:00.000+01:00</validFrom>
                  <validTo>2020-03-18T23:59:00.000+01:00</validTo>
              </activation>
          </assignment>
      

      And then primary hook deletes the assignment, e.g. like this (assTodel is either clone of orignal assignment or new AssignmentType with ID set):
      assignmentDelta = prismContext.deltaFactory().container().createModificationDelete(UserType.F_ASSIGNMENT, UserType.class, assToDel);
      modelContext.getFocusContext().swallowToPrimaryDelta(assignmentDelta);

      MP throws this error:
      2020-03-19 09:07:58,708 [MODEL] [http-nio-8080-exec-3] ERROR (com.evolveum.midpoint.web.page.admin.users.PageUsers): Couldn't reconcile user user:f86e0e3b-593c-4822-9863-91b242061a69()..
      com.evolveum.midpoint.util.exception.SystemException: Couldn't find container of type 'class com.evolveum.midpoint.repo.sql.data.common.container.RAssignment' with id '369'
      at com.evolveum.midpoint.repo.sql.helpers.BaseHelper.handleGeneralRuntimeException(BaseHelper.java:164)
      at com.evolveum.midpoint.repo.sql.helpers.BaseHelper.handleGeneralException(BaseHelper.java:144)
      at com.evolveum.midpoint.repo.sql.helpers.ObjectUpdater.modifyObjectAttempt(ObjectUpdater.java:526)
      at com.evolveum.midpoint.repo.sql.SqlRepositoryServiceImpl.modifyObject(SqlRepositoryServiceImpl.java:629)
      at com.evolveum.midpoint.repo.cache.RepositoryCache.modifyObject(RepositoryCache.java:1133)
      at com.evolveum.midpoint.model.impl.lens.ChangeExecutor.executeModification(ChangeExecutor.java:1525)
      at com.evolveum.midpoint.model.impl.lens.ChangeExecutor.executeDelta(ChangeExecutor.java:940)
      at com.evolveum.midpoint.model.impl.lens.ChangeExecutor.executeChanges(ChangeExecutor.java:192)
      at com.evolveum.midpoint.model.impl.lens.Clockwork.lambda$processSecondary$0(Clockwork.java:796)
      at com.evolveum.midpoint.model.impl.lens.ClockworkMedic.partialExecute(ClockworkMedic.java:211)
      at com.evolveum.midpoint.model.impl.lens.ClockworkMedic.partialExecute(ClockworkMedic.java:154)
      at com.evolveum.midpoint.model.impl.lens.Clockwork.processSecondary(Clockwork.java:794)
      at com.evolveum.midpoint.model.impl.lens.Clockwork.click(Clockwork.java:615)
      at com.evolveum.midpoint.model.impl.lens.Clockwork.run(Clockwork.java:200)
      at com.evolveum.midpoint.model.impl.controller.ModelController.executeChanges(ModelController.java:556)
      at com.evolveum.midpoint.model.impl.controller.ModelController.executeChanges(ModelController.java:343)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      ....
      Caused by: java.lang.RuntimeException: Couldn't find container of type 'class com.evolveum.midpoint.repo.sql.data.common.container.RAssignment' with id '369'
      at com.evolveum.midpoint.repo.sql.helpers.ObjectDeltaUpdater.stepThroughAttribute(ObjectDeltaUpdater.java:922)
      at com.evolveum.midpoint.repo.sql.helpers.ObjectDeltaUpdater.handleRegularModification(ObjectDeltaUpdater.java:214)
      at com.evolveum.midpoint.repo.sql.helpers.ObjectDeltaUpdater.modifyObject(ObjectDeltaUpdater.java:156)
      at com.evolveum.midpoint.repo.sql.helpers.ObjectUpdater.modifyObjectAttempt(ObjectUpdater.java:463)
      ... 125 common frames omitted

      And why is that? Because MP changes effectiveStatus of the assignment to disabled and primary hook deletes same assignment at the same time. Please help or fix this.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              martin.lizner Martin Lizner
              Reporter:
              martin.lizner Martin Lizner
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: