Layer 7 CA API Developer Portal - UniqueKeyConflict error updating portal integration
search cancel

Layer 7 CA API Developer Portal - UniqueKeyConflict error updating portal integration

book

Article ID: 234361

calendar_today

Updated On:

Products

CA API Gateway CA API Developer Portal

Issue/Introduction

Attempting to update the portal integration component from 'Policy Manager->Tasks->Extensions And Add-Ons->Update Portal Integration' results in the following error seen in the generated output and the update fails:

<l7:Mapping action="NewOrExisting" errorType="UniqueKeyConflict" srcId="07abf4540a8e97558800############" type="SCHEDULED_TASK">
                <l7:Properties>
                    <l7:Property key="ErrorMessage">
                        <l7:StringValue>(name)  must be unique</l7:StringValue>
                    </l7:Property>
                </l7:Properties>
            </l7:Mapping>

Environment

CA API Gateway

CA API Developer Portal

Cause

The portal scheduled tasks are expected to have a particular id associated with them.  In this case the Portal Sync API scheduled task within this environment had an id which was different from the expected value of 07abf4540a8e97558800############

Resolution

Recreate the Portal Sync API scheduled task with the appropriate id.

1) Execute the following Restman call to get the output of all existing scheduled tasks:

https://GatewayHostName:8443/restman/1.0/scheduledTasks

2) Copy that data off to a text file for later use

3) From Policy Manager->Tasks->Global Settings->Manage Scheduled Tasks->Choose the Portal Sync API task and then select the 'Remove' button to delete it from the environment.

4) Use a utility like postman to generate a call to create the scheduled task with the appropriate id.

HTTP Method: PUT

Authorization: Basic Auth , specify a policy manager admin user and password

request to execute: https://GatewayHostName:8443/restman/1.0/scheduledTasks/07abf4540a8e97558800############

Body of request:  Copy your Portal Sync API data which we produced earlier on in step 1 and formulate a request body which looks similar to the following:

<l7:ScheduledTask xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
<l7:Name>Portal Sync API</l7:Name>
<l7:PolicyReference id="b181a5210c08830073fd############" resourceUri="http://ns.l7tech.com/2010/04/gateway-management/policies"/>
<l7:OneNode>true</l7:OneNode>
<l7:JobType>Recurring</l7:JobType>
<l7:JobStatus>Scheduled</l7:JobStatus>
<l7:CronExpression>0 */3 * * * ?</l7:CronExpression>
<l7:ExecuteOnCreate>false</l7:ExecuteOnCreate>
<l7:Properties>
<l7:Property key="idProvider">
<l7:StringValue>0000000000000000ffff############</l7:StringValue>
</l7:Property>
<l7:Property key="userId">
<l7:StringValue>00000000000000000000############</l7:StringValue>
</l7:Property>
</l7:Properties>
</l7:ScheduledTask>

5)Execute the above request and the Portal Sync API scheduled task should get recreated and seen within policy manager

6)Attempt to update the portal integration components once again.

Additional Information

The error which was originally generated when attempting to update the portal integration indicated a conflict with a particular scheduled task id of 07abf4540a8e97558800############.  This value is specific to the Portal Sync API scheduled task. If a different value is seen then please contact support so a determination can be made as to which scheduled task is having a conflict in the environment.