wso2 / wso2/api-platform

[Bug]: Deleting a gateway removes its deployments without undeploying them

Open
#3,461 0 comments 0 reactions 1 assignee View on GitHub

@dakshina99 is already working on this.

Since Sep 16, 2026.

Area/Platform-API bug Type/Bug
Dominant language
Go
Stars
71
Forks
111
Avg merge
1d 14h
Merged PRs (30d)
110

Description

Please select the area the issue is related to

Platform API

Please select the aspect the issue is related to

Aspect/API (API backends, definitions, contracts, interfaces, OpenAPI)

Description

Deleting a gateway removes its deployment records from the control plane but never tells the gateway to stop serving them.

GatewayService.DeleteGateway goes straight to GatewayRepo.Delete, which deletes deployments, deployment_status, artifact_gateway_mappings and artifact_secret_refs for the gateway and then the gateway row. No undeployment event is published for any of those deployments.

A connected gateway therefore keeps serving every artifact it had. The control plane has forgotten the deployments, so there is no record left to undeploy afterwards either — the artifacts stay live on the data plane with nothing tracking them.

Deleting the gateway should first undeploy what it is running, then remove the records. The undeployment events are published through the event hub rather than written straight to the socket, so this does not depend on the gateway being connected at the time: a gateway that is offline when it is deleted simply has its control-plane records removed, which is the correct end state.

Steps to Reproduce
  1. Deploy an artifact to a gateway and let the gateway acknowledge it (status DEPLOYED).
  2. Delete that gateway (DELETE /gateways/{gatewayId}).
  3. Observe the gateway still serving the artifact, while the control plane no longer lists any deployment for it.
Expected Behavior

Deleting a gateway undeploys everything currently deployed on it, then removes the deployment records and the gateway. A gateway that is not connected at the time is still removed cleanly along with its records.

cc @nuwand @dushaniw

Actual Behavior

The deployment records are deleted with no undeployment event, leaving the artifacts serving on the gateway with nothing in the control plane referring to them.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.