Repository navigation
Description
Bug
nextLink on a paginated LIST response leaks the serving RP's cluster-internal address, so any client that is not inside the cluster cannot follow it.
Observed from a GitHub Actions runner talking to a k3d control plane through the Kubernetes API-server proxy:
Error: Get "http://dynamic-rp.radius-system:8082/planes/radius/local/resourcegroups/default/providers/Radius.Compute/containers?api-version=2025-08-01-preview&skipToken=MjAyNi0wOC0xOVQyMjo1MjoyNi4zNjc5MDha&top=10": dial tcp: lookup dynamic-rp.radius-system on 127.0.0.53:53: no such host
The first page succeeds over the proxied connection. The second page fails, because rad follows the returned absolute URL verbatim and dynamic-rp.radius-system is not resolvable outside the cluster.
Practical impact: rad app delete fails during resource enumeration, before anything is deleted, for any application with more than one page of resources of a single type (top=10 by default). The application is left undeletable. This is not delete-specific though — it affects any paginated LIST for any non-in-cluster caller.
Root cause
GetNextLinkURL builds the link from the inbound request, and GetURLFromReqWithQueryParameters takes the host straight from req.Host:
https://github.com/radius-project/radius/blob/main/pkg/armrpc/frontend/controller/util.go
func GetURLFromReqWithQueryParameters(req *http.Request, qps url.Values) *url.URL {
url := url.URL{
Host: req.Host,
Scheme: req.URL.Scheme,
Path: req.URL.Path,
RawQuery: qps.Encode(),
}
...
}When UCP proxies a LIST downstream to an RP, req.Host as seen by that RP is the internal service address (dynamic-rp.radius-system:8082), not the address the caller used. So the emitted nextLink is only valid from inside the cluster.
The caller-visible host is already available
UCP's proxy forwards the original host and scheme downstream — see pkg/ucp/proxy/testdata/arm/basic-roundtrip/downstream-request.json:
{
"url": "http://example.com/some-path?query=yes",
"method": "GET",
"headers": {
"X-Forwarded-Host": ["ucp.example.com"],
"X-Forwarded-Proto": ["http"],
"traceparent": ["traceid"]
},
"body": ""
}GetURLFromReqWithQueryParameters simply ignores them.
Suggested fix
Prefer X-Forwarded-Host / X-Forwarded-Proto when present, falling back to req.Host and the existing default scheme. That fixes the link for every RP and every paginated LIST in one place, with no change required in the CLI.
An alternative (or additional) mitigation is to have the CLI re-base a returned nextLink onto the workspace's connection endpoint rather than dialing it directly, which would also harden the client against a misconfigured RP.
Repro
- Model an application with more than 10 resources of the same type (e.g. 10+
Radius.Compute/containers). - Deploy it to a cluster where the control plane is reached through the API-server proxy rather than from inside the cluster.
- Run
rad app delete <name> --yes --preview. - The second page of the container listing is dialed at
http://dynamic-rp.radius-system:8082/...and fails DNS resolution.
Originally reported downstream as radius-project/ai-extensions#441.
Related
- A workflow-level mitigation for the delete workflows (aliasing the control-plane services onto loopback before the delete) is being proposed separately in
.github/extension/actions/delete-resource. That unblocks the delete path only; this issue tracks the actual leak.
Activity
radius-triage commentedon Aug 26, 2026
👋 @nithyatsu Thanks for filing this bug report.
A project maintainer will review this report and get back to you soon. If you'd like immediate help troubleshooting, please visit our Discord server.
For more information on our triage process please visit our triage overview
Document the upstream fix for paginated delete listings
nithyatsu commentedon Aug 26, 2026
Correcting the root-cause analysis in the issue description
My original write-up said the fix was to have the resource provider build the
nextLinkfromX-Forwarded-Host. That is wrong on two counts, and I want the corrected analysis recorded here before anyone picks this up.1. The RP cannot know its client-facing identity.
UCP sets
X-Forwarded-Hostfrom its own inbound host (pkg/ucp/proxy/types.go→SetXForwarded()). When the CLI reaches UCP through the aggregated APIService, the Kubernetes aggregator has already thrown the original host away:That is kubernetes/kubernetes#107435 — the exact bug
pkg/sdk/connection_location.goalready documents. So honoring the header only swapsdynamic-rp.radius-system:8082for the UCP service address. Both are in-cluster; an external client can reach neither.2. RPs are not a client-facing surface.
Only UCP is exposed to a CLI, so the follow-up page must go back through UCP. Any fix that makes the client dial the RP directly (for example aliasing the RP's in-cluster DNS name on the client) is routing around plane resolution and is not viable.
The mechanism that already exists
UCP fixes up response URLs for exactly this reason, in two stages:
ProcessAsyncOperationHeaders(pkg/ucp/proxy/async.go) rebuildsLocation/Azure-AsyncOperationfrom theRefererheader, which UCP sets atpkg/ucp/frontend/controller/radius/proxy.go:220from its inbound host and full path. That restores the/apis/api.ucp.dev/v1alpha3path base and the/planes/<type>/<name>prefix the RP never sees.locationRewriteRoundTripper(pkg/sdk/connection_location.go) rebases the host onto the client's real endpoint, becauseRefereronly carries UCP's inbound host.nextLinkgets neither, purely because it lives in the response body instead of a header. That is the whole bug.Fix
Give
nextLinkthe same two-stage treatment:ProcessAsyncOperationHeadersthat rewritesnextLinkin the JSON body, reusing the existingrewriteHeaderpath logiclocationRewriteRoundTripperto rebasenextLink's host as it already does forLocationThis keeps pagination flowing through UCP and fixes external clients generally, not just CI.
For the record: #12839 (make the runner dial the RP directly) and #12841 (honor
X-Forwarded-Hostin the RP) were both wrong and are closed.Return a relative paginated nextLink so clients can reach the next page
Return a relative paginated nextLink so clients can reach the next pa…