{"record":{"id":"ab1def30d376c9a7","repo":"influxdata/influxdb","slug":"write-not-allowed-on-internal-database","errorCode":null,"errorMessage":"write not allowed on internal database","messagePattern":"write not allowed on internal database","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"influxdb3_write/src/write_buffer/mod.rs","lineNumber":146,"sourceCode":"    #[error(\n        \"updating catalog on delete of last cache failed, you will need to delete the cache \\\n        again on server restart\"\n    )]\n    DeleteLastCache(#[source] CatalogError),\n\n    #[error(\"error from wal: {0}\")]\n    WalError(#[from] influxdb3_wal::Error),\n\n    #[error(\"error in distinct value cache: {0}\")]\n    DistinctCacheError(#[from] distinct_cache::ProviderError),\n\n    #[error(\"cannot write to a compactor-only server\")]\n    NoWriteInCompactorOnly,\n\n    #[error(\"error: {0}\")]\n    AnyhowError(#[from] anyhow::Error),\n\n    #[error(\"write not allowed on internal database\")]\n    InternalDbWriteNotAllowed,\n}\n\npub type Result<T, E = Error> = std::result::Result<T, E>;\n\n#[derive(Debug)]\npub struct WriteRequest<'a> {\n    pub db_name: DatabaseName,\n    pub line_protocol: &'a str,\n    pub default_time: u64,\n}\n\nstruct WriteLpInner<'a> {\n    db_name: DatabaseName,\n    lp: &'a str,\n    ingest_time: Time,\n    accept_partial: bool,\n    precision: Precision,","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_write/src/write_buffer/mod.rs#L128-L164","documentation":"Returned when a write targets one of InfluxDB's reserved internal system databases. Internal databases back system/runtime data and are not writable by users, so all ingest attempts against them are rejected.","triggerScenarios":"Writing line protocol with a database name that collides with a reserved internal database name (e.g. system-managed dbs); misconfigured writer with db name like '_internal' or similar.","commonSituations":"Config copied from setups where an internal/system db was writable in older versions; scripts enumerating all databases and writing to each including internal ones.","solutions":["Write to a user-created database instead of the internal one","Filter out internal/system database names in automation that iterates databases","Fix the database name in the writer configuration","Check version docs — behavior/permissions of internal dbs may differ across versions"],"exampleFix":"// before\nclient.write(\"_internal\", lines)?;  // internal db\n// after\nclient.write(\"telemetry\", lines)?;","handlingStrategy":"validation","validationCode":"const INTERNAL_DBS: &[&str] = &[\"_internal\", \"system\"]; // per version docs\nif INTERNAL_DBS.contains(&db_name.as_str()) {\n    return Err(format!(\"{db_name} is internal; not writable\"));\n}","typeGuard":"fn is_internal_db_write(err: &WriteBufferError) -> bool {\n    matches!(err, WriteBufferError::InternalDbWriteNotAllowed)\n}","tryCatchPattern":"match buffer.write(db_name, lines) {\n    Err(WriteBufferError::InternalDbWriteNotAllowed) => {\n        eprintln!(\"{db_name} is a reserved internal database\");\n    }\n    other => other?,\n}","preventionTips":["Filter internal/system databases out of write automation","Keep a deny-list of reserved db names in writer configs","Validate the db name against documentation for your version"],"tags":["internal-database","write","permissions","influxdb3"],"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"}