[Bug]: An artifact removed from an immutable gateway's files still shows as deployed in the control plane
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 57/100
Research direction
Read gateway/gateway-controller/cmd/controller/main.go around line 168, pkg/immutable/loader.go, and pkg/controlplane/sync.go around line 695 to trace startup loading and deployment sync. Reproduce with immutable mode, deployment sync enabled, and two annotated REST API files; remove one and restart the controller. Done when the control plane reports that API as UNDEPLOYED after restart.
Written by the indexing model from the issue text.
Description
Please select the area the issue is related to
Gateway
Please select the aspect the issue is related to
Aspect/Other (Anything else which does not match above categories)
Description
An immutable gateway pushes the artifacts it loads from files to the control plane, and they show as deployed there. When a file is removed and the gateway restarts, the gateway no longer serves that artifact, but it never tells the control plane. The control plane keeps showing the deployment as DEPLOYED with no undeploy.
Observed (deployment sync enabled)
- Two REST API files,
aandb, each with thegateway.api-platform.wso2.com/project-idannotation. After a restart, both appear in the control plane, andb's deployment isDEPLOYED. - I changed
a's display name, removedb's file, and restarted gateway-controller.- The control plane received
a's new display name, so the push after the restart did happen. - The gateway's
GET /rest-apis/banswers 404. - The control plane's
GET /api/v0.9/rest-apis/b/deploymentsstill listsDEPLOYEDand noUNDEPLOYED.
- The control plane received
Expected
After the restart, the control plane shows b's deployment on that gateway as undeployed.
Cause
- Immutable mode deletes the SQLite database on every boot (
gateway/gateway-controller/cmd/controller/main.go:168), so the gateway has no record of what it served before. - The loader only creates what is in the files (
pkg/immutable/loader.go). The connect-time push sends only the artifacts the gateway still has (pkg/controlplane/sync.go:695), so nothing reportsbas undeployed.
Steps to Reproduce
- Start an immutable gateway (SQLite,
[immutable_gateway] enabled = true) connected to platform-api with deployment sync on. Give it two REST API files with the project-id annotation of an existing project. - Check that both APIs show a
DEPLOYEDdeployment in the control plane. - Remove one file and restart gateway-controller.
- The control plane still shows that API's deployment as
DEPLOYED.
Severity Level of the Issue
Severity/Minor (Non-critical functionality. Can be fixed in future releases)
Environment Details (with versions)
Current main (0ee943ff4). Platform-api and gateway built from source and run by the IT suite (tests/framework), with the gateway on SQLite, on macOS with Rancher Desktop.
- Dominant language
- Go
- Stars
- 85
- Forks
- 137
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 247
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from wso2/api-platform
-
Area/DeveloperPortal Aspect/UI Severity/Minor Type/Bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
wso2/api-platform#4369 ·
Maintainers usually reply within 1 day
-
[Bug]: host-rewrite policy documentation lists fewer allowed host characters than the policy acceptsOpenArea/Policies Aspect/Other Severity/Trivial Type/Bug
Difficulty 1/5 Under an hour Newbie friendliness 91/100
wso2/api-platform#4355 ·
Maintainers usually reply within 1 day
-
Area/Gateway Aspect/API Severity/Minor Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
wso2/api-platform#4348 ·
Maintainers usually reply within 1 day
-
Aspect/AI Aspect/API. Severity/Major
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
wso2/api-platform#4343 ·
Maintainers usually reply within 1 day
-
Area/Policies Aspect/Configuration Severity/Minor Type/Bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
wso2/api-platform#4330 ·
Maintainers usually reply within 1 day
All issues in wso2/api-platform
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Inconsistency between golang and cue in specPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
security
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Tencent/LoopForge#1087 · 1 comment ·
Maintainers usually reply within 1 day