{"record":{"id":"a797bb625c098855","repo":"influxdata/influxdb","slug":"the-service-is-currently-unavailable-0","errorCode":null,"errorMessage":"The service is currently unavailable: {0}","messagePattern":"The service is currently unavailable: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/influxdb_iox_client/src/client/error.rs","lineNumber":105,"sourceCode":"    #[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}\")]\n    InvalidResponse(#[from] FieldViolation),\n\n    #[error(\"An unexpected error occurred in the client library: {0}\")]\n    Client(StdError),\n}\n\nimpl From<Status> for Error {\n    fn from(s: Status) -> Self {\n        match s.code() {","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/influxdb_iox_client/src/client/error.rs#L87-L123","documentation":"This Error variant maps a gRPC Status with code UNAVAILABLE into \"The service is currently unavailable: {0}\". It indicates the IOx service is temporarily unreachable or refusing work — the server-side analogue of HTTP 503. The From<Status> conversion in core/influxdb_iox_client/src/client/error.rs produces it whenever the channel or server reports an unavailable status.","triggerScenarios":"Server restarting or being drained during a deploy; gRPC channel to the IOx namespace failing to connect; server shedding load and returning UNAVAILABLE; network interruption between client and server.","commonSituations":"Rolling restarts of an IOx cluster; Kubernetes pod rescheduling while a write is in flight; overload/adaptive-throttling messages from the server; DNS or service mesh temporarily unable to route to the backend.","solutions":["Retry the request with exponential backoff and jitter — UNAVAILABLE is explicitly retryable in gRPC semantics.","Check server/cluster health (pods ready, listeners up) and recent deploy events.","Recreate the gRPC channel if the failure persists, as stale connections can keep returning unavailable statuses.","If load-shedding is the cause, throttle client write/query rate or add server capacity."],"exampleFix":"// before: single attempt, no distinction\nlet resp = client.query(req).await?;\n// after: retry only on Unavailable with backoff\nlet mut delay = Duration::from_millis(100);\nlet resp = loop {\n    match client.query(req.clone()).await {\n        Err(Error::Unavailable(server_err)) => {\n            tokio::time::sleep(delay).await;\n            delay = (delay * 2).min(Duration::from_secs(10));\n        }\n        other => break other?,\n    }\n};","handlingStrategy":"retry","validationCode":"// health-check the endpoint before the real request\nclient.health().await.expect(\"service should be reachable\");","typeGuard":"fn is_unavailable(e: &client::Error) -> bool {\n    matches!(e, client::Error::Unavailable(_))\n}","tryCatchPattern":"let res = retry_with_backoff(max_retries, jitter, || async {\n    match client.query(req.clone()).await {\n        Err(Error::Unavailable(_)) => Err(Retryable),\n        other => other.map_err(|e| e.into()).map_err(Fatal),\n    }\n}).await;","preventionTips":["Always implement exponential backoff with jitter for UNAVAILABLE","Monitor cluster health and deploy windows","Cap write/query rates to avoid server load-shedding"],"tags":["grpc","rust","influxdb-iox","availability","retry"],"backgroundTag":"http-error-status","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"}