influxdata/influxdb · error · V1WriteParseError::NoQueryParams
no db destination provided
Error message
no db destination provided
What it means
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.
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.
Example fix
// before POST /write?precision=s // after POST /write?db=mydb&rp=autogen&precision=s
Defensive patterns
Strategy: validation
Validate before calling
let params: Vec<(String, String)> = url.query_pairs().into_owned().collect(); assert!(params.iter().any(|(k, _)| k == "db"), "v1 write requires db param");
Try / catch
match err {
V1WriteParseError::NoQueryParams => /* 400: db query parameter required */,
other => /* propagate */,
} Prevention
- 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.
When it happens
Trigger: POSTing to /write or /api/v1/write with no db query parameter at all (e.g. ?precision=ns only, or no query string).
Common situations: Line-protocol clients that forgot the db= query parameter; proxy rewrites dropping the query string; older Telegraf configs missing the database option.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- failed to deserialize db/rp/precision in request
- failed to deserialize org/bucket/precision in request
- no org/bucket destination provided
- invalid request
- missing bucket value
AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19).
Data as JSON: /api/errors/3b7c359b6416dd72.
Report an issue: GitHub.
Appendix: source
Thrown at core/iox_http/src/write/v1.rs:20
//! single-tenancy clusters and edge/community/pro only.
//!
//! [V1 Write API]:
//! https://docs.influxdata.com/influxdb/v1.8/tools/api/#write-http-endpoint
use iox_http_util::Request;
use serde::{Deserialize, Deserializer};
use super::Precision;
// When a retention policy is provided, it is appended to the db field,
// separated by a single `/`.
pub const V1_NAMESPACE_RP_SEPARATOR: char = '/';
/// v1 DmlErrors returned when decoding the database / rp information from a
/// HTTP request and deriving the namespace name from it.
#[derive(Debug, thiserror::Error)]
pub enum V1WriteParseError {
/// The request contains no db destination information.
#[error("no db destination provided")]
NoQueryParams,
/// The request contains invalid parameters.
#[error("failed to deserialize db/rp/precision in request: {0}")]
DecodeFail(#[from] serde::de::value::Error),
}
/// May be empty string, explicit rp name, or `autogen`. As provided at the
/// write API. Handling is described in context of the construction of the
/// `NamespaceName`, and not an explicit honouring for retention duration.
#[derive(Debug, Default)]
pub enum RetentionPolicy {
/// The user did not specify a retention policy (at the write API).
#[default]
Unspecified,
/// Default on v1 database creation, if no rp was provided.
Autogen,
/// The user specified the name of the retention policy to be used.View on GitHub (pinned to 06200ef96b)