{"record":{"id":"71bc935bf2046d93","repo":"influxdata/influxdb","slug":"cannot-modify-internal-db","errorCode":null,"errorMessage":"cannot modify internal db","messagePattern":"cannot modify internal db","errorType":"error_code","errorClass":"CatalogError","httpStatus":null,"severity":"error","filePath":"influxdb3_catalog/src/error.rs","lineNumber":294,"sourceCode":"    #[error(\"invalid error behavior {0}\")]\n    InvalidErrorBehavior(String),\n\n    #[error(\"cannot parse token permission, {0}\")]\n    CannotParsePermissionForToken(String),\n\n    #[error(\"token name already exists, {0}\")]\n    TokenNameAlreadyExists(String),\n\n    #[error(\"token hash already exists\")]\n    TokenHashAlreadyExists,\n\n    #[error(\"missing admin token, cannot update\")]\n    MissingAdminTokenToUpdate,\n\n    #[error(\"cannot delete internal db\")]\n    CannotDeleteInternalDatabase,\n\n    #[error(\"cannot modify internal db\")]\n    CannotModifyInternalDatabase,\n\n    #[error(\"tried to stop a node ({node_id}) that is already stopped\")]\n    NodeAlreadyStopped { node_id: Arc<str> },\n\n    #[error(\n        \"node '{node_id}' is not fully stopped (current state: {current_state}); run \\\"stop node\\\" first\"\n    )]\n    NodeNotFullyStopped {\n        node_id: Arc<str>,\n        current_state: &'static str,\n    },\n\n    #[error(\"node '{node_id}' has compact mode and cannot be removed\")]\n    NodeModeNotRemovable { node_id: Arc<str> },\n\n    #[error(\"invalid stop ack for node '{node_id}' (current state: {current_state})\")]\n    InvalidStopAck {","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_catalog/src/error.rs#L276-L312","documentation":"This error is returned when an operation attempts to modify (rename or otherwise alter) an internal database. Like deletion, modification of system-managed databases is forbidden because their schema and naming are invariants of the running system.","triggerScenarios":"Calling database-modification APIs (e.g. rename/update database) against a reserved/internal database name.","commonSituations":"Migration or refactoring scripts renaming databases wholesale; tools that treat all databases uniformly and attempt schema edits on system DBs.","solutions":["Skip internal/system databases (names beginning with `_`) in modification scripts","Verify the target database name before applying changes","Use the supported configuration for internal DB behavior instead of direct modification","Re-provision the system component if its database must change"],"exampleFix":"// before\ncatalog.rename_database(\"_internal\", \"internal_old\")?;\n// after\nif name.starts_with('_') {\n    return Err(anyhow!(\"refusing to modify internal db {name}\"));\n}\ncatalog.rename_database(&name, new_name)?;","handlingStrategy":"validation","validationCode":"fn is_internal_db(name: &str) -> bool { name.starts_with('_') }\nfn can_modify(name: &str) -> bool { !is_internal_db(name) }","typeGuard":null,"tryCatchPattern":"match rename_database(name, new) {\n    Err(CatalogError::CannotModifyInternalDatabase) => {/* skip system db */},\n    r => r,\n}","preventionTips":["Skip `_`-prefixed databases in rename/schema-change tooling","Use supported configuration for system DB behavior","Add a shared `is_internal_db` helper used by all admin scripts"],"tags":["catalog","database","protected-resource"],"backgroundTag":"permission-denied","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"}