{"record":{"id":"2e39b3e572b54806","repo":"influxdata/influxdb","slug":"http-error-0","errorCode":null,"errorMessage":"http error: {0}","messagePattern":"http error: (.+?)","errorType":"error_code","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"influxdb3_server/src/lib.rs","lineNumber":66,"sourceCode":"use tokio_util::sync::CancellationToken;\nuse trace::TraceCollector;\nuse trace_http::ctx::TraceHeaderParser;\nuse trace_http::metrics::{MetricFamily, RequestMetrics};\nuse trace_http::tower::{ServiceProtocol, TraceLayer};\nuse unified_service::{RemoteAddrLayer, UnifiedService};\n\npub const PRODUCT_NAME: &str = \"InfluxDB 3 Core\";\npub const INFLUXDB3_BUILD: &str = \"Core\";\n\n/// Version string combining the product name, [`influxdb3_process::INFLUXDB3_VERSION`], and [`influxdb3_process::INFLUXDB3_GIT_HASH`].\npub static VERSION_STRING: LazyLock<String> = LazyLock::new(|| build_version_string(PRODUCT_NAME));\n\n#[derive(Debug, Error)]\npub enum Error {\n    #[error(\"hyper error: {0}\")]\n    Hyper(#[from] hyper::Error),\n\n    #[error(\"http error: {0}\")]\n    Http(#[from] Box<http::Error>),\n\n    #[error(\"database not found {db_name}\")]\n    DatabaseNotFound { db_name: String },\n\n    #[error(\"datafusion error: {0}\")]\n    DataFusion(#[from] datafusion::error::DataFusionError),\n\n    #[error(\"influxdb3_write error: {0}\")]\n    InfluxDB3Write(#[from] influxdb3_write::Error),\n\n    #[error(\"from hex error: {0}\")]\n    FromHex(#[from] hex::FromHexError),\n\n    #[error(\"io error: {0}\")]\n    Io(#[from] std::io::Error),\n\n    #[error(\"tls config error: {0}\")]","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_server/src/lib.rs#L48-L84","documentation":"A variant of influxdb3_server::Error wrapping a boxed http::Error (the http crate's builder error) via #[from]. It indicates a failure constructing an HTTP request or response — e.g. an invalid URI, header value, or method — at the http layer, before hyper sends it.","triggerScenarios":"Building an HTTP request/response with an invalid URI or illegal header value inside the server; code paths that convert an http::Request/Response and the http crate rejects malformed components.","commonSituations":"Programmatically constructed requests containing non-ASCII or control characters in headers; invalid percent-encoding in query paths; bugs in server request-building code surfaced to callers.","solutions":["Check the inner http::Error message for which component (URI, header, method) was invalid","Ensure any programmatically built URIs/headers are properly percent-encoded and contain only valid ASCII header values","If caused by a client-supplied URL, fix the request URL and retry"],"exampleFix":"// before\nlet req = http::Request::builder()\n    .uri(user_input_url) // may be invalid\n    .body(body)?;\n// after\nlet url = user_input_url.parse::<http::Uri>()\n    .map_err(|e| format!(\"invalid url: {e}\"))?;\nlet req = http::Request::builder()\n    .uri(url)\n    .body(body)?;","handlingStrategy":"validation","validationCode":"if let Err(e) = url.parse::<http::Uri>() {\n    return Err(format!(\"invalid request URL: {e}\"));\n}\nfor (k, v) in &headers {\n    http::HeaderValue::from_str(v).map_err(|e| format!(\"bad header {k}: {e}\"))?;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Percent-encode user-supplied path/query segments","Reject non-ASCII header values before building requests","Cover request-building code paths with tests using edge-case URLs"],"tags":["http","request-building"],"backgroundTag":"invalid-url-format","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"}