Skip to content

elb: DescribeAccountLimits is authorizable but not dispatched, so it answers unknownActionError #885

Closed

Description

@scttfrdmn

ELBPlugin.HandleRequest's action switch (emulator/elb_plugin.go:47-95) has no DescribeAccountLimits arm, so the call falls to unknownActionError — although substrate's own authorization data already carries the action (emulator/authz_reference_gen.go:1424, "elasticloadbalancing:DescribeAccountLimits": {}) and AWS publishes the operation for both generations.

So a caller can be authorized for an action substrate then refuses to perform. It is also the one shared action name of the nine that does not route anywhere — a correction to #844, whose body says all nine route to v2.

What AWS publishes — verified from both API references

Both generations take the same two request parameters and return the same two elements:

Classic (elasticloadbalancing-2012-06-01) v2 (elasticloadbalancingv2-2015-12-01)
Marker "The marker for the next set of results. (You received this marker from a previous call.)" String, not required identical wording
PageSize Integer, "Minimum value of 1. Maximum value of 400.", not required identical
Limits.member.N Array of Limit Array of Limit
NextMarker "The marker to use when requesting the next set of results. If there are no additional results, the string is empty." "If there are additional results, this is the marker for the next set of results. Otherwise, this is null."
Errors CommonErrors only — the page publishes no operation-specific error same

Note the NextMarker sentence differs between the two generations: classic documents an empty string when exhausted, v2 documents null. That is a published difference, not a paraphrase, and it belongs in whatever renders it.

Limit (API_Limit) is Max (String — not an integer) and Name (String), both optional. The two generations differ on whether the names are enumerated:

  • Classic's API_Limit enumerates exactly three: "The possible values are: classic-listeners, classic-load-balancers, classic-registered-instances".
  • v2's API_Limit enumerates none — it says only "The name of the limit." and points at the three quota user guides (Application, Network, Gateway Load Balancers). So the v2 name set is not published on the API reference page; any list of them is taken from a user guide, and must be labelled as such rather than presented as the API model.

PageSize 1–400 matches elbMaxPageSize territory already in the plugin for the other Describes, and Marker matches the existing cursor pattern — so pagination reuses what is there.

The interesting design question

Substrate has no quota model. The limits are constants, not derived from state, which means this operation reports numbers that no part of substrate enforces. Two readings, and the issue should settle which before implementing:

  1. Report AWS's default quotas as constants. A caller reading a limit gets a plausible number, and a caller that computes headroom against it gets an answer substrate will then not enforce — a value that does not come from where it appears to, which is the exact defect class v0.116.0 was spent removing.
  2. Report the limits and make them seedable, so a test can drive a consumer's "approaching my quota" path — which is the reason a caller polls this operation at all. This fits the house seeding pattern (POST/DELETE /v1/elb/... keyed by limit name or "*") and turns a decorative constant into something a test can use.

(2) is the better fit for substrate's stated purpose, and it is barely more work than (1) — the constants become the default seed value. Whichever is chosen, docs/services.md must record that no operation enforces these numbers.

Which generation is answered follows whatever #844 decides about dispatch: today the plugin serves v2 shapes under both API versions, so until classic dispatch exists there is one handler, and its Limit.Name set should be the v2 one.

Acceptance criteria

  • DescribeAccountLimits dispatches, is authorized against elasticloadbalancing:DescribeAccountLimits (already in the authz data — no authz-reference change), and answers Limits.member.N plus NextMarker.
  • PageSize is honoured with the documented 1–400 range, and a value outside it is handled the way substrate's other ELB paginators handle theirs — consistently, whichever that is.
  • Marker round-trips over a stable order, so a paged walk returns each limit exactly once. This depends on the deterministic List order shipped in state: MemoryStateManager.List returns keys in Go map order, so 111 call sites answer differently run to run #865.
  • Max is rendered as a string, per API_Limit.
  • The limit names are recorded with their provenance: classic's three are enumerated on API_Limit; v2's are not published there and come from the quota user guides.
  • The quota-enforcement question above is settled on the issue, and the answer recorded in docs/services.md — including, explicitly, that nothing in substrate enforces the number it reports.
  • If seedable: a control-plane endpoint following the established pattern, and a test that seeds a low limit and reads it back over the wire.
  • Behavioural test through StartTestServer and a real wire call, asserting on raw XML — the member set and the wrapper name, since botocore raises KeyError on a wrapper mismatch (docs/services.md:7429-7437).

Found while auditing #844's claim that all nine shared action names route to v2; eight do.

Activity

  1. added
    type: bug
    on Sep 15, 2026
  2. added this to the v0.117.0 milestone on Sep 15, 2026
  3. scttfrdmn commented on Sep 15, 2026

    @scttfrdmn
    OwnerAuthor

    Settling the design question before implementing: option 2 — the limits are reported and seedable, with AWS's published defaults as the default seed value.

    The reasoning is the one this issue already states, and it is the release theme applied to itself. Substrate enforces no ELB quota anywhere, so a constant reported here is a number that does not come from where it appears to. Option 1 hands a caller computing headroom an answer substrate will then not enforce; option 2 turns the same constant into the thing a caller polls this operation for — driving its own "approaching my quota" path — at essentially the same cost, since the constants become the default.

    Consequences to carry into the PR:

    • Seed follows the established pattern — POST/DELETE /v1/elb/account-limits, keyed by limit name or the "*" wildcard, specific-then-wildcard resolution. ec2FleetShortfall (emulator/ec2_fleet_control.go:14-46) is the shape to copy: a namespace constant, a key builder, resolveX trying the specific key then "*", and the two control handlers.
    • docs/services.md must state explicitly that nothing in substrate enforces the number this operation reports, seeded or defaulted. That sentence is the whole point of choosing option 2 honestly rather than presenting a plausible constant.
    • One handler, v2 shapes, per the issue's own note that dispatch generation follows elb: the classic (2012-06-01) Elastic Load Balancing API is unrouted, so aws elb create-load-balancer is refused for a v2 parameter name #844. So Limit.Name takes the v2 set.
    • The name provenance splits and must be recorded as such: classic's API_Limit enumerates exactly three (classic-listeners, classic-load-balancers, classic-registered-instances); v2's API_Limit enumerates none — it says only "The name of the limit" and points at the three Load Balancer quota user guides. So every v2 name substrate reports is taken from a user guide, not from the API model, and the doc comment says so. That distinction is exactly the kind this project has been recording release over release; do not present a user-guide list as the published API model.
    • NextMarker's documented semantics differ between generations — classic publishes an empty string when exhausted, v2 publishes null. Since the handler answers v2 shapes, it follows v2, and the difference is recorded against the day classic dispatch arrives (elb: the classic (2012-06-01) Elastic Load Balancing API is unrouted, so aws elb create-load-balancer is refused for a v2 parameter name #844).
    • Max renders as a String, per API_Limit. It is the kind of member a caller's code will try to treat as an integer, so the raw-XML assertion matters.

    No authorization-reference change is needed: elasticloadbalancing:DescribeAccountLimits is already present with an empty resource list (emulator/authz_reference_gen.go:1424), so the handler needs only its p.authorize(...) line — which is the whole reason this was authorizable-but-undispatched in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions