{"record":{"id":"da1b7a849ee44ff0","repo":"influxdata/influxdb","slug":"tried-accessing-database-that-does-not-exist","errorCode":null,"errorMessage":"tried accessing database that does not exist","messagePattern":"tried accessing database that does not exist","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"influxdb3_write/src/write_buffer/mod.rs","lineNumber":107,"sourceCode":"    #[error(\"corrupt load state: {0}\")]\n    CorruptLoadState(String),\n\n    #[error(\"database name error: {0}\")]\n    DatabaseNameError(#[from] DatabaseNameError),\n\n    #[error(\"error from table buffer: {0}\")]\n    TableBufferError(#[from] table_buffer::Error),\n\n    #[error(\"error in last cache: {0}\")]\n    LastCacheError(#[from] last_cache::Error),\n\n    #[error(\"database not found {db_name:?}\")]\n    DatabaseNotFound { db_name: String },\n\n    #[error(\"table not found {table_name:?} in db {db_name:?}\")]\n    TableNotFound { db_name: String, table_name: String },\n\n    #[error(\"tried accessing database that does not exist\")]\n    DbDoesNotExist,\n\n    #[error(\"tried creating database named '{0}' that already exists\")]\n    DatabaseExists(String),\n\n    #[error(\"cannot write to soft-deleted database '{0}' - it is marked for deletion\")]\n    DatabaseDeleted(String),\n\n    #[error(\"tried accessing table that do not exist\")]\n    TableDoesNotExist,\n\n    #[error(\"table '{db_name}.{table_name}' already exists\")]\n    TableAlreadyExists {\n        db_name: Arc<str>,\n        table_name: Arc<str>,\n    },\n\n    #[error(\"tried accessing column with name ({0}) that does not exist\")]","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_write/src/write_buffer/mod.rs#L89-L125","documentation":"Signals that an operation tried to access (read from or write through) a database that is not present in the catalog at all. Unlike `DatabaseNotFound`, which carries the missing name, this variant is thrown on access paths where the name isn't available or the lookup simply established the database does not exist.","triggerScenarios":"Internal access paths in the write buffer: getting a database handler by name during writes/queries when the catalog lookup returns nothing — e.g. writes to a never-created or since-dropped database.","commonSituations":"Stale references held by a long-running client after the database was dropped; routing/templated database names resolving to empty strings; environments where database auto-creation is disabled.","solutions":["Verify the database exists before accessing it, and create it if needed","Recreate any long-lived clients/handlers after a database drop","Check that configured database names are non-empty and correct"],"exampleFix":"// before\nlet db = buffer.database(&opts.db_name)?; // DbDoesNotExist if typo/empty\n// after\nif !buffer.database_exists(&opts.db_name) {\n    return Err(format!(\"database {:?} does not exist; create it first\", opts.db_name).into());\n}\nlet db = buffer.database(&opts.db_name)?;","handlingStrategy":"validation","validationCode":"// guard before any database access\nassert!(!db_name.is_empty(), \"db name must be non-empty\");\nassert!(catalog.contains_database(&db_name), \"database does not exist\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Invalidate cached database handles after drop operations","Validate templated database names resolve to real, non-empty values","Create required databases as part of deployment, before writers start","Log and alert on DbDoesNotExist to catch stale clients"],"tags":["database","not-found","influxdb"],"backgroundTag":"entity-not-found","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"}