influxdata/influxdb · error · CatalogError
cannot delete internal db
Error message
cannot delete internal db
What it means
This error is returned when an operation attempts to delete an internal database (databases reserved by the system, e.g. those with `_`-prefixed system names). Internal databases are managed by InfluxDB itself and cannot be removed through user-facing catalog APIs, so the request is rejected.
Solutions
- Exclude internal/system databases (e.g. names starting with `_`) from deletion logic
- Check the database name in the request for a stray system DB
- If disk space is the concern, use retention policies or compactor cleanup instead of deleting internal DBs
- Contact support/consider re-provisioning only if a system DB is genuinely corrupted
Example fix
// before
for db in catalog.list_databases() {
catalog.delete_database(&db.name)?;
}
// after
for db in catalog.list_databases() {
if !db.name.starts_with('_') {
catalog.delete_database(&db.name)?;
}
} Defensive patterns
Strategy: validation
Validate before calling
fn is_internal_db(name: &str) -> bool { name.starts_with('_') }
fn can_delete(name: &str) -> bool { !is_internal_db(name) } Try / catch
match delete_database(name) {
Err(CatalogError::CannotDeleteInternalDatabase) => {/* skip system db */},
r => r,
} Prevention
- Filter `_`-prefixed databases out of bulk-delete scripts
- Whitelist deletable databases instead of blacklisting
- Document that internal DBs are immutable
When it happens
Trigger: Calling database deletion (e.g. `delete_database` or the corresponding HTTP DELETE endpoint) against a reserved/internal database name.
Common situations: Automation scripts iterating over all databases and deleting them; attempting to clean up what looks like a stale system database; misconfigured tools that don't filter internal DB names.
Understand the failure class
Background: Permission denied / not authorized / 403 Forbidden: access-control rejections when the caller lacks the required role, grant, or ownership — this error's family across 18 libraries.
Related errors
- cannot modify internal db
- Database not found
- database should exist by id
- {0}
- Adding a new database would exceed limit of
AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19).
Data as JSON: /api/errors/64009a504ac5523c.
Report an issue: GitHub.
Appendix: source
Thrown at influxdb3_catalog/src/error.rs:291
context: Option<String>,
},
#[error("invalid error behavior {0}")]
InvalidErrorBehavior(String),
#[error("cannot parse token permission, {0}")]
CannotParsePermissionForToken(String),
#[error("token name already exists, {0}")]
TokenNameAlreadyExists(String),
#[error("token hash already exists")]
TokenHashAlreadyExists,
#[error("missing admin token, cannot update")]
MissingAdminTokenToUpdate,
#[error("cannot delete internal db")]
CannotDeleteInternalDatabase,
#[error("cannot modify internal db")]
CannotModifyInternalDatabase,
#[error("tried to stop a node ({node_id}) that is already stopped")]
NodeAlreadyStopped { node_id: Arc<str> },
#[error(
"node '{node_id}' is not fully stopped (current state: {current_state}); run \"stop node\" first"
)]
NodeNotFullyStopped {
node_id: Arc<str>,
current_state: &'static str,
},
#[error("node '{node_id}' has compact mode and cannot be removed")]
NodeModeNotRemovable { node_id: Arc<str> },View on GitHub (pinned to 06200ef96b)