Skip to content

Error reporting: one HTTP status table, variable names in plan errors, plan errors before the stream's head #2085

Open

Description

@aaj3f

A handful of places where an error is raised, classified or worded by a different path than the one that should own it, so the same failure can come out differently depending on the route or the moment.

  • One HTTP status table. The server maps errors to statuses in ServerError::status_code (fluree-db-server/src/error.rs) and never consults ApiError::status_code (fluree-db-api/src/error.rs), so the two can disagree: every ApiError::Transact(_) without its own server arm is a 400 on direct routes, whatever the API table says, while the consensus path flattens through ApiError::status_code. So one error can carry different statuses on different routes. Derive one table from the other, or add a test that they agree for every variant.
  • Plan errors outside the grouped tail still print variable ids. A sort key the plan lost is one (a key nothing binds is now dropped instead). fix(query): evaluate grouped SELECT expressions once per group #2006's grouped-read and aggregate-variable errors show the pattern: a typed error carrying the id, named by QueryError::name_variables. (The search operators' unbound-input checks are the other instance; they're in Search operators: placement before the pattern that binds their input, and unbound-input errors #2084 with the rest of the search-operator work.)
  • A plan-time error on the stream arrives after the head record. Since fix(query): evaluate grouped SELECT expressions once per group #2006 the grouped reads are checked before the head, but any other plan-time error still comes after the 200 has gone out. Building the plan before the 200 would close the class, but it moves reasoning and planning ahead of the response, which is a latency trade-off I'd rather decide on its own. Needs a decision.
  • SHACL sh:select skips SPARQL validation. A shape's query never goes through the SPARQL validator's checks (V4 and the rest), so a malformed shape surfaces only when it's planned, as a plan error, instead of as the validator's named error.

From #2006 (Follow-ups: sh:select and the SPARQL validator; plan errors that print variable ids; the stream's plan-time error) and #2009 (Follow-ups: one HTTP status table).

Activity

  1. added
    bug
    P3
    area:server
    on Oct 12, 2026
  2. aaj3f commented on Oct 13, 2026

    @aaj3f
    ContributorAuthor

    One more row for the table, found while reviewing the vector-length PR: TransactError::Core isn't special-cased, so on the transact path it falls through to the generic 400 arm (fluree-db-api/src/error.rs:740), whatever its cause.

    That includes failures that come from process state rather than the request, e.g. a write refused because the ledger's index failed to load. A 400 tells a client to drop the write, when retrying after the server recovers would succeed. On Raft the commit worker then treats that 400 as malformed input and answers 422. Solo, which classifies by error type rather than status, treats the same error as transient and redelivers, so today db's status and solo's handling disagree for this class.

    The fix is a mapping decision for the whole class, not one error: split Core into the request-caused cases (fuel exhausted, limits) that should stay 4xx and the state-caused ones that should be 5xx, and keep solo's classifier in lockstep.

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

    P3area:serverbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions