unregisterResource() returns an error when trying to delete a resource.
Original Publishing Date:
2020-01-22
Symptoms
I'm seeing an error when trying to delete a resource using unregisterResource()
method in APS PHP runtime:
Internal Server Error: Request to APS controller failed: "{ "error": "APS::Util::Exception", "message": "Application of specified resource does not match: given `2ed15c55-8bd0-42c3-86e7-6c042d5b8251` expected `1e95d486-d5eb-4129-a491-d998b97e3656`." } ".
Cause
unregisterResource()
can delete only resources that belong to the application itself.
Resolution
Use unprovisionResource()
to delete POA resources (domains, dns records etc).
More on PHP runtime
Internal content
Link on internal Article