Unable to delete an unsuccessfully deployed app while using i2Edge
Description:
When an application deployment fails, the application instance remains undeletable through the LCM API. This happens even though the instance was registered and partially processed by the i2Edge component.
Steps to Reproduce:
Deploy an application using the LCM API:
POST http://{{fm_ip}}:{{fm_port}}/{{url_path}}/{{federationContextId_internal}}/application/lcm
{
"appId": "{{app_id}}",
"appVersion": "{{app_version}}",
"appProviderId": "{{app_provider_id}}",
"zoneInfo": {
"zoneId": "{{zone_id}}",
"flavourId": "{{flavour_id}}"
},
"appInstCallbackLink": ""
}
The API responds successfully, confirming the deployment attempt:
{
"appInstIdentifier": "ollama8771255072148",
"zoneId": "f0662bfe-1d90-5f59-a759-c755b3b69b93"
}
However, the actual deployment fails.
This can be verified with:
GET http://{{fm_ip}}:{{fm_port}}/{{url_path}}/{{federationContextId_internal}}/application/lcm/app/{{app_id}}/instance/{{app_instance_id}}/zone/{{zone_id}}
Response:
{
"detail": "Partner API error: HTTP 500: {\n \"detail\": \"Error while retrieving federation. Reason: Failed to get: Expected status 200, got 503. Detail: App not deployed successfully. Current pod status is: FAILED\",\n \"status\": 500,\n \"title\": \"Internal Server Error\",\n \"type\": \"about:blank\"\n}\n",
"status": 500,
"title": "Internal Server Error",
"type": "about:blank"
}
Attempting to delete the failed instance also results in the same error:
DELETE http://{{fm_ip}}:{{fm_port}}/{{url_path}}/{{federationContextId_internal}}/application/lcm/app/{{app_id}}/instance/{{app_instance_id}}/zone/{{zone_id}}
Response:
{
"detail": "Partner API error: HTTP 500: {\n \"detail\": \"Error while retrieving federation. Reason: Failed to get: Expected status 200, got 503. Detail: App not deployed successfully. Current pod status is: FAILED\",\n \"status\": 500,\n \"title\": \"Internal Server Error\",\n \"type\": \"about:blank\"\n}\n",
"status": 500,
"title": "Internal Server Error",
"type": "about:blank"
}
Expected Behaviour:
It should be possible to delete an application instance regardless of its deployment status — whether it was successfully deployed, failed during deployment, or partially instantiated.
The deletion endpoint should handle failed or incomplete deployments gracefully and remove all related metadata and references in the Federation Manager.