influxdata/influxdb · error · ValidateDbNameError
db name with invalid retention policy, if providing a…
Error message
db name with invalid retention policy, if providing a retention policy name, must be of form '<db_name>/<rp_name>'
What it means
Variant `InvalidRetentionPolicy` of `ValidateDbNameError` in influxdb3_server/src/http.rs. When a name includes a retention policy it must be split with a forward slash as `<db_name>/<rp_name>`; any other separator or structure (multiple slashes, dots, empty rp) is rejected.
Solutions
- Use the forward-slash form: `db=mydb/autogen` instead of `db=mydb.autogen`
- Ensure exactly one slash separates db and rp, and neither part is empty
- Update migration scripts/clients from InfluxDB 1.x dot notation to slash notation
Example fix
// before curl 'host/api/v3/write?db=mydb.autogen' --data 'm v=1' // after curl 'host/api/v3/write?db=mydb/autogen' --data 'm v=1'
Defensive patterns
Strategy: validation
Validate before calling
function validateDbRp(name) {
if (name.includes('/') && !/^[^/]+\/[^/]+$/.test(name)) {
throw new Error("use form '<db_name>/<rp_name>' with a single slash");
}
} Type guard
const isDbRpForm = (n) => typeof n === 'string' && /^[^/]+\/[^/]+$/.test(n);
Try / catch
try {
return await api.write(dbRp, data);
} catch (e) {
if (String(e.message).includes('invalid retention policy')) {
throw new ValidationError(`convert to <db>/<rp> form: '${dbRp}'`);
}
throw e;
} Prevention
- Convert InfluxDB 1.x 'db.rp' dot notation to 'db/rp' when migrating
- Join db and rp with exactly one forward slash in code generators
When it happens
Trigger: Passing `db=mydb.rp` (dot notation), `db=mydb//rp`, or a db/rp string that does not match the single-slash form to the write/query endpoints.
Common situations: Migrating from InfluxDB 1.x where `db.rp` dot notation was used; copy-pasted DSN strings; programmatic concatenation that inserts the wrong delimiter.
Understand the failure class
Background: "invalid id" errors: invalid identifier format — why libraries reject IDs before lookup, and how to fix them — this error's family across 37 libraries.
Related errors
- db name cannot be empty
- db name did not start with a number or letter
- db name too long: max
- invalid character in database or rp name: must be ASCII…
- database name ' ' contains invalid character, character…
AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19).
Data as JSON: /api/errors/bd2726de4dff7478.
Report an issue: GitHub.
Appendix: source
Thrown at influxdb3_server/src/http.rs:2429
Ok(())
}
// v1 supports 255 chars for the database name and 255 chars for the
// retention policy name; we support those combined with a forward slash so
// 255*2+1.
const MAXIMUM_DATABASE_NAME_LENGTH: usize = 511;
#[derive(Clone, Copy, Debug, thiserror::Error)]
pub enum ValidateDbNameError {
#[error(
"invalid character in database or rp name: must be ASCII, \
containing only letters, numbers, underscores, or hyphens"
)]
InvalidChar,
#[error("db name did not start with a number or letter")]
InvalidStartChar,
#[error(
"db name with invalid retention policy, if providing a \
retention policy name, must be of form '<db_name>/<rp_name>'"
)]
InvalidRetentionPolicy,
#[error("db name cannot be empty")]
Empty,
#[error("db name too long: max {}", MAXIMUM_DATABASE_NAME_LENGTH)]
NameTooLong,
}
async fn record_batch_stream_to_body(
mut stream: Pin<Box<dyn RecordBatchStream + Send>>,
format: QueryFormat,
) -> Result<ResponseBody, Error> {
match format {
QueryFormat::Pretty => {
let batches = stream.try_collect::<Vec<RecordBatch>>().await?;
Ok(bytes_to_response_body(Bytes::from(format!(View on GitHub (pinned to 06200ef96b)