{"record":{"id":"3b7c359b6416dd72","repo":"influxdata/influxdb","slug":"no-db-destination-provided","errorCode":null,"errorMessage":"no db destination provided","messagePattern":"no db destination provided","errorType":"validation","errorClass":"V1WriteParseError::NoQueryParams","httpStatus":null,"severity":"error","filePath":"core/iox_http/src/write/v1.rs","lineNumber":20,"sourceCode":"//! single-tenancy clusters and edge/community/pro only.\n//!\n//! [V1 Write API]:\n//!     https://docs.influxdata.com/influxdb/v1.8/tools/api/#write-http-endpoint\nuse iox_http_util::Request;\nuse serde::{Deserialize, Deserializer};\n\nuse super::Precision;\n\n// When a retention policy is provided, it is appended to the db field,\n// separated by a single `/`.\npub const V1_NAMESPACE_RP_SEPARATOR: char = '/';\n\n/// v1 DmlErrors returned when decoding the database / rp information from a\n/// HTTP request and deriving the namespace name from it.\n#[derive(Debug, thiserror::Error)]\npub enum V1WriteParseError {\n    /// The request contains no db destination information.\n    #[error(\"no db destination provided\")]\n    NoQueryParams,\n\n    /// The request contains invalid parameters.\n    #[error(\"failed to deserialize db/rp/precision in request: {0}\")]\n    DecodeFail(#[from] serde::de::value::Error),\n}\n\n/// May be empty string, explicit rp name, or `autogen`. As provided at the\n/// write API. Handling is described in context of the construction of the\n/// `NamespaceName`, and not an explicit honouring for retention duration.\n#[derive(Debug, Default)]\npub enum RetentionPolicy {\n    /// The user did not specify a retention policy (at the write API).\n    #[default]\n    Unspecified,\n    /// Default on v1 database creation, if no rp was provided.\n    Autogen,\n    /// The user specified the name of the retention policy to be used.","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/iox_http/src/write/v1.rs#L2-L38","documentation":"V1WriteParseError::NoQueryParams is returned when decoding a v1 HTTP write request: the request contained no db destination information at all. Without db (and optionally rp) the library cannot derive the target namespace name, so the write is rejected.","triggerScenarios":"POSTing to /write or /api/v1/write with no db query parameter at all (e.g. ?precision=ns only, or no query string).","commonSituations":"Line-protocol clients that forgot the db= query parameter; proxy rewrites dropping the query string; older Telegraf configs missing the database option.","solutions":["Add the db query parameter to the v1 write URL (e.g. /write?db=mydb).","Check that the HTTP client forwards the query string (no stripping by proxy or redirect).","If using rp, also supply rp= alongside db=.","Match on V1WriteParseError::NoQueryParams and return HTTP 400 instructing the user to provide db."],"exampleFix":"// before\nPOST /write?precision=s\n// after\nPOST /write?db=mydb&rp=autogen&precision=s","handlingStrategy":"validation","validationCode":"let params: Vec<(String, String)> = url.query_pairs().into_owned().collect();\nassert!(params.iter().any(|(k, _)| k == \"db\"), \"v1 write requires db param\");","typeGuard":null,"tryCatchPattern":"match err {\n    V1WriteParseError::NoQueryParams => /* 400: db query parameter required */,\n    other => /* propagate */,\n}","preventionTips":["Template v1 write URLs with db filled in from config.","Fail fast at client init if the database setting is empty.","Log full request URLs to catch proxies stripping query strings."],"tags":["http","write-api","v1","query-params"],"backgroundTag":"missing-required-argument","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"}