{"record":{"id":"0b4a7eb9de24a26d","repo":"influxdata/influxdb","slug":"operation-was-attempted-past-the-valid-range-0","errorCode":null,"errorMessage":"Operation was attempted past the valid range: {0}","messagePattern":"Operation was attempted past the valid range: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/influxdb_iox_client/src/client/error.rs","lineNumber":96,"sourceCode":"    #[error(\"{0}\")]\n    NotFound(Box<ServerError<NotFound>>),\n\n    #[error(\"Some entity that we attempted to create already exists: {0}\")]\n    AlreadyExists(Box<ServerError<AlreadyExists>>),\n\n    #[error(\"The caller does not have permission to execute the specified operation: {0}\")]\n    PermissionDenied(ServerError<()>),\n\n    #[error(\"Some resource has been exhausted: {0}\")]\n    ResourceExhausted(ServerError<()>),\n\n    #[error(\"The system is not in a state required for the operation's execution: {0}\")]\n    FailedPrecondition(Box<ServerError<PreconditionViolation>>),\n\n    #[error(\"The operation was aborted: {0}\")]\n    Aborted(ServerError<()>),\n\n    #[error(\"Operation was attempted past the valid range: {0}\")]\n    OutOfRange(ServerError<()>),\n\n    #[error(\"Operation is not implemented or supported: {0}\")]\n    Unimplemented(ServerError<()>),\n\n    #[error(\"Internal error: {0}\")]\n    Internal(ServerError<()>),\n\n    #[error(\"The service is currently unavailable: {0}\")]\n    Unavailable(ServerError<()>),\n\n    #[error(\"Unrecoverable data loss or corruption: {0}\")]\n    DataLoss(ServerError<()>),\n\n    #[error(\"The request does not have valid authentication credentials: {0}\")]\n    Unauthenticated(ServerError<()>),\n\n    #[error(\"Received an invalid response from the server: {0}\")]","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/influxdb_iox_client/src/client/error.rs#L78-L114","documentation":"The `Error::OutOfRange` variant, wrapping a `ServerError<()>`. Raised when the operation was attempted past the valid range, mirroring gRPC's OUT_OF_RANGE status — a value was outside the acceptable domain for the operation.","triggerScenarios":"Querying or writing data outside supported bounds: timestamps outside allowed ranges, offset/limit parameters beyond allowed values, partition keys or sequence values exceeding server limits.","commonSituations":"Ingesting data with epoch-0 or far-future timestamps, pagination loops that run past the last page with invalid offsets, time-range filters outside the server's representable range.","solutions":["Clamp or validate numeric values (timestamps, limits, offsets) against documented server limits before the call.","Fix data upstream that carries out-of-range values (bad timestamps are the usual culprit).","Adjust pagination logic to stop when results are exhausted rather than computing further offsets.","Check server configuration for range limits and align client-side bounds with them."],"exampleFix":"// before\nlet ts = 0i64; // epoch 0, out of allowed range\nclient.write(ns, data_with_timestamp(ts)).await?;\n// after\nlet ts = data.timestamp;\nassert!(ts > 0 && ts <= MAX_TS, \"timestamp {ts} out of range\");\nclient.write(ns, data).await?;","handlingStrategy":"validation","validationCode":"fn validate_range(ts: i64) -> Result<i64, String> {\n    if ts <= 0 || ts > MAX_VALID_TS { return Err(format!(\"timestamp {ts} out of range\")); }\n    Ok(ts)\n}","typeGuard":"fn is_out_of_range(e: &Error) -> bool { matches!(e, Error::OutOfRange(_)) }","tryCatchPattern":"match result {\n    Err(Error::OutOfRange(se)) => { eprintln!(\"value out of range: {se}\"); Err(anyhow!(\"range violation\")) }\n    other => other,\n}","preventionTips":["Sanitize timestamps and pagination parameters at data-ingestion boundaries.","Clamp offsets/limits to server-allowed ranges before sending requests.","Terminate pagination when an empty page is returned instead of advancing bounds."],"tags":["grpc","validation","range","influxdb"],"backgroundTag":"value-out-of-range","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}