[midPoint] duplicate key value violates unique constraint "m_shadow_primidval_objcls_resrefoid_key"

Pavol Mederly mederly at evolveum.com
Wed Aug 3 10:56:58 CEST 2022


Hello Hsin-Fang,

there is a troubleshooting piece of code related to that exception:

https://github.com/Evolveum/midpoint/blob/5e841416523a6d46431443d36b056e91ada0b9f1/provisioning/provisioning-impl/src/main/java/com/evolveum/midpoint/provisioning/impl/shadows/ShadowAcquisition.java#L188-L196

You should enable the respective DEBUG logging and midPoint will provide 
you with more information.

Best regards,

-- 
Pavol Mederly
Software developer
evolveum.com

On 03/08/2022 10:53, Hsin-Fang Hsu via midPoint wrote:
>
> Hi,
>
> I upgraded midpoint from 4.4.1 (postgresql) to 4.4.2 (postgresql native).
>
> The data was exported and imported into the database using ninja and 
> the content in the new database also seems to be fine.
>
> ADLdapConnector v3.3 is used.
>
> AD test connection works. But when I tried to access any AD account, I 
> got these kind of errors:
>
> com.evolveum.midpoint.util.exception.SystemException: Unexpected 
> repository behavior: object already exists error even after we 
> double-checked shadow uniqueness: Conflicting object already exists, 
> constraint violation message: ERROR: duplicate key value violates 
> unique constraint "m_shadow_primidval_objcls_resrefoid_key" Detail: 
> Key (primaryidentifiervalue, objectclassid, 
> resourcereftargetoid)=(bc1cd126-81dc-4c2a-acd0-b30eafdc40ef, 11, 
> 412a9b5d-4c88-4a64-a281-2995d46146c8) already exists.
>
> Error resolving object with oid 
> 'eb303210-59dd-499f-bbca-9c57cefa3295': Unexpected repository 
> behavior: object already exists error even after we double-checked 
> shadow uniqueness: Conflicting object already exists, constraint 
> violation message: ERROR: duplicate key value violates unique 
> constraint "m_shadow_primidval_objcls_resrefoid_key" Detail: Key 
> (primaryidentifiervalue, objectclassid, 
> resourcereftargetoid)=(b035b94c-e127-466a-9011-1e4a2dc41fc5, 17, 
> 412a9b5d-4c88-4a64-a281-2995d46146c8) already exists.
>
> I guess the error occurs because midpoint try to save what it reads 
> from AD to a new shadow but that shadow already exists in the 
> database. But the configuration works fine in 4.4.1. How can I solve this?
>
> Thank you very much for your help in advance!
>
> Best regards,
>
> Hsin-Fang
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> https://lists.evolveum.com/mailman/listinfo/midpoint
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20220803/4a76424d/attachment.htm>


More information about the midPoint mailing list