Article ID: 129344, created on Aug 29, 2016, last review on Aug 29, 2016

  • Applies to:
  • Operations Automation 6.0
  • Operations Automation 5.5

Symptoms

AFinalizing unprovision workflow task fails with the following error:

Task ID         1000000
Queue name      aps_application_instance1000
Task name       APS application 'APPNAME', id 100, instance 1000 -> service 'SERVICENAME', instance 10000: finalizing unprovision workflow
Last execution output   
Internal error: SDK::Platform::blob Plesk::SaaS::SaaSManagerTasks_impl::taskExecuteWorkflowUnprovisionAPS1x(const SDK::Platform::Properties&) : [APSC] ODBC code #HY000: ERROR: update or delete on table "aps_resource" violates foreign key constraint "FK_aps_resource_link_target_resource" on table "aps_resource_link";
Error while executing the query.

Cause

A database inconsistency caused by canceled tasks. Service instance with ID 10000 was required by another service instance.

Resolution

  1. Find ID of the resource corresponding to the service instance that is being removed:

    SELECT id FROM aps_resource WHERE registry_object_id = (SELECT id FROM aps_registry_object WHERE uid = (SELECT uuid FROM aps_service_instances WHERE service_instance_id = 10000));
    id                 | 20000
    
  2. Find ID of the source resource:

    SELECT source_resource_id FROM aps_resource_link WHERE target_resource_id = 20000;
    source_resource_id | 30000
    
  3. Find the service instance ID corresponding to this resource:

    SELECT service_instance_id FROM aps_service_instances WHERE uuid = (SELECT uid FROM aps_registry_object WHERE id = (SELECT registry_object_id FROM aps_resource WHERE id = 30000));
    service_instance_id   | 40000
    
  4. Check if any tasks to remove the service instance 40000 were scheduled. If so, cancel the initial task temporarily. Then, once tasks related to service instance 40000 are processed, re-run the canceled task.

Search Words

ERROR: update or delete on table "aps_resource" violates foreign key constraint "FK_aps_resource_link_target_resource" on table "aps_resource_link";

finalizing unprovision workflow

FK_aps_resource_link_target_resource

5356b422f65bdad1c3e9edca5d74a1ae caea8340e2d186a540518d08602aa065 e12cea1d47a3125d335d68e6d4e15e07 956c448bddc7e1f3585373687602379f 6f1456866eed87488c0f02b298a741c0 5b048d9bddf8048a00aba7e0bdadef37 2554725ed606193dd9bbce21365bed4e

Email subscription for changes to this article
Save as PDF