Native ALB forwarding bypasses service-request callbacks; supported pre-routing extension hook? (Pro dev230) #81
AndreKurait
started this conversation in
Bugs (AWS)
Replies: 1 comment
|
Hi @AndreKurait! Thanks for bringing this up! LocalStack Extensions are currently in Preview, where our intention is to provide a method to extend LocalStack with additional tools and integrations. The explicit API is |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Observed behavior
On licensed stock
localstack/localstack-pro:dev2026.11.0.dev230 (build 558bad4c, tested 2026-10-20), a request forwarded through the native ALB gateway route bypasses callbacks appended tolocalstack.gateway.handlers.serve_custom_service_request_handlers.The same callback executes for ordinary SDK API requests. A callback appended to
handlers.preprocess_requestexecutes for the ALB-forwarded request and its injected header reaches the target. Native ALB forwarding itself succeeds with HTTP 200.This is an extension compatibility report: integrations doing request-header adaptation in the service-request callback do not see native ALB traffic. Please confirm whether this ordering is intentional and what supported extension hook should be used for processing requests before native ALB routing. If these callbacks are deliberately service-API-only, a documented supported pre-routing hook/migration path would address the compatibility gap rather than changing route ordering.
Environment
sha256:fbe339f5b5d893e5bac43472af717964e09d00844d4aeecbce4b287b02ffb553.sha256:b8d3cad6b383453d3d61a85bb0884cb903d90a409c672c9503a784d95ebf8097.Reproduction
The following is a reduced version of the component probe used for the observations below. The complete probe also inspected stores and tested name collisions; those unrelated checks are omitted here. Save the files as
hook.pyandrepro.pyin an empty directory. Export your existingLOCALSTACK_AUTH_TOKENwithout placing its value in either file.Run in a disposable Docker network (choose an unused subnet if this one conflicts with your environment):
hook.py:repro.py:Actual observations from the complete component probe
{ "native_alb_forwarding_succeeded": true, "preprocess_reached_target": true, "service_callback_reached_target": false, "service_callback_positive_control": true }The target received
X-Audit-Preprocess: observed, but noX-Audit-Service-Callbackheader. The event log contains a preprocessing event for/audit-forward, no service callback event for that path, and service callback events for ordinary SDK requests to/. This rules out the service callback simply failing to register.Requested behavior / clarification
Please provide or document a supported extension hook that runs before native ALB forwarding, allowing request-header adaptation. If
update_request_handlers/ the service-request callback is intended to cover this traffic, please investigate the skipped invocation. The preprocessing list works in this build, but it would help to know the supported integration contract before depending on that internal registration point.Related store migration observation (not a separate AWS API defect)
The same runtime creates native ALBs in
localstack.pro.core.services.elbv2.models.elbv2_stores, while the corresponding Motoelbv2_backendsregistry is empty. A Moto-only registry inspection therefore no longer discovers native ALBs. An integration updated to inspect the Pro store found the unique ALB and still rejected same-name collisions across accounts and against classic ELB.We recognize that Moto registry internals need not be a supported extension interface. This is included as migration context and a request for a supported discovery interface/documentation, not a claim that the Pro store migration itself is incorrect. The ALB callback ordering can be reproduced independently using the files above.
All reactions