{"record":{"id":"589e080a7599e990","repo":"influxdata/influxdb","slug":"error-validating-database-name-0","errorCode":null,"errorMessage":"error validating database name: {0}","messagePattern":"error validating database name: (.+?)","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"influxdb3_server/src/http.rs","lineNumber":235,"sourceCode":"    InvalidContentType { expected: mime::Mime },\n\n    /// The client disconnected.\n    #[error(\"client disconnected\")]\n    ClientHangup(Box<dyn std::error::Error + Send + Sync>),\n\n    /// The client sent a request body that exceeds the configured maximum.\n    #[error(\"max request size ({0} bytes) exceeded\")]\n    RequestSizeExceeded(usize),\n\n    /// Decoding a gzip-compressed stream of data failed.\n    #[error(\"error decoding gzip stream: {0}\")]\n    InvalidGzip(std::io::Error),\n\n    #[error(\"invalid mime type ({0})\")]\n    InvalidMimeType(String),\n\n    /// DatabaseName validation error.\n    #[error(\"error validating database name: {0}\")]\n    InvalidDatabaseName(#[from] DatabaseNameError),\n\n    /// Failure to decode the provided line protocol.\n    #[error(\"failed to parse line protocol: {0}\")]\n    ParseLineProtocol(influxdb_line_protocol::Error),\n\n    /// The router is currently servicing the maximum permitted number of\n    /// simultaneous requests.\n    #[error(\"this service is overloaded, please try again later\")]\n    RequestLimit,\n\n    /// The request has no authentication, but authorization is configured.\n    #[error(\"authentication required\")]\n    Unauthenticated,\n\n    /// The provided authorization is not sufficient to perform the request.\n    #[error(\"access denied\")]\n    Forbidden,","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_server/src/http.rs#L217-L253","documentation":"This error wraps DatabaseNameError raised while validating a database name supplied to the InfluxDB 3 HTTP API. The server enforces naming rules (charset, length, reserved characters) before any data operation touches the database, and if the name fails that validation the request is rejected with this message including the underlying reason. It is surfaced as a thiserror variant converted automatically from DatabaseNameError via #[from].","triggerScenarios":"Calling POST /api/v3/write_lp, /write, or any endpoint with a `db` query parameter whose value violates database naming rules (e.g. contains invalid characters, is too long, is empty, or uses reserved names).","commonSituations":"Typos in connection strings or DSNs; programmatic database names generated from user input, file names, or UUIDs containing disallowed characters; migration from other systems that permit looser names; empty `db` parameter after template-variable substitution fails.","solutions":["Print the embedded cause ({0}) to see which naming rule was violated and correct the database name accordingly.","Sanitize the database name: use only letters, digits, underscores, and hyphens; keep it short and non-empty.","Check the `db` query parameter in the request URL for truncation or unencoded special characters; URL-encode if needed.","If names come from user input, validate them client-side with the same rules before calling the API."],"exampleFix":"// before\nlet url = format!(\"http://localhost:8181/api/v3/write_lp?db=my db #1\");\n// after\nlet db = \"my_db_1\"; // sanitized: no spaces or '#'\nlet url = format!(\"http://localhost:8181/api/v3/write_lp?db={db}\");","handlingStrategy":"validation","validationCode":"fn is_valid_db_name(name: &str) -> bool {\n    !name.is_empty()\n        && name.len() <= 64\n        && name.chars().all(|c| c.is_ascii_alphanumeric() || c == '_' || c == '-')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate database names against the documented charset/length rules before every API call.","Never pass raw user input or file names as database names; sanitize first.","URL-encode the db parameter in hand-built URLs."],"tags":["http-api","validation","database-name","influxdb3"],"backgroundTag":"invalid-identifier-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"}