API gateway Enrollment fails with UniqueKeyConflict error message
search cancel

API gateway Enrollment fails with UniqueKeyConflict error message

book

Article ID: 193510

calendar_today

Updated On: 10-12-2023

Products

CA API Gateway

Issue/Introduction

When enrolling the API gateway to the API Portal, the enrollment fails with a UniqueKeyConflict .

targetUri="/1.0/policies/fa95364d3f5876ac66e53090b69a1498" type="POLICY"/>
            <l7:Mapping action="NewOrUpdate" errorType="UniqueKeyConflict" srcId="b4bff64ea3a845db60b78151a87dc1e2" type="POLICY">
                <l7:Properties>
                    <l7:Property key="ErrorMessage">
                        <l7:StringValue>(name) (internalTag, type)  must be unique</l7:StringValue>
                    </l7:Property>
                </l7:Properties>
            </l7:Mapping>
            <l7:Mapping action="NewOrExisting" actionTaken="CreatedNew" srcId="e1b68aeecf2e5c477d2fee2096af72cd"

OTK is installed and upgraded to the latest version. 

Environment

All supported versions of the API Gateway

All supported versions of the API Portal

Cause

There is nothing in the database related to that source ID. Verify if you are using global policies, especially the message_recieved policy.

Resolution

If there is already a global policy for "message_recieved", the gateway enrollment will fail as there can only be one global policy with this tag.

This would relate to the error <l7:StringValue>(name) (internalTag, type)  must be unique</l7:StringValue>

You can only have one global policy for type message_recieved and you have to back it up (if there is data present) and delete it to complete the enrollment.